org.apache.avro

## Class SchemaBuilder.TypeBuilder<R>

- java.lang.Object
- - org.apache.avro.SchemaBuilder.BaseTypeBuilder<R>
  - - org.apache.avro.SchemaBuilder.TypeBuilder<R>

- Enclosing class:
    SchemaBuilder

      public static final class SchemaBuilder.TypeBuilder<R>
      extends SchemaBuilder.BaseTypeBuilder<R>

  A Builder for creating any Avro schema type.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SchemaBuilder.BaseTypeBuilder<R>` | `nullable()` A shortcut for building a union of a type and null.
    `SchemaBuilder.BaseTypeBuilder<SchemaBuilder.UnionAccumulator<R>>` | `unionOf()` Build an Avro union schema type.

    - ### Methods inherited from class org.apache.avro.SchemaBuilder.BaseTypeBuilder

      `array, booleanBuilder, booleanType, bytesBuilder, bytesType, doubleBuilder, doubleType, enumeration, fixed, floatBuilder, floatType, intBuilder, intType, longBuilder, longType, map, nullBuilder, nullType, record, stringBuilder, stringType, type, type, type`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### unionOf

          public SchemaBuilder.BaseTypeBuilder<SchemaBuilder.UnionAccumulator<R>> unionOf()

      Description copied from class: `SchemaBuilder.BaseTypeBuilder`
      Build an Avro union schema type. Example usage:

           unionOf().stringType().and().bytesType().endUnion()

      Overrides:
        `unionOf` in class `SchemaBuilder.BaseTypeBuilder<R>`

    - #### nullable

          public SchemaBuilder.BaseTypeBuilder<R> nullable()

      Description copied from class: `SchemaBuilder.BaseTypeBuilder`
      A shortcut for building a union of a type and null.

      For example, the code snippets below are equivalent:

           nullable().booleanType()

           unionOf().booleanType().and().nullType().endUnion()

      Overrides:
        `nullable` in class `SchemaBuilder.BaseTypeBuilder<R>`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.