Class AvroSchemaUnion

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, Deque<Object>, List<Object>, Queue<Object>, SequencedCollection<Object>

public class AvroSchemaUnion extends LinkedList<Object>
Avro Union.

Unions, as mentioned above, are represented using JSON arrays.

For example, ["null", "string"] declares a schema which may be either a null or string.

Note that when a default value is specified for a record field whose type is a union, the type of the default value must match the first element of the union.

Thus, for unions containing "null", the "null" is usually listed first, since the default value of such unions is typically null.

Unions may not contain more than one schema with the same type, except for the named types record, fixed and enum.

For example, unions containing two array types or two map types are not permitted, but two types with different names are permitted.

(Names permit efficient resolution when reading and writing unions.)

Unions may not immediately contain other unions.

See Also:
  • Constructor Details

    • AvroSchemaUnion

      public AvroSchemaUnion()
    • AvroSchemaUnion

      public AvroSchemaUnion(@NotNull @NotNull Object... variant)
    • AvroSchemaUnion

      public AvroSchemaUnion(@NotNull @NotNull Object variantA, @NotNull @NotNull Object variantB)