source: josm/trunk/src/org/openstreetmap/josm/data/preferences/ListProperty.java @ 13002

Last change on this file since 13002 was 13002, checked in by bastiK, 17 months ago

see #15229 - remove some uses of Main.pref

File size: 837 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import java.util.List;
5
6/**
7 * A property containing a {@code List} of {@code String} as value.
8 */
9public class ListProperty extends AbstractProperty<List<String>> {
10
11    /**
12     * Constructs a new {@code CollectionProperty}.
13     * @param key The property key
14     * @param defaultValue The default value
15     */
16    public ListProperty(String key, List<String> defaultValue) {
17        super(key, defaultValue);
18        if (getPreferences() != null) {
19            get();
20        }
21    }
22
23    @Override
24    public List<String> get() {
25        return getPreferences().getList(getKey(), getDefaultValue());
26    }
27
28    @Override
29    public boolean put(List<String> value) {
30        return getPreferences().putList(getKey(), value);
31    }
32}
Note: See TracBrowser for help on using the repository browser.