[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class AbstractMemoryDataStore<V> (2.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0 (latest)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.util.store.AbstractMemoryDataStore)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.util.store.AbstractMemoryDataStore) \n\n public class AbstractMemoryDataStore\u003cV\u003e extends AbstractDataStore\u003cV\u003e\n\nAbstract, thread-safe, in-memory implementation of a data store factory. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [AbstractDataStore](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore) \\\u003e AbstractMemoryDataStore\\\u003cV\\\u003e \n\nInherited Members\n-----------------\n\n[AbstractDataStore.containsKey(String)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_containsKey_java_lang_String_) \n[AbstractDataStore.containsValue(V)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_containsValue_V_) \n[AbstractDataStore.getDataStoreFactory()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_getDataStoreFactory__) \n[AbstractDataStore.getId()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_getId__) \n[AbstractDataStore.isEmpty()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_isEmpty__) \n[AbstractDataStore.size()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_size__) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### AbstractMemoryDataStore(DataStoreFactory dataStoreFactory, String id)\n\n protected AbstractMemoryDataStore(DataStoreFactory dataStoreFactory, String id)\n\nFields\n------\n\n### keyValueMap\n\n protected HashMap\u003cString,byte[]\u003e keyValueMap\n\nData store map from the key to the value.\n\nMethods\n-------\n\n### clear()\n\n public final DataStore\u003cV\u003e clear()\n\n### containsKey(String key)\n\n public boolean containsKey(String key)\n\nReturns whether the store contains the given key.\n\nDefault implementation is to call [#get(String)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_get_java_lang_String_) and check if it is `null`.\n\n**Overrides** \n[AbstractDataStore\\\u003cV\\\u003e.containsKey(String key)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_containsKey_java_lang_String_)\n\n### containsValue(V value)\n\n public boolean containsValue(V value)\n\nReturns whether the store contains the given value.\n\nDefault implementation is to call Collection#contains(Object) on [#values()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_values__).\n\n**Overrides** \n[AbstractDataStore\\\u003cV\\\u003e.containsValue(V value)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_containsValue_V_)\n\n### delete(String key)\n\n public DataStore\u003cV\u003e delete(String key)\n\n### get(String key)\n\n public final V get(String key)\n\n### isEmpty()\n\n public boolean isEmpty()\n\nReturns whether there are any stored keys.\n\nDefault implementation is to check if [#size()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_size__) is `0`.\n\n**Overrides** \n[AbstractDataStore\\\u003cV\\\u003e.isEmpty()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_isEmpty__)\n\n### keySet()\n\n public final Set\u003cString\u003e keySet()\n\n### save()\n\n public void save()\n\nPersist the key-value map into storage at the end of #set, [#delete(String)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_delete_java_lang_String_), and\n[#clear()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_clear__).\n\n### set(String key, V value)\n\n public final DataStore\u003cV\u003e set(String key, V value)\n\n### size()\n\n public int size()\n\nReturns the number of stored keys.\n\nDefault implementation is to call Set#size() on [#keySet()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractMemoryDataStore#com_google_api_client_util_store_AbstractMemoryDataStore_keySet__).\n\n**Overrides** \n[AbstractDataStore\\\u003cV\\\u003e.size()](/java/docs/reference/google-http-client/latest/com.google.api.client.util.store.AbstractDataStore#com_google_api_client_util_store_AbstractDataStore_size__)\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)\n\n### values()\n\n public final Collection\u003cV\u003e values()"]]