Package ch.tocco.nice2.usersettings.api
Interface Preferences
- All Superinterfaces:
ReadOnlyMap<String>
,WriteableMap<String>
- All Known Implementing Classes:
PreferencesImpl
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the preferences map.getNode()
The node identifying this preferences map.boolean
void
reload()
Reloads all values from the storage.void
save()
Saves all changed values to the underlying storage.void
setAutoFlush
(boolean flag) Sets the auto-flush property.toMap()
Methods inherited from interface ch.tocco.nice2.toolbox.api.collection.ReadOnlyMap
containsKey, getBoolean, getBoolean, getDate, getDate, getDecimal, getDecimal, getDouble, getDouble, getEnum, getEnum, getFloat, getFloat, getInt, getInt, getLong, getLong, getString, getString, getValue, getValue, keySet
Methods inherited from interface ch.tocco.nice2.toolbox.api.collection.WriteableMap
removeValue, setBoolean, setDate, setDecimal, setDouble, setEnum, setFloat, setInt, setLong, setString, setValue
-
Field Details
-
KEY_FIELD
- See Also:
-
VALUE_FIELD
- See Also:
-
PATH_FIELD
- See Also:
-
PREF_ENTITY
- See Also:
-
-
Method Details
-
getNode
Node getNode()The node identifying this preferences map. -
setAutoFlush
void setAutoFlush(boolean flag) Sets the auto-flush property. If set totrue
, each call to a setter will immediately cause saving all changed values.- Parameters:
flag
- autoflush
-
isAutoFlush
boolean isAutoFlush()- Returns:
- whether
autoflush
mode is enabled or not
-
save
void save()Saves all changed values to the underlying storage. -
reload
void reload()Reloads all values from the storage. Note, that all changed values are lost. -
clear
void clear()Clears the preferences map. If not flushed, any unsaved changes that happened before theclear()
are discarded. All changes afterclear()
are recorded as usual.- Specified by:
clear
in interfaceWriteableMap<String>
-
toMap
-