Class AbstractDataStore<V> (1.44.2)

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

Name Description
V

Constructors

AbstractDataStore(DataStoreFactory dataStoreFactory, String id)

protected AbstractDataStore(DataStoreFactory dataStoreFactory, String id)
Parameters
Name Description
dataStoreFactory DataStoreFactory

data store factory

id String

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
Name Description
key String
Returns
Type Description
boolean
Exceptions
Type Description
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
Name Description
value V
Returns
Type Description
boolean
Exceptions
Type Description
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
Type Description
DataStoreFactory

getId()

public final String getId()

Returns the data store ID.

Returns
Type Description
String

isEmpty()

public boolean isEmpty()

Returns whether there are any stored keys.

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

Returns
Type Description
boolean
Exceptions
Type Description
IOException

size()

public int size()

Returns the number of stored keys.

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

Returns
Type Description
int
Exceptions
Type Description
IOException