Class MetisPreferenceSet.MetisPreferenceItem
java.lang.Object
io.github.tonywasher.joceanus.metis.preference.MetisPreferenceSet.MetisPreferenceItem
- Direct Known Subclasses:
MetisPreferenceSet.MetisBooleanPreference,MetisPreferenceSet.MetisDatePreference,MetisPreferenceSet.MetisEnumPreference,MetisPreferenceSet.MetisIntegerPreference,MetisPreferenceSet.MetisStringPreference,PrometheusPreferenceSet.PrometheusByteArrayPreference,PrometheusPreferenceSet.PrometheusCharArrayPreference
- Enclosing class:
MetisPreferenceSet
Underlying preference item class.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetisPreferenceItem(MetisPreferenceSet pSet, MetisPreferenceKey pKey, MetisPreferenceSet.MetisPreferenceId pType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionObtain the display name of the preference.protected PreferencesObtain the preference handle.protected MetisPreferenceKeygetKey()Obtain the key of the preference.protected StringObtain the name of the preference.protected MetisPreferenceSetgetSet()Obtain the preferenceSet.getType()Obtain the type of the preference.protected ObjectgetValue()Obtain the value of the preference.(package private) ObjectObtain viewer value.booleanIs the preference available?booleanIs the preference changed?booleanisHidden()Is the preference hidden?voidsetHidden(boolean pHidden) Set hidden.protected voidsetNewValue(Object pNewValue) Set new value.protected voidsetTheValue(Object pValue) Set value.protected abstract voidstoreThePreference(Object pNewValue) Store the value of the preference.
-
Constructor Details
-
MetisPreferenceItem
protected MetisPreferenceItem(MetisPreferenceSet pSet, MetisPreferenceKey pKey, MetisPreferenceSet.MetisPreferenceId pType) Constructor.- Parameters:
pSet- the preference SetpKey- the key of the preferencepType- the type of the preference
-
-
Method Details
-
getViewerValue
Object getViewerValue()Obtain viewer value.- Returns:
- the value
-
getSet
Obtain the preferenceSet.- Returns:
- the set
-
getHandle
Obtain the preference handle.- Returns:
- the preference handle
-
getKey
Obtain the key of the preference.- Returns:
- the key of the preference
-
getPreferenceName
Obtain the name of the preference.- Returns:
- the name of the preference
-
getDisplay
Obtain the display name of the preference.- Returns:
- the display name of the preference
-
getType
Obtain the type of the preference.- Returns:
- the type of the preference
-
getValue
Obtain the value of the preference.- Returns:
- the value of the preference
-
isAvailable
public boolean isAvailable()Is the preference available?- Returns:
- true/false
-
isChanged
public boolean isChanged()Is the preference changed?- Returns:
- true/false
-
isHidden
public boolean isHidden()Is the preference hidden?- Returns:
- true/false
-
setHidden
public void setHidden(boolean pHidden) Set hidden.- Parameters:
pHidden- true/false
-
setTheValue
Set value.- Parameters:
pValue- the value
-
setNewValue
Set new value.- Parameters:
pNewValue- the new value
-
storeThePreference
Store the value of the preference.- Parameters:
pNewValue- the new value to store- Throws:
OceanusException- on error
-