Class InternalKeyValueStore
-
- All Implemented Interfaces:
-
com.pointrlabs.core.db.KeyValueStore
public final class InternalKeyValueStore implements KeyValueStore
-
-
Field Summary
Fields Modifier and Type Field Description public final static long
INVALID_LONG
public final static double
INVALID_DOUBLE
-
Constructor Summary
Constructors Constructor Description InternalKeyValueStore(CppSharedPtr cppStoragePtr)
-
Method Summary
Modifier and Type Method Description void
putString(@NonNull() String key, @NonNull() String value)
persist given String for the current client with given key String
getString(@NonNull() String key)
retrieves String for the current client with given key void
putLong(@NonNull() String key, long value)
persist given long for the current client with given key long
getLong(@NonNull() String key)
retrieves long for the current client with given key void
putDouble(@NonNull() String key, double value)
persist given double for the current client with given key double
getDouble(@NonNull() String key)
retrieves double for the current client with given key void
putBoolean(@NonNull() String key, boolean value)
persist given boolean for the current client with given key boolean
getBoolean(@NonNull() String key)
retrieves boolean for the current client with given key <T> void
putObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object for the current client with given key <T> T
getObject(@NonNull() String key, Class<T> type)
retrieves persisted object for the current client with given key void
putCommonString(@NonNull() String key, @NonNull() String value)
persist given String with given key within the Pointr instance String
getCommonString(@NonNull() String key)
retrieves String with given key within the Pointr instance void
putCommonLong(@NonNull() String key, long value)
persist given long with given key within the Pointr instance long
getCommonLong(@NonNull() String key)
retrieves long with given key within the Pointr instance void
putCommonDouble(@NonNull() String key, double value)
persist given double with given key within the Pointr instance double
getCommonDouble(@NonNull() String key)
retrieves double with given key within the Pointr instance void
putCommonBoolean(@NonNull() String key, boolean value)
persist given boolean with given key within the Pointr instance boolean
getCommonBoolean(@NonNull() String key)
retrieves boolean with given key within the Pointr instance <T> void
putCommonObject(@NonNull() String key, @NonNull() T value, @NonNull() Class<T> type)
persist given object with given key within the Pointr instance <T> T
getCommonObject(@NonNull() String key, Class<T> type)
retrieves persisted object with given key within the Pointr instance void
deleteValue(@NonNull() String key)
Deletes value associated for the current client with given key -
-
Constructor Detail
-
InternalKeyValueStore
InternalKeyValueStore(CppSharedPtr cppStoragePtr)
-
-
Method Detail
-
putString
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() 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
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
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
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
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
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
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
<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() <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
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() 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
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
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
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
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
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
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
<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() <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
void deleteValue(@NonNull() String key)
Deletes value associated for the current client with given key
- Parameters:
key
- key to delete associated value
-
-
-
-