Class AbstractDataStore<V> (1.43.1)

public abstract class AbstractDataStore<V> implements DataStore<V>

Abstract data store implementation.

Inheritance

java.lang.Object > AbstractDataStore<V>

Implements

com.google.api.client.util.store.DataStore<V>

Type Parameter

NameDescription
V

Constructors

AbstractDataStore(DataStoreFactory dataStoreFactory, String id)

protected AbstractDataStore(DataStoreFactory dataStoreFactory, String id)
Parameters
NameDescription
dataStoreFactoryDataStoreFactory

data store factory

idString

data store ID

Methods

containsKey(String key)

public boolean containsKey(String key)

Returns whether the store contains the given key.

Default implementation is to call #get(String) and check if it is null.

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean
Exceptions
TypeDescription
IOException

containsValue(V value)

public boolean containsValue(V value)

Returns whether the store contains the given value.

Default implementation is to call Collection#contains(Object) on #values().

Parameter
NameDescription
valueV
Returns
TypeDescription
boolean
Exceptions
TypeDescription
IOException

getDataStoreFactory()

public DataStoreFactory 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.

Returns
TypeDescription
DataStoreFactory

getId()

public final String getId()

Returns the data store ID.

Returns
TypeDescription
String

isEmpty()

public boolean isEmpty()

Returns whether there are any stored keys.

Default implementation is to check if #size() is 0.

Returns
TypeDescription
boolean
Exceptions
TypeDescription
IOException

size()

public int size()

Returns the number of stored keys.

Default implementation is to call Set#size() on #keySet().

Returns
TypeDescription
int
Exceptions
TypeDescription
IOException