source: josm/trunk/src/org/openstreetmap/josm/data/preferences/ParametrizedCollectionProperty.java @ 5241

Revision 5170, 728 bytes checked in by Don-vip, 6 weeks ago (diff)

cleanup svn:mime-type properties preventing Java sources from being viewed as such on Trac

  • Property svn:eol-style set to native
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import java.util.Collection;
5
6import org.openstreetmap.josm.Main;
7
8public abstract class ParametrizedCollectionProperty {
9
10    private final Collection<String> defaultValue;
11
12    public ParametrizedCollectionProperty(Collection<String> defaultValue) {
13        this.defaultValue = defaultValue;
14    }
15
16    protected abstract String getKey(String... params);
17
18    public Collection<String> get(String... params) {
19        return Main.pref.getCollection(getKey(params), defaultValue);
20    }
21
22    public boolean put(Collection<String> value, String... params) {
23        return Main.pref.putCollection(getKey(params), value);
24    }
25
26}
Note: See TracBrowser for help on using the repository browser.