Package zendesk.core
Interface BaseStorage
-
public interface BaseStorageLow level storage description. Using a very basic key value concept.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidclear()Clear everything from storage.java.lang.Stringget(java.lang.String key)Retrieve the stored value for the provided key.<E> Eget(java.lang.String key, java.lang.Class<E> clazz)Retrieve the stored value for the provided key.voidput(java.lang.String key, java.lang.Object object)Store the the given key value pair.voidput(java.lang.String key, java.lang.String value)Store the the given key value pair.voidremove(java.lang.String key)Remove the stored value for the provided key.
-
-
-
Method Detail
-
put
void put(java.lang.String key, java.lang.String value)Store the the given key value pair.
If there's already a value stored with the same key, it will be overridden
Passing innullas value removes the key from the storage.- Parameters:
key- a unique keyvalue- data as String
-
put
void put(java.lang.String key, java.lang.Object object)Store the the given key value pair.
The concrete implementation of the storage will take care of the deserialization of the given object.
If there's already a value stored with the same key, it will be overridden
Passing innullas value removes the key from the storage.- Parameters:
key- a unique keyobject- data
-
get
java.lang.String get(java.lang.String key)
Retrieve the stored value for the provided key.
It will return null, if the key isn't available.- Parameters:
key- the requested key- Returns:
- the requested value or
null
-
get
<E> E get(java.lang.String key, java.lang.Class<E> clazz)Retrieve the stored value for the provided key.
It will return null, if the key isn't available.- Parameters:
key- the requested key- Returns:
- the requested object or
null
-
remove
void remove(java.lang.String key)
Remove the stored value for the provided key.- Parameters:
key- the requested key
-
clear
void clear()
Clear everything from storage.
-
-