Interface
caplin.services.testing

PreferencesServiceStub

A service that manages saving and retrieving of a users preferences. A preference is a value string value stored using a key. (A simple map).

Constructor Summary

Attributes Name and Description
caplin.services.testing.PreferencesServiceStub()

Method Summary

Attributes Name and Description
String getPreference(String sKey)

Returns a preference that the user has either set within the current session or in a previous session

Map getPreferences()

Returns the user preferences

void savePreferences()

Persists the current preferences.

void setPreferences(String sKey, String sValue)

Persists a single key/value pair preference.

Methods implemented from class caplin.services.PreferencesService:
removePreference, setPreference

Constructor Detail

caplin.services.testing.PreferencesServiceStub()

Method Detail

String getPreference(String sKey)

Returns a preference that the user has either set within the current session or in a previous session

Parameters
String sKey The key for the key value store
Returns
{String} sValue

Map getPreferences()

Returns the user preferences

Returns
{Map} a map of preference names to values

void savePreferences()

Persists the current preferences.

Returns
void

void setPreferences(String sKey, String sValue)

Persists a single key/value pair preference.

Parameters
String sKey the key for the kv store
String sValue If sValue is not a string it will be converted into one if it can't be converted, an error will be thrown
Returns
void