source: josm/trunk/src/org/openstreetmap/josm/data/preferences/StringProperty.java@ 7599

Last change on this file since 7599 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: 717 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import org.openstreetmap.josm.Main;
5
6/**
7 * A property containing an {@code String} value.
8 */
9public class StringProperty extends AbstractProperty<String> {
10
11 /**
12 * Constructs a new {@code StringProperty}.
13 * @param key The property key
14 * @param defaultValue The default value
15 */
16 public StringProperty(String key, String defaultValue) {
17 super(key, defaultValue);
18 }
19
20 @Override
21 public String get() {
22 return Main.pref.get(getKey(), getDefaultValue());
23 }
24
25 @Override
26 public boolean put(String value) {
27 return Main.pref.put(getKey(), value);
28 }
29}
Note: See TracBrowser for help on using the repository browser.