Generic data that stores all unknown data key name/value pairs.
Subclasses can declare fields for known data keys using the Key annotation. Each field
can be of any visibility (private, package private, protected, or public) and must not be static.
null unknown data key names are not allowed, but null data values are allowed.
Iteration order of the data keys is based on the sorted (ascending) key names of the declared
fields, followed by the iteration order of all of the unknown data key name/value pairs.
Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap.
Sets the given field value (may be null) for the given field name. Any existing value
for the field will be overwritten. It may be more slightly more efficient than #put(String, Object) because it avoids accessing the field's original value.
Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.
[[["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 GenericData (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.GenericData)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.util.GenericData)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.util.GenericData)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.util.GenericData)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.util.GenericData)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.util.GenericData)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.util.GenericData)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.util.GenericData) \n\n public class GenericData extends AbstractMap\u003cString,Object\u003e implements Cloneable\n\nGeneric data that stores all unknown data key name/value pairs.\n\nSubclasses can declare fields for known data keys using the [Key](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Key) annotation. Each field\ncan be of any visibility (private, package private, protected, or public) and must not be static.\n`null` unknown data key names are not allowed, but `null` data values are allowed.\n\nIteration order of the data keys is based on the sorted (ascending) key names of the declared\nfields, followed by the iteration order of all of the unknown data key name/value pairs.\n\nImplementation is not thread-safe. For a thread-safe choice instead use an implementation of\nConcurrentMap. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [AbstractMap](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html) \\\u003e GenericData \n\nImplements\n----------\n\n[Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html) \n\nInherited Members\n-----------------\n\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.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.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[AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) \n[AbstractMap.clone()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clone--) \n[AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) \n[AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) \n[AbstractMap.entrySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#entrySet--) \n[AbstractMap.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#equals-java.lang.Object-) \n[AbstractMap.get(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#get-java.lang.Object-) \n[AbstractMap.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#hashCode--) \n[AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) \n[AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) \n[AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) \n[AbstractMap.putAll(Map\\\u003c? extends K,? extends V\\\u003e)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map\u003c? extends K-? extends V\u003e-) \n[AbstractMap.remove(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#remove-java.lang.Object-) \n[AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) \n[AbstractMap.toString()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#toString--) \n[AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)\n\nConstructors\n------------\n\n### GenericData()\n\n public GenericData()\n\nConstructs with case-insensitive keys.\n\n### GenericData(EnumSet\\\u003cGenericData.Flags\\\u003e flags)\n\n public GenericData(EnumSet\u003cGenericData.Flags\u003e flags)\n\nMethods\n-------\n\n### clone()\n\n public GenericData clone()\n\nMakes a \"deep\" clone of the generic data, in which the clone is completely independent of the\noriginal.\n\n**Overrides** \n[AbstractMap.clone()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clone--)\n\n### entrySet()\n\n public Set\u003cMap.Entry\u003cString,Object\u003e\u003e entrySet()\n\n**Overrides** \n[AbstractMap.entrySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#entrySet--)\n\n### equals(Object o)\n\n public boolean equals(Object o)\n\n**Overrides** \n[AbstractMap.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#equals-java.lang.Object-)\n\n### get(Object name)\n\n public final Object get(Object name)\n\n**Overrides** \n[AbstractMap.get(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#get-java.lang.Object-)\n\n### getClassInfo()\n\n public final ClassInfo getClassInfo()\n\nReturns the class information.\n\n### getUnknownKeys()\n\n public final Map\u003cString,Object\u003e getUnknownKeys()\n\nReturns the map of unknown data key name to value.\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[AbstractMap.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#hashCode--)\n\n### put(String fieldName, Object value)\n\n public final Object put(String fieldName, Object value)\n\n**Overrides** \n[AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-)\n\n### putAll(Map\\\u003c? extends String,?\\\u003e map)\n\n public final void putAll(Map\u003c? extends String,?\u003e map)\n\n**Overrides** \n[AbstractMap.putAll(Map\\\u003c? extends K,? extends V\\\u003e)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map\u003c? extends K-? extends V\u003e-)\n\n### remove(Object name)\n\n public final Object remove(Object name)\n\n**Overrides** \n[AbstractMap.remove(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#remove-java.lang.Object-)\n\n### set(String fieldName, Object value)\n\n public GenericData set(String fieldName, Object value)\n\nSets the given field value (may be `null`) for the given field name. Any existing value\nfor the field will be overwritten. It may be more slightly more efficient than [#put(String, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_put_java_lang_String_java_lang_Object_) because it avoids accessing the field's original value.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### setUnknownKeys(Map\\\u003cString,Object\\\u003e unknownFields)\n\n public final void setUnknownKeys(Map\u003cString,Object\u003e unknownFields)\n\nSets the map of unknown data key name to value.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[AbstractMap.toString()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#toString--)"]]