Package com.artifex.solib
Interface SOPersistentStorage
- All Known Implementing Classes:
DefaultPersistentStorage
public interface SOPersistentStorage
This interface specifies the basis for implementing a class allowing
for storage/retrieval of key/value pairs.
-
Method Summary
Modifier and TypeMethodDescriptiongetAllStringPreferences(Object storageObject) This method will be called to retrieve all entries from the persistent store.getStorageObject(android.content.Context context, String storeName) This method will be called to obtain a storage object for the named store.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.voidremovePreference(Object storageObject, String key) This method will be called to remove an entry from the persistent store.voidsetStringPreference(Object storageObject, String key, String value) This method will be called to set a key/value pair in the store.
-
Method Details
-
getStorageObject
This method will be called to obtain a storage object for the named store.- Parameters:
context- The application contextstoreName- The data store identifier- Returns:
- The object to be used to manage the store.
-
setStringPreference
This method will be called to set a key/value pair in the store.- Parameters:
storageObject- The object to be used to manage the store.key- The data keyvalue- The data value
-
getStringPreference
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.- Parameters:
storageObject- The object to be used to manage the store.key- The data keydefaultValue- The default data value- Returns:
- The retrieved string.
-
getAllStringPreferences
This method will be called to retrieve all entries from the persistent store.- Parameters:
storageObject- The object to be used to manage the store.- Returns:
- The retrieved key/value pairs.
-
removePreference
This method will be called to remove an entry from the persistent store. .- Parameters:
storageObject- The object to be used to manage the store.key- The data key
-