Package com.google.api.client.util.store
Class FileDataStoreFactory.FileDataStore<V extends Serializable>
java.lang.Object
com.google.api.client.util.store.AbstractDataStore<V>
com.google.api.client.util.store.AbstractMemoryDataStore<V>
com.google.api.client.util.store.FileDataStoreFactory.FileDataStore<V>
- Type Parameters:
V
- serializable type of the mapped value
- All Implemented Interfaces:
DataStore<V>
- Enclosing class:
FileDataStoreFactory
static class FileDataStoreFactory.FileDataStore<V extends Serializable>
extends AbstractMemoryDataStore<V>
File data store that inherits from the abstract memory data store because the key-value pairs
are stored in a memory cache, and saved in the file (see
save()
when changing values.-
Field Summary
FieldsFields inherited from class com.google.api.client.util.store.AbstractMemoryDataStore
keyValueMap
-
Constructor Summary
ConstructorsConstructorDescriptionFileDataStore
(FileDataStoreFactory dataStore, File dataDirectory, String id) -
Method Summary
Modifier and TypeMethodDescriptionReturns the data store factory.void
save()
Persist the key-value map into storage at the end ofAbstractMemoryDataStore.set(java.lang.String, V)
,AbstractMemoryDataStore.delete(String)
, andAbstractMemoryDataStore.clear()
.Methods inherited from class com.google.api.client.util.store.AbstractMemoryDataStore
clear, containsKey, containsValue, delete, get, isEmpty, keySet, set, size, toString, values
Methods inherited from class com.google.api.client.util.store.AbstractDataStore
getId
-
Field Details
-
dataFile
File to store data.
-
-
Constructor Details
-
FileDataStore
FileDataStore(FileDataStoreFactory dataStore, File dataDirectory, String id) throws IOException - Throws:
IOException
-
-
Method Details
-
save
Description copied from class:AbstractMemoryDataStore
Persist the key-value map into storage at the end ofAbstractMemoryDataStore.set(java.lang.String, V)
,AbstractMemoryDataStore.delete(String)
, andAbstractMemoryDataStore.clear()
.- Overrides:
save
in classAbstractMemoryDataStore<V extends Serializable>
- Throws:
IOException
-
getDataStoreFactory
Description copied from class:AbstractDataStore
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:
getDataStoreFactory
in interfaceDataStore<V extends Serializable>
- Overrides:
getDataStoreFactory
in classAbstractDataStore<V extends Serializable>
-