A service that manages saving and retrieving of a user's preferences. A preference is a string value stored using a key (a simple map).
Methods
get Preference(preference Key) → {String}
Returns the user preference.
Parameters:
Name | Type | Description |
---|---|---|
preferenceKey |
String | string preference key. |
Returns:
String preference value.
- Type
- String
get Preferences() → {Map}
Returns a map of preferences that the user has set either within the current session or in a previous session.
Returns:
a map of preference names to values
- Type
- Map
remove Preference(preference Key)
Deletes the user preference.
Parameters:
Name | Type | Description |
---|---|---|
preferenceKey |
String | The preference to remove. |
save Preferences()
Persists the current user preferences.
set Preference(preference Key, preference Value)
Sets the user preference.
Parameters:
Name | Type | Description |
---|---|---|
preferenceKey |
String | The preference key to set |
preferenceValue |
String | The value to set. |
set Preferences(preferences)
Sets user preferences from a map of preference names to preference values.
Parameters:
Name | Type | Description |
---|---|---|
preferences |
Map | the map of preferences names to values |