# Annotation Type JsonPolymorphicTypeMap (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.json.JsonPolymorphicTypeMap)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.json.JsonPolymorphicTypeMap)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.json.JsonPolymorphicTypeMap)

    public interface JsonPolymorphicTypeMap implements Annotation

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

Declares that the data type enclosing this field is polymorphic, and that the value of this field
in a heterogeneous JSON schema will determine what type the data should be parsed into.

A data structure must have no more than one field with this annotation present. The annotated
field's type must be considered "primitive" by [Data#isPrimitive(Type)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_isPrimitive_java_lang_reflect_Type_). The field's value
will be compared against the [TypeDef#key()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.JsonPolymorphicTypeMap.TypeDef#com_google_api_client_json_JsonPolymorphicTypeMap_TypeDef_key_) using [Object#toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--).

## Implements

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

## Methods

### typeDefinitions()

    public abstract JsonPolymorphicTypeMap.TypeDef[] typeDefinitions()

The list of mappings from key value to a referenced [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.JsonPolymorphicTypeMap.TypeDef[]` |   |