Interface KeyValueStore
-
- All Implemented Interfaces:
public interface KeyValueStore
Performs storage operations as key value pairs This interface defines the contract for persistent operations
Note: The methods that include 'common' in their name persist the values across clients, the other methods only persist the values for the given client.
-
-
Method Summary
Modifier and Type Method Description abstract void
putString(@NonNull() String key, @NonNull() String value)
persist given String for the current client with given key abstract String
getString(@NonNull() String key)
retrieves String for the current client with given key abstract void
putLong(@NonNull() String key, long value)
persist given long for the current client with given key abstract long
getLong(@NonNull() String key)
retrieves long for the current client with given key abstract void
putDouble(@NonNull() String key, double value)
persist given double for the current client with given key abstract double
getDouble(@NonNull() String key)
retrieves double for the current client with given key abstract void
putBoolean(@NonNull() String key, boolean value)
persist given boolean for the current client with given key abstract boolean
getBoolean(@NonNull() String key)
retrieves boolean for the current client with given key abstract <T> void
putObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object for the current client with given key abstract <T> T
getObject(@NonNull() String key, Class<T> type)
retrieves persisted object for the current client with given key abstract void
putCommonString(@NonNull() String key, @NonNull() String value)
persist given String with given key within the Pointr instance abstract String
getCommonString(@NonNull() String key)
retrieves String with given key within the Pointr instance abstract void
putCommonLong(@NonNull() String key, long value)
persist given long with given key within the Pointr instance abstract long
getCommonLong(@NonNull() String key)
retrieves long with given key within the Pointr instance abstract void
putCommonDouble(@NonNull() String key, double value)
persist given double with given key within the Pointr instance abstract double
getCommonDouble(@NonNull() String key)
retrieves double with given key within the Pointr instance abstract void
putCommonBoolean(@NonNull() String key, boolean value)
persist given boolean with given key within the Pointr instance abstract boolean
getCommonBoolean(@NonNull() String key)
retrieves boolean with given key within the Pointr instance abstract <T> void
putCommonObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object with given key within the Pointr instance abstract <T> T
getCommonObject(@NonNull() String key, Class<T> type)
retrieves persisted object with given key within the Pointr instance abstract void
deleteValue(@NonNull() String key)
Deletes value associated for the current client with given key -
-
Method Detail
-
putString
abstract void putString(@NonNull() String key, @NonNull() String value)
persist given String for the current client with given key
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getString
@Nullable() abstract String getString(@NonNull() String key)
retrieves String for the current client with given key
- Parameters:
key
- key to retrieve value- Returns:
value associated with the key
-
putLong
abstract void putLong(@NonNull() String key, long value)
persist given long for the current client with given key
- Parameters:
key
- key associated with valuevalue
- long to persist
-
getLong
abstract long getLong(@NonNull() String key)
retrieves long for the current client with given key
- Parameters:
key
- key to retrieve value- Returns:
long associated with the key
-
putDouble
abstract void putDouble(@NonNull() String key, double value)
persist given double for the current client with given key
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getDouble
abstract double getDouble(@NonNull() String key)
retrieves double for the current client with given key
- Parameters:
key
- key to retrieve value- Returns:
double associated with the key
-
putBoolean
abstract void putBoolean(@NonNull() String key, boolean value)
persist given boolean for the current client with given key
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getBoolean
abstract boolean getBoolean(@NonNull() String key)
retrieves boolean for the current client with given key
- Parameters:
key
- key to retrieve value- Returns:
boolean associated with the key
-
putObject
abstract <T> void putObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object for the current client with given key
- Parameters:
key
- key associated with the valuevalue
- persisted objecttype
- type of of object to be persisted
-
getObject
@Nullable() abstract <T> T getObject(@NonNull() String key, Class<T> type)
retrieves persisted object for the current client with given key
- Parameters:
key
- key to retrieve valuetype
- type of persistent object to perform deserialization- Returns:
object associated with the key
-
putCommonString
abstract void putCommonString(@NonNull() String key, @NonNull() String value)
persist given String with given key within the Pointr instance
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getCommonString
@Nullable() abstract String getCommonString(@NonNull() String key)
retrieves String with given key within the Pointr instance
- Parameters:
key
- key to retrieve value- Returns:
value associated with the key
-
putCommonLong
abstract void putCommonLong(@NonNull() String key, long value)
persist given long with given key within the Pointr instance
- Parameters:
key
- key associated with valuevalue
- long to persist
-
getCommonLong
abstract long getCommonLong(@NonNull() String key)
retrieves long with given key within the Pointr instance
- Parameters:
key
- key to retrieve value- Returns:
long associated with the key
-
putCommonDouble
abstract void putCommonDouble(@NonNull() String key, double value)
persist given double with given key within the Pointr instance
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getCommonDouble
abstract double getCommonDouble(@NonNull() String key)
retrieves double with given key within the Pointr instance
- Parameters:
key
- key to retrieve value- Returns:
double associated with the key
-
putCommonBoolean
abstract void putCommonBoolean(@NonNull() String key, boolean value)
persist given boolean with given key within the Pointr instance
- Parameters:
key
- key associated with valuevalue
- string to persist
-
getCommonBoolean
abstract boolean getCommonBoolean(@NonNull() String key)
retrieves boolean with given key within the Pointr instance
- Parameters:
key
- key to retrieve value- Returns:
boolean associated with the key
-
putCommonObject
abstract <T> void putCommonObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object with given key within the Pointr instance
- Parameters:
key
- key associated with the valuevalue
- persisted objecttype
- type of of object to be persisted
-
getCommonObject
@Nullable() abstract <T> T getCommonObject(@NonNull() String key, Class<T> type)
retrieves persisted object with given key within the Pointr instance
- Parameters:
key
- key to retrieve valuetype
- type of persistent object to perform deserialization- Returns:
object associated with the key
-
deleteValue
abstract void deleteValue(@NonNull() String key)
Deletes value associated for the current client with given key
- Parameters:
key
- key to delete associated value
-
-
-
-