V
- serializable type of the mapped valuepublic abstract class AbstractDataStore<V extends Serializable> extends Object implements DataStore<V>
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataStore(DataStoreFactory dataStoreFactory,
String id) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Returns whether the store contains the given key.
|
boolean |
containsValue(V value)
Returns whether the store contains the given value.
|
DataStoreFactory |
getDataStoreFactory()
Returns the data store factory.
|
String |
getId()
Returns the data store ID.
|
boolean |
isEmpty()
Returns whether there are any stored keys.
|
int |
size()
Returns the number of stored keys.
|
protected AbstractDataStore(DataStoreFactory dataStoreFactory, String id)
dataStoreFactory
- data store factoryid
- data store IDpublic DataStoreFactory getDataStoreFactory()
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
getDataStoreFactory
in interface DataStore<V extends Serializable>
public final String getId()
DataStore
getId
in interface DataStore<V extends Serializable>
public boolean containsKey(String key) throws IOException
Default implementation is to call DataStore.get(String)
and check if it is null
.
containsKey
in interface DataStore<V extends Serializable>
IOException
public boolean containsValue(V value) throws IOException
Default implementation is to call Collection.contains(Object)
on DataStore.values()
.
containsValue
in interface DataStore<V extends Serializable>
IOException
public boolean isEmpty() throws IOException
Default implementation is to check if size()
is 0
.
isEmpty
in interface DataStore<V extends Serializable>
IOException
public int size() throws IOException
Default implementation is to call Set.size()
on DataStore.keySet()
.
size
in interface DataStore<V extends Serializable>
IOException
Copyright © 2011–2023 Google. All rights reserved.