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 int
compareTo(PrefEntry other)
boolean
equals(java.lang.Object obj)
Setting<?>
getDefaultValue()
Returns the preference default value.java.lang.String
getKey()
Returns the preference key.Setting<?>
getValue()
Returns the preference value.int
hashCode()
boolean
isChanged()
Determines if this preference entry has been modified.boolean
isDefault()
Determines if the current value is the default value.void
markAsChanged()
Marks this preference entry as modified.void
reset()
Resets this preference entry to default state.void
setValue(Setting<?> value)
Sets the preference value.java.lang.String
toString()
-
-
-
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:
true
if the current value is the default value,false
otherwise
-
isChanged
public boolean isChanged()
Determines if this preference entry has been modified.- Returns:
true
if this preference entry has been modified,false
otherwise
-
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:
compareTo
in interfacejava.lang.Comparable<PrefEntry>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-