# Class GenericXml (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.GenericXml)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.xml.GenericXml)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.xml.GenericXml)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.xml.GenericXml)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.xml.GenericXml)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.xml.GenericXml)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.xml.GenericXml)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.xml.GenericXml)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.xml.GenericXml)

    public class GenericXml extends GenericData implements Cloneable

[Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta)   

Generic XML data that stores all unknown key name/value pairs.

Each data key name maps into the name of the XPath expression value for the XML element,
attribute, or text content (using `"text()"`). Subclasses can declare fields for known XML
content using the [Key](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.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.

Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap.

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMap](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html) \> [GenericData](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData) \> GenericXml

## Implements

[Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html)

## Inherited Members

[GenericData.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_clone__) [GenericData.entrySet()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_entrySet__) [GenericData.equals(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_equals_java_lang_Object_) [GenericData.get(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_get_java_lang_Object_) [GenericData.getClassInfo()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getClassInfo__) [GenericData.getUnknownKeys()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getUnknownKeys__) [GenericData.hashCode()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_hashCode__) [GenericData.put(String,Object)](https://docs.cloud.google.com/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_) [GenericData.putAll(Map\<? extends String,?\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_putAll_java_util_Map___extends_java_lang_String____) [GenericData.remove(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_remove_java_lang_Object_) [GenericData.set(String,Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_set_java_lang_String_java_lang_Object_) [GenericData.setUnknownKeys(Map\<String,Object\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_setUnknownKeys_java_util_Map_java_lang_String_java_lang_Object__) [GenericData.toString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_toString__) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) [AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) [AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) [AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) [AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) [AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) [AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) [AbstractMap.putAll(Map\<? extends K,? extends V\>)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map<? extends K-? extends V>-) [AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) [AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)

## Constructors

### GenericXml()

    public GenericXml()

## Fields

### name

    public String name

Optional XML element local name prefixed by its namespace alias -- for example `
"atom:entry"` -- or `null` if not set.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### namespaceDictionary

    public XmlNamespaceDictionary namespaceDictionary

Optional namespace dictionary or `null` if not set.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.XmlNamespaceDictionary` |   |

## Methods

### clone()

    public GenericXml clone()

Makes a "deep" clone of the generic data, in which the clone is completely independent of the
original.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.GenericXml` |   |

**Overrides** [GenericData.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_clone__)

### set(String fieldName, Object value)

    public GenericXml set(String fieldName, Object value)

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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.xml.GenericXml` |   |

**Overrides** [GenericData.set(String fieldName, Object value)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_set_java_lang_String_java_lang_Object_)

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [GenericData.toString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_toString__)