Package com.google.api.client.util.store
Class MemoryDataStoreFactory
- java.lang.Object
-
- com.google.api.client.util.store.AbstractDataStoreFactory
-
- com.google.api.client.util.store.MemoryDataStoreFactory
-
- All Implemented Interfaces:
DataStoreFactory
public class MemoryDataStoreFactory extends AbstractDataStoreFactory
Thread-safe in-memory implementation of a data store factory.For convenience, a default global instance is provided in
getDefaultInstance().- Since:
- 1.16
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMemoryDataStoreFactory.InstanceHolderHolder for the result ofgetDefaultInstance().(package private) static classMemoryDataStoreFactory.MemoryDataStore<V extends java.io.Serializable>
-
Constructor Summary
Constructors Constructor Description MemoryDataStoreFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V extends java.io.Serializable>
DataStore<V>createDataStore(java.lang.String id)Returns a new instance of a type-specific data store based on the given unique ID.static MemoryDataStoreFactorygetDefaultInstance()Returns a global thread-safe instance.-
Methods inherited from class com.google.api.client.util.store.AbstractDataStoreFactory
getDataStore
-
-
-
-
Method Detail
-
createDataStore
protected <V extends java.io.Serializable> DataStore<V> createDataStore(java.lang.String id) throws java.io.IOException
Description copied from class:AbstractDataStoreFactoryReturns a new instance of a type-specific data store based on the given unique ID.The
DataStore.getId()must match theidparameter from this method.- Specified by:
createDataStorein classAbstractDataStoreFactory- Type Parameters:
V- serializable type of the mapped value- Parameters:
id- unique ID to refer to typed data store- Throws:
java.io.IOException
-
getDefaultInstance
public static MemoryDataStoreFactory getDefaultInstance()
Returns a global thread-safe instance.
-
-