-
public interface IPreferencesServiceProvides access to the low level preferences. There are one or more preference stores, identified by PreferenceStores, each store contains a key for each preference. Each key has a known data type, it's value can be fetched/stored as needed. Stored preferences will persist across the lifetime of the app installation.
-
-
Method Summary
Modifier and Type Method Description abstract StringgetString(String store, String key, String defValue)Retrieve a String value identified by the store and key provided. abstract BooleangetBool(String store, String key, Boolean defValue)Retrieve a Boolean value identified by the store and key provided. abstract IntegergetInt(String store, String key, Integer defValue)Retrieve a Int value identified by the store and key provided. abstract LonggetLong(String store, String key, Long defValue)Retrieve a Long value identified by the store and key provided. abstract Set<String>getStringSet(String store, String key, Set<String> defValue)Retrieve a Set of String value identified by the store and key provided. abstract UnitsaveString(String store, String key, String value)Save a String value identified by the store and key provided. abstract UnitsaveBool(String store, String key, Boolean value)Save a Boolean value identified by the store and key provided. abstract UnitsaveInt(String store, String key, Integer value)Save a Int value identified by the store and key provided. abstract UnitsaveLong(String store, String key, Long value)Save a Long value identified by the store and key provided. abstract UnitsaveStringSet(String store, String key, Set<String> value)Save a Set of String value identified by the store and key provided. -
-
Method Detail
-
getString
abstract String getString(String store, String key, String defValue)
- Parameters:
store- The name of the preference store.key- The key to retrieve.defValue- The optional default value to return, if the key was not previously saved.
-
getBool
abstract Boolean getBool(String store, String key, Boolean defValue)
- Parameters:
store- The name of the preference store.key- The key to retrieve.defValue- The optional default value to return, if the key was not previously saved.
-
getInt
abstract Integer getInt(String store, String key, Integer defValue)
- Parameters:
store- The name of the preference store.key- The key to retrieve.defValue- The optional default value to return, if the key was not previously saved.
-
getLong
abstract Long getLong(String store, String key, Long defValue)
- Parameters:
store- The name of the preference store.key- The key to retrieve.defValue- The optional default value to return, if the key was not previously saved.
-
getStringSet
abstract Set<String> getStringSet(String store, String key, Set<String> defValue)
- Parameters:
store- The name of the preference store.key- The key to retrieve.defValue- The optional default value to return, if the key was not previously saved.
-
saveString
abstract Unit saveString(String store, String key, String value)
- Parameters:
store- The name of the preference store.key- The key to retrieve.value- The value to save.
-
saveBool
abstract Unit saveBool(String store, String key, Boolean value)
- Parameters:
store- The name of the preference store.key- The key to retrieve.value- The value to save.
-
saveInt
abstract Unit saveInt(String store, String key, Integer value)
- Parameters:
store- The name of the preference store.key- The key to retrieve.value- The value to save.
-
saveLong
abstract Unit saveLong(String store, String key, Long value)
- Parameters:
store- The name of the preference store.key- The key to retrieve.value- The value to save.
-
-
-
-