Class StringProperty
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.AbstractProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty<java.lang.String>
-
- org.openstreetmap.josm.data.preferences.StringProperty
-
public class StringProperty extends AbstractToStringProperty<java.lang.String>
A property containing anStringvalue.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
AbstractToStringProperty.ChildProperty<T>
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T>
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key, preferences
-
-
Constructor Summary
Constructors Constructor Description StringProperty(java.lang.String key, java.lang.String defaultValue)Constructs a newStringProperty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringfromString(java.lang.String string)Converts the string to an object of the given type.java.lang.Stringget()Replies the value of this property.booleanput(java.lang.String value)Sets this property to the specified value.protected java.lang.StringtoString(java.lang.String string)Converts the string to an object of the given type.-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
getAsString, getChildProperty, getSpecialized
-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addListenerImpl, addWeakListener, cached, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValue
-
-
-
-
Constructor Detail
-
StringProperty
public StringProperty(java.lang.String key, java.lang.String defaultValue)
Constructs a newStringProperty.- Parameters:
key- The property keydefaultValue- The default value
-
-
Method Detail
-
get
public java.lang.String get()
Description copied from class:AbstractPropertyReplies the value of this property.- Overrides:
getin classAbstractToStringProperty<java.lang.String>- Returns:
- the value of this property
-
put
public boolean put(java.lang.String value)
Description copied from class:AbstractPropertySets this property to the specified value.- Overrides:
putin classAbstractToStringProperty<java.lang.String>- Parameters:
value- The new value of this property- Returns:
- true if something has changed (i.e. value is different than before)
-
fromString
protected java.lang.String fromString(java.lang.String string)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<java.lang.String>- Parameters:
string- The string- Returns:
- The object.
-
toString
protected java.lang.String toString(java.lang.String string)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<java.lang.String>- Parameters:
string- The object.- Returns:
- The string representing the object
-
-