Class PrefEntry
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.advanced.PrefEntry
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PrefEntry other)booleanequals(java.lang.Object obj)Setting<?>getDefaultValue()Returns the preference default value.java.lang.StringgetKey()Returns the preference key.Setting<?>getValue()Returns the preference value.inthashCode()booleanisChanged()Determines if this preference entry has been modified.booleanisDefault()Determines if the current value is the default value.voidmarkAsChanged()Marks this preference entry as modified.voidreset()Resets this preference entry to default state.voidsetValue(Setting<?> value)Sets the preference value.java.lang.StringtoString()
-
-
-
Constructor Detail
-
PrefEntry
public PrefEntry(java.lang.String key, Setting<?> value, Setting<?> defaultValue, boolean isDefault)
Constructs a newPrefEntry.- Parameters:
key- The preference keyvalue- The preference valuedefaultValue- The preference default valueisDefault- determines if the current value is the default value
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Returns the preference key.- Returns:
- the preference key
-
getDefaultValue
public Setting<?> getDefaultValue()
Returns the preference default value.- Returns:
- the preference default value
-
setValue
public void setValue(Setting<?> value)
Sets the preference value.- Parameters:
value- the preference value
-
isDefault
public boolean isDefault()
Determines if the current value is the default value.- Returns:
trueif the current value is the default value,falseotherwise
-
isChanged
public boolean isChanged()
Determines if this preference entry has been modified.- Returns:
trueif this preference entry has been modified,falseotherwise
-
markAsChanged
public void markAsChanged()
Marks this preference entry as modified.
-
reset
public void reset()
Resets this preference entry to default state.
-
compareTo
public int compareTo(PrefEntry other)
- Specified by:
compareToin interfacejava.lang.Comparable<PrefEntry>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-