Class JsonPreferences
java.lang.Object
is.codion.common.model.preferences.JsonPreferences
In-memory hierarchical JSON storage for preferences — the storage half of
JsonPreferencesStore, without any
file handling. Path-addressed ("a/b/c") get/put/remove of string values, plus child-node listing. Thread-safe.
A value is returned as it was put. One that is JSON in the form this class writes it, {"w":100,"i":0},
is stored nested, for a readable file, and may come back with its members in another order once the file has
been read again; any other value is stored as the string it is, text that merely starts with a bracket included.
jsonPreferences() wraps a fresh instance as a free-floating, file-less Preferences node — useful for
capturing or transferring preference state in memory (dependency panels) and for hermetic tests that must
not touch the real user preferences store.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic PreferencesA key and a child node can not share a name, as withFilePreferences.
-
Method Details
-
jsonPreferences
A key and a child node can not share a name, as withFilePreferences.- Returns:
- a file-less, in-memory
Preferencesnode backed by a freshJsonPreferences
-