Modifier and Type | Field and Description |
---|---|
private boolean |
changed |
private Preferences.Setting<?> |
defaultValue |
private boolean |
isDefault |
private java.lang.String |
key |
private Preferences.Setting<?> |
value |
Constructor and Description |
---|
PrefEntry(java.lang.String key,
Preferences.Setting<?> value,
Preferences.Setting<?> defaultValue,
boolean isDefault)
Constructs a new
PrefEntry . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PrefEntry other) |
Preferences.Setting<?> |
getDefaultValue()
Returns the preference default value.
|
java.lang.String |
getKey()
Returns the preference key.
|
Preferences.Setting<?> |
getValue()
Returns the preference value.
|
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(Preferences.Setting<?> value)
Sets the preference value.
|
java.lang.String |
toString() |
private java.lang.String key
private Preferences.Setting<?> value
private Preferences.Setting<?> defaultValue
private boolean isDefault
private boolean changed
public PrefEntry(java.lang.String key, Preferences.Setting<?> value, Preferences.Setting<?> defaultValue, boolean isDefault)
PrefEntry
.key
- The preference keyvalue
- The preference valuedefaultValue
- The preference default valueisDefault
- determines if the current value is the default valuepublic java.lang.String getKey()
public Preferences.Setting<?> getValue()
public Preferences.Setting<?> getDefaultValue()
public void setValue(Preferences.Setting<?> value)
value
- the preference valuepublic boolean isDefault()
true
if the current value is the default value, false
otherwisepublic boolean isChanged()
true
if this preference entry has been modified, false
otherwisepublic void markAsChanged()
public void reset()
public int compareTo(PrefEntry other)
compareTo
in interface java.lang.Comparable<PrefEntry>
public java.lang.String toString()
toString
in class java.lang.Object