Collects the array values of a key/value data object, writing the fields or map values only after
all values have been collected.
The typical application for this is when parsing JSON or XML when the value type is known to
be an array. It stores the values in a collection during the parsing, and only when the parsing
of an object is finished does it convert the collection into an array and stores it.
Use #put(String, Class, Object) when the destination object is a map with string keys
and whose values accept an array of objects. Use #put(Field, Class, Object) when setting
the value of a field using reflection, assuming its type accepts an array of objects. One can
potentially use both put methods for example on an instance of GenericData.
Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap.
[[["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 ArrayValueMap (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.ArrayValueMap)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.util.ArrayValueMap)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.util.ArrayValueMap)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.util.ArrayValueMap)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.util.ArrayValueMap)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.util.ArrayValueMap)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.util.ArrayValueMap)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.util.ArrayValueMap) \n\n public final class ArrayValueMap\n\nCollects the array values of a key/value data object, writing the fields or map values only after\nall values have been collected.\n\nThe typical application for this is when parsing JSON or XML when the value type is known to\nbe an array. It stores the values in a collection during the parsing, and only when the parsing\nof an object is finished does it convert the collection into an array and stores it.\n\nUse [#put(String, Class, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.ArrayValueMap#com_google_api_client_util_ArrayValueMap_put_java_lang_String_java_lang_Class____java_lang_Object_) when the destination object is a map with string keys\nand whose values accept an array of objects. Use [#put(Field, Class, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.ArrayValueMap#com_google_api_client_util_ArrayValueMap_put_java_lang_reflect_Field_java_lang_Class____java_lang_Object_) when setting\nthe value of a field using reflection, assuming its type accepts an array of objects. One can\npotentially use both `put` methods for example on an instance of [GenericData](/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData).\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 ArrayValueMap \n\nInherited Members\n-----------------\n\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### ArrayValueMap(Object destination)\n\n public ArrayValueMap(Object destination)\n\nMethods\n-------\n\n### put(String keyName, Class\\\u003c?\\\u003e arrayComponentType, Object value)\n\n public void put(String keyName, Class\u003c?\u003e arrayComponentType, Object value)\n\nPuts an additional value for the given key name, accumulating values on repeated calls on the\nsame key name.\n\n### put(Field field, Class\\\u003c?\\\u003e arrayComponentType, Object value)\n\n public void put(Field field, Class\u003c?\u003e arrayComponentType, Object value)\n\nPuts an additional value for the given field, accumulating values on repeated calls on the same\nfield.\n\n### setValues()\n\n public void setValues()\n\nSets the fields of the given object using the values collected during parsing of the object's\nfields."]]