public class AWSKeyValueStore
extends java.lang.Object
Constructor and Description |
---|
AWSKeyValueStore(android.content.Context context,
java.lang.String sharedPreferencesName,
boolean isPersistenceEnabled)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the data stored in this key-value store.
|
boolean |
contains(java.lang.String dataKey)
Check if there is a key-value pair for the key
passed in.
|
java.lang.String |
get(java.lang.String dataKey)
Retrieve the value for the given key from the key-value store.
|
void |
put(java.lang.String dataKey,
java.lang.String value)
Store the key-value pair in the key-value store.
|
void |
remove(java.lang.String dataKey)
Remove the key-value pair identified by the key
from the key-value store.
|
void |
setPersistenceEnabled(boolean isPersistenceEnabled)
Enable or disable persistence.
|
public AWSKeyValueStore(android.content.Context context, java.lang.String sharedPreferencesName, boolean isPersistenceEnabled)
context
- the Android application contextsharedPreferencesName
- the name of the preferences
that namespaces the information to be storedisPersistenceEnabled
- flag if disabled does not store the
data in SharedPreferences.
enabled (set to true) by defaultpublic void setPersistenceEnabled(boolean isPersistenceEnabled)
isPersistenceEnabled
- flag that indicates persistencepublic boolean contains(java.lang.String dataKey)
dataKey
- that identifies the key-value pair.public java.lang.String get(java.lang.String dataKey)
dataKey
- key that identifies the value to be retrieved.public void put(java.lang.String dataKey, java.lang.String value)
dataKey
- key that identifies the valuevalue
- data that needs to be storedpublic void remove(java.lang.String dataKey)
dataKey
- identifies the key-value pair to be removedpublic void clear()