Package 

Interface IPreferencesService


  • 
    public interface IPreferencesService
    
                        

    Provides 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 Detail

      • getString

         abstract String getString(String store, String key, String defValue)

        Retrieve a String value identified by the store and key provided.

        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)

        Retrieve a Boolean value identified by the store and key provided.

        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)

        Retrieve a Int value identified by the store and key provided.

        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)

        Retrieve a Long value identified by the store and key provided.

        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)

        Retrieve a Set of String value identified by the store and key provided.

        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)

        Save a String value identified by the store and key provided.

        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)

        Save a Boolean value identified by the store and key provided.

        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)

        Save a Int value identified by the store and key provided.

        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)

        Save a Long value identified by the store and key provided.

        Parameters:
        store - The name of the preference store.
        key - The key to retrieve.
        value - The value to save.