Annotation Type JsonPolymorphicTypeMap (1.45.0)

public interface JsonPolymorphicTypeMap implements Annotation

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). The field's value will be compared against the TypeDef#key() using Object#toString().

Implements

Annotation

Methods

typeDefinitions()

public abstract JsonPolymorphicTypeMap.TypeDef[] typeDefinitions()

The list of mappings from key value to a referenced Class.

Returns
Type Description
TypeDef[]