Interface
caplin.services

PreferencesService

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).

Constructor Summary

Attributes Name and Description
caplin.services.PreferencesService()

Method Summary

Attributes Name and Description
String getPreference(String sPreferenceKey)

Returns the user preference.

Map getPreferences()

Returns a map of preferences that the user has set either within the current session or in a previous session.

void removePreference(String sPreferenceKey)

Deletes the user preference.

void savePreferences()

Persists the current user preferences.

void setPreference(String sPreferenceKey, String sPreferenceValue)

Sets the user preference.

void setPreferences(Map mPreferences)

Sets user preferences from a map of preference names to preference values.

Constructor Detail

caplin.services.PreferencesService()

Method Detail

String getPreference(String sPreferenceKey)

Returns the user preference.

Parameters
String sPreferenceKey string preference key
Returns
{String} string preference value

Map getPreferences()

Returns a map of preferences that the user has set either within the current session or in a previous session.

Returns
{Map} a map of preference names to values

void removePreference(String sPreferenceKey)

Deletes the user preference.

Parameters
String sPreferenceKey The preference to remove.

void savePreferences()

Persists the current user preferences.

void setPreference(String sPreferenceKey, String sPreferenceValue)

Sets the user preference.

Parameters
String sPreferenceKey The preference key to set
String sPreferenceValue The value to set.

void setPreferences(Map mPreferences)

Sets user preferences from a map of preference names to preference values.

Parameters
Map mPreferences the map of preferences names to values