Class AbstractDataStore<V extends Serializable>
java.lang.Object
com.google.api.client.util.store.AbstractDataStore<V>
- Type Parameters:
V- serializable type of the mapped value
- All Implemented Interfaces:
DataStore<V>
- Direct Known Subclasses:
AbstractMemoryDataStore
public abstract class AbstractDataStore<V extends Serializable>
extends Object
implements DataStore<V>
Abstract data store implementation.
- Since:
- 1.16
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataStoreFactoryData store factory.private final StringData store ID. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataStore(DataStoreFactory dataStoreFactory, String id) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Returns whether the store contains the given key.booleancontainsValue(V value) Returns whether the store contains the given value.Returns the data store factory.final StringgetId()Returns the data store ID.booleanisEmpty()Returns whether there are any stored keys.intsize()Returns the number of stored keys.
-
Field Details
-
dataStoreFactory
Data store factory. -
id
Data store ID.
-
-
Constructor Details
-
AbstractDataStore
- Parameters:
dataStoreFactory- data store factoryid- data store ID
-
-
Method Details
-
getDataStoreFactory
Returns the data store factory.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Specified by:
getDataStoreFactoryin interfaceDataStore<V extends Serializable>
-
getId
-
containsKey
Returns whether the store contains the given key.Default implementation is to call
DataStore.get(String)and check if it isnull.- Specified by:
containsKeyin interfaceDataStore<V extends Serializable>- Throws:
IOException
-
containsValue
Returns whether the store contains the given value.Default implementation is to call
Collection.contains(Object)onDataStore.values().- Specified by:
containsValuein interfaceDataStore<V extends Serializable>- Throws:
IOException
-
isEmpty
Returns whether there are any stored keys.Default implementation is to check if
size()is0.- Specified by:
isEmptyin interfaceDataStore<V extends Serializable>- Throws:
IOException
-
size
Returns the number of stored keys.Default implementation is to call
Set.size()onDataStore.keySet().- Specified by:
sizein interfaceDataStore<V extends Serializable>- Throws:
IOException
-