V - serializable type of the mapped value
public interface DataStore<V extends Serializable>
Serializable object.
null keys or values are not allowed. Implementation should be thread-safe.
| Modifier and Type | Method and Description |
|---|---|
DataStore |
clear()
Deletes all of the stored keys and values.
|
boolean |
containsKey(String
Returns whether the store contains the given key.
|
boolean |
containsValue(V value)
Returns whether the store contains the given value.
|
DataStore |
delete(String
Deletes the stored key and value based on the given key, or ignored if the key doesn't already exist.
|
V |
get(String
Returns the stored value for the given key or
null if not found.
|
DataStoreFactory |
getDataStoreFactory()
Returns the data store factory.
|
String |
getId()
Returns the data store ID.
|
boolean |
isEmpty()
Returns whether there are any stored keys.
|
Set |
keySet()
Returns the unmodifiable set of all stored keys.
|
DataStore |
set(String
Stores the given value for the given key (replacing any existing value).
|
int |
size()
Returns the number of stored keys.
|
Collection |
values()
Returns the unmodifiable collection of all stored values.
|
DataStoreFactorygetDataStoreFactory()
StringgetId()
int size() throws IOException
IOException
boolean isEmpty()
throws IOException
IOException
boolean containsKey(Stringkey) throws IOException
IOException
boolean containsValue(V value) throws IOException
IOException
Set<String > keySet() throws IOException
Order of the keys is not specified.
IOException
Collection<V> values() throws IOException
IOException
V get(Stringkey) throws IOException
null if not found.
key - key or
null for
null result
IOException
DataStore<V> set(String key, V value) throws IOException
key - key
value - value object
IOException
DataStore<V> clear() throws IOException
IOException
DataStore<V> delete(String key) throws IOException
key - key or
null to ignore
IOException