Class DefaultPersistentStorage

java.lang.Object
com.artifex.solib.DefaultPersistentStorage
All Implemented Interfaces:
SOPersistentStorage

public class DefaultPersistentStorage extends Object implements SOPersistentStorage
  • Constructor Details

    • DefaultPersistentStorage

      public DefaultPersistentStorage()
  • Method Details

    • getStorageObject

      public Object getStorageObject(android.content.Context context, String storeName)
      This method will be called to obtain a storage object for the named store.

      Specified by:
      getStorageObject in interface SOPersistentStorage
      Parameters:
      context - The application context
      storeName - The data store identifier
      Returns:
      The object to be used to manage the persistent store.
    • setStringPreference

      public void setStringPreference(Object storageObject, String key, String value)
      This method will be called to set a key/value pair in the store.

      Specified by:
      setStringPreference in interface SOPersistentStorage
      Parameters:
      context - The object to be used to manage the persistent store
      key - The data key
      value - The data value
    • getStringPreference

      public String getStringPreference(Object storageObject, String key, String defaultValue)
      This method will be called to retrieve data, identified by key, from the store.

      The default value should be returned if the key does not reside in the store.
      Specified by:
      getStringPreference in interface SOPersistentStorage
      Parameters:
      context - The object to be used to manage the persistent store
      key - The data key
      defaultValue - The default data value
      Returns:
      The current author name.
    • getAllStringPreferences

      public Map<String,?> getAllStringPreferences(Object storageObject)
      This method will be called to retrieve all entries from the persistent store.

      This method is not required to be implemented.
      Specified by:
      getAllStringPreferences in interface SOPersistentStorage
      Parameters:
      storageObject - The object to be used to manage the store.
      Returns:
      The retrieved key/value pairs.
    • removePreference

      public void removePreference(Object storageObject, String key)
      This method will be called to remove an entry from the persistent store. .

      This method is not required to be implemented.
      Specified by:
      removePreference in interface SOPersistentStorage
      Parameters:
      storageObject - The object to be used to manage the store.
      key - The data key