001 // License: GPL. For details, see LICENSE file. 002 package org.openstreetmap.josm.data.preferences; 003 004 import org.openstreetmap.josm.Main; 005 006 /** 007 * A property containing an {@code String} value. 008 */ 009 public class StringProperty extends AbstractProperty<String> { 010 011 /** 012 * Constructs a new {@code StringProperty}. 013 * @param key The property key 014 * @param defaultValue The default value 015 */ 016 public StringProperty(String key, String defaultValue) { 017 super(key, defaultValue); 018 } 019 020 @Override 021 public String get() { 022 return Main.pref.get(getKey(), getDefaultValue()); 023 } 024 025 @Override 026 public boolean put(String value) { 027 return Main.pref.put(getKey(), value); 028 } 029 }