org.apache.avro

## Class SchemaBuilder.BaseFieldTypeBuilder<R>

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

- Direct Known Subclasses:
    SchemaBuilder.FieldTypeBuilder
  Enclosing class:
    SchemaBuilder

      public static class SchemaBuilder.BaseFieldTypeBuilder<R>
      extends Object

  A special Builder for Record fields. The API is very similar to `SchemaBuilder.BaseTypeBuilder`. However, fields have their own names, properties, and default values.

  The methods on this class create builder instances that return their control to the `SchemaBuilder.FieldAssembler` of the enclosing record context after configuring a default for the field.

  For example, an int field with default value 1:

       intSimple().withDefault(1);

  or an array with items that are optional int types:

       array().items().optional().intType();

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SchemaBuilder.FieldBuilder<R>` | `bldr`
    `protected org.apache.avro.SchemaBuilder.NameContext` | `names`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseFieldTypeBuilder(SchemaBuilder.FieldBuilder<R> bldr, org.apache.avro.SchemaBuilder.CompletionWrapper wrapper)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SchemaBuilder.ArrayBuilder<SchemaBuilder.ArrayDefault<R>>` | `array()` Build an Avro array type
    `SchemaBuilder.BooleanBuilder<SchemaBuilder.BooleanDefault<R>>` | `booleanBuilder()` Build a boolean type that can set custom properties.
    `SchemaBuilder.BooleanDefault<R>` | `booleanType()` A plain boolean type without custom properties.
    `SchemaBuilder.BytesBuilder<SchemaBuilder.BytesDefault<R>>` | `bytesBuilder()` Build a bytes type that can set custom properties.
    `SchemaBuilder.BytesDefault<R>` | `bytesType()` A plain bytes type without custom properties.
    `SchemaBuilder.DoubleBuilder<SchemaBuilder.DoubleDefault<R>>` | `doubleBuilder()` Build a double type that can set custom properties.
    `SchemaBuilder.DoubleDefault<R>` | `doubleType()` A plain double type without custom properties.
    `SchemaBuilder.EnumBuilder<SchemaBuilder.EnumDefault<R>>` | `enumeration(String name)` Build an Avro enum type.
    `SchemaBuilder.FixedBuilder<SchemaBuilder.FixedDefault<R>>` | `fixed(String name)` Build an Avro fixed type.
    `SchemaBuilder.FloatBuilder<SchemaBuilder.FloatDefault<R>>` | `floatBuilder()` Build a float type that can set custom properties.
    `SchemaBuilder.FloatDefault<R>` | `floatType()` A plain float type without custom properties.
    `SchemaBuilder.IntBuilder<SchemaBuilder.IntDefault<R>>` | `intBuilder()` Build an int type that can set custom properties.
    `SchemaBuilder.IntDefault<R>` | `intType()` A plain int type without custom properties.
    `SchemaBuilder.LongBuilder<SchemaBuilder.LongDefault<R>>` | `longBuilder()` Build a long type that can set custom properties.
    `SchemaBuilder.LongDefault<R>` | `longType()` A plain long type without custom properties.
    `SchemaBuilder.MapBuilder<SchemaBuilder.MapDefault<R>>` | `map()` Build an Avro map type
    `SchemaBuilder.NullBuilder<SchemaBuilder.NullDefault<R>>` | `nullBuilder()` Build a null type that can set custom properties.
    `SchemaBuilder.NullDefault<R>` | `nullType()` A plain null type without custom properties.
    `SchemaBuilder.RecordBuilder<SchemaBuilder.RecordDefault<R>>` | `record(String name)` Build an Avro record type.
    `SchemaBuilder.StringBldr<SchemaBuilder.StringDefault<R>>` | `stringBuilder()` Build a string type that can set custom properties.
    `SchemaBuilder.StringDefault<R>` | `stringType()` A plain string type without custom properties.

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

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

- - ### Field Detail

    - #### bldr

          protected final SchemaBuilder.FieldBuilder<R> bldr

    - #### names

          protected final org.apache.avro.SchemaBuilder.NameContext names

  - ### Constructor Detail

    - #### BaseFieldTypeBuilder

          protected BaseFieldTypeBuilder(SchemaBuilder.FieldBuilder<R> bldr,
                                         org.apache.avro.SchemaBuilder.CompletionWrapper wrapper)

  - ### Method Detail

    - #### booleanType

          public final SchemaBuilder.BooleanDefault<R> booleanType()

      A plain boolean type without custom properties. This is equivalent to:

           booleanBuilder().endBoolean();

    - #### booleanBuilder

          public final SchemaBuilder.BooleanBuilder<SchemaBuilder.BooleanDefault<R>> booleanBuilder()

      Build a boolean type that can set custom properties. If custom properties are not needed it is simpler to use `booleanType()`.

    - #### intType

          public final SchemaBuilder.IntDefault<R> intType()

      A plain int type without custom properties. This is equivalent to:

           intBuilder().endInt();

    - #### intBuilder

          public final SchemaBuilder.IntBuilder<SchemaBuilder.IntDefault<R>> intBuilder()

      Build an int type that can set custom properties. If custom properties are not needed it is simpler to use `intType()`.

    - #### longType

          public final SchemaBuilder.LongDefault<R> longType()

      A plain long type without custom properties. This is equivalent to:

           longBuilder().endLong();

    - #### longBuilder

          public final SchemaBuilder.LongBuilder<SchemaBuilder.LongDefault<R>> longBuilder()

      Build a long type that can set custom properties. If custom properties are not needed it is simpler to use `longType()`.

    - #### floatType

          public final SchemaBuilder.FloatDefault<R> floatType()

      A plain float type without custom properties. This is equivalent to:

           floatBuilder().endFloat();

    - #### floatBuilder

          public final SchemaBuilder.FloatBuilder<SchemaBuilder.FloatDefault<R>> floatBuilder()

      Build a float type that can set custom properties. If custom properties are not needed it is simpler to use `floatType()`.

    - #### doubleType

          public final SchemaBuilder.DoubleDefault<R> doubleType()

      A plain double type without custom properties. This is equivalent to:

           doubleBuilder().endDouble();

    - #### doubleBuilder

          public final SchemaBuilder.DoubleBuilder<SchemaBuilder.DoubleDefault<R>> doubleBuilder()

      Build a double type that can set custom properties. If custom properties are not needed it is simpler to use `doubleType()`.

    - #### stringType

          public final SchemaBuilder.StringDefault<R> stringType()

      A plain string type without custom properties. This is equivalent to:

           stringBuilder().endString();

    - #### stringBuilder

          public final SchemaBuilder.StringBldr<SchemaBuilder.StringDefault<R>> stringBuilder()

      Build a string type that can set custom properties. If custom properties are not needed it is simpler to use `stringType()`.

    - #### bytesType

          public final SchemaBuilder.BytesDefault<R> bytesType()

      A plain bytes type without custom properties. This is equivalent to:

           bytesBuilder().endBytes();

    - #### bytesBuilder

          public final SchemaBuilder.BytesBuilder<SchemaBuilder.BytesDefault<R>> bytesBuilder()

      Build a bytes type that can set custom properties. If custom properties are not needed it is simpler to use `bytesType()`.

    - #### nullType

          public final SchemaBuilder.NullDefault<R> nullType()

      A plain null type without custom properties. This is equivalent to:

           nullBuilder().endNull();

    - #### nullBuilder

          public final SchemaBuilder.NullBuilder<SchemaBuilder.NullDefault<R>> nullBuilder()

      Build a null type that can set custom properties. If custom properties are not needed it is simpler to use `nullType()`.

    - #### map

          public final SchemaBuilder.MapBuilder<SchemaBuilder.MapDefault<R>> map()

      Build an Avro map type

    - #### array

          public final SchemaBuilder.ArrayBuilder<SchemaBuilder.ArrayDefault<R>> array()

      Build an Avro array type

    - #### fixed

          public final SchemaBuilder.FixedBuilder<SchemaBuilder.FixedDefault<R>> fixed(String name)

      Build an Avro fixed type.

    - #### enumeration

          public final SchemaBuilder.EnumBuilder<SchemaBuilder.EnumDefault<R>> enumeration(String name)

      Build an Avro enum type.

    - #### record

          public final SchemaBuilder.RecordBuilder<SchemaBuilder.RecordDefault<R>> record(String name)

      Build an Avro record type.

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