Class StringProperty
java.lang.Object
org.openstreetmap.josm.data.preferences.AbstractProperty<T>
org.openstreetmap.josm.data.preferences.AbstractToStringProperty<String>
org.openstreetmap.josm.data.preferences.StringProperty
A property containing an
String value.-
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
ConstructorsConstructorDescriptionStringProperty(String key, String defaultValue) Constructs a newStringProperty. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringfromString(String string) Converts the string to an object of the given type.get()Replies the value of this property.booleanSets this property to the specified value.protected StringConverts the string to an object of the given type.Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
getAsString, getChildProperty, getSpecializedMethods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addListenerImpl, addWeakListener, cached, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValue
-
Constructor Details
-
StringProperty
Constructs a newStringProperty.- Parameters:
key- The property keydefaultValue- The default value
-
-
Method Details
-
get
Description copied from class:AbstractPropertyReplies the value of this property.- Overrides:
getin classAbstractToStringProperty<String>- Returns:
- the value of this property
-
put
Description copied from class:AbstractPropertySets this property to the specified value.- Overrides:
putin classAbstractToStringProperty<String>- Parameters:
value- The new value of this property- Returns:
- true if something has changed (i.e. value is different than before)
-
fromString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<String>- Parameters:
string- The string- Returns:
- The object.
-
toString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<String>- Parameters:
string- The object.- Returns:
- The string representing the object
-