source: josm/trunk/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java@ 8390

Last change on this file since 8390 was 5464, checked in by Don-vip, 12 years ago

Rework Properties a bit to simplify management of Color properties

  • Property svn:eol-style set to native
File size: 851 bytes
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
8/**
9 * A property containing a {@code Collection} of {@code String} as value.
10 */
11public class CollectionProperty extends AbstractProperty<Collection<String>> {
12
13 /**
14 * Constructs a new {@code CollectionProperty}.
15 * @param key The property key
16 * @param defaultValue The default value
17 */
18 public CollectionProperty(String key, Collection<String> defaultValue) {
19 super(key, defaultValue);
20 }
21
22 @Override
23 public Collection<String> get() {
24 return Main.pref.getCollection(getKey(), getDefaultValue());
25 }
26
27 @Override
28 public boolean put(Collection<String> value) {
29 return Main.pref.putCollection(getKey(), value);
30 }
31}
Note: See TracBrowser for help on using the repository browser.