org.apache.avro

## Class SchemaBuilder.FieldBuilder<R>

- java.lang.Object
- - org.apache.avro.SchemaBuilder.PropBuilder<S>
  - - org.apache.avro.SchemaBuilder.NamedBuilder<SchemaBuilder.FieldBuilder<R>>
    - - org.apache.avro.SchemaBuilder.FieldBuilder<R>

- Enclosing class:
    SchemaBuilder

      public static final class SchemaBuilder.FieldBuilder<R>
      extends SchemaBuilder.NamedBuilder<SchemaBuilder.FieldBuilder<R>>

  Builds a Field in the context of a `SchemaBuilder.FieldAssembler`. Usage is to first configure any of the optional parameters and then to call one of the type methods to complete the field. For example

         .namespace("org.apache.example").orderDescending().type()

  Optional parameters for a field are namespace, doc, order, and aliases.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SchemaBuilder.FieldBuilder<R>` | `notValidatingDefaults()` Skip field default value validation during `completeField(Schema, JsonNode)`}
    `SchemaBuilder.FieldBuilder<R>` | `orderAscending()` Set this field to have ascending order.
    `SchemaBuilder.FieldBuilder<R>` | `orderDescending()` Set this field to have descending order.
    `SchemaBuilder.FieldBuilder<R>` | `orderIgnore()` Set this field to ignore order.
    `protected SchemaBuilder.FieldBuilder<R>` | `self()` a self-type for chaining builder subclasses.
    `SchemaBuilder.FieldTypeBuilder<R>` | `type()` Final step in configuring this field, finalizing name, namespace, alias, and order.
    `SchemaBuilder.GenericDefault<R>` | `type(Schema type)` Final step in configuring this field, finalizing name, namespace, alias, and order.
    `SchemaBuilder.GenericDefault<R>` | `type(String name)` Final step in configuring this field, finalizing name, namespace, alias, and order.
    `SchemaBuilder.GenericDefault<R>` | `type(String name, String namespace)` Final step in configuring this field, finalizing name, namespace, alias, and order.
    `SchemaBuilder.FieldBuilder<R>` | `validatingDefaults()` Validate field default value during `completeField(Schema, JsonNode)`.

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

      `aliases, doc`

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

      `prop, prop`

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

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

- - ### Method Detail

    - #### orderAscending

          public SchemaBuilder.FieldBuilder<R> orderAscending()

      Set this field to have ascending order. Ascending is the default

    - #### orderDescending

          public SchemaBuilder.FieldBuilder<R> orderDescending()

      Set this field to have descending order. Descending is the default

    - #### orderIgnore

          public SchemaBuilder.FieldBuilder<R> orderIgnore()

      Set this field to ignore order.

    - #### validatingDefaults

          public SchemaBuilder.FieldBuilder<R> validatingDefaults()

      Validate field default value during `completeField(Schema, JsonNode)`.

    - #### notValidatingDefaults

          public SchemaBuilder.FieldBuilder<R> notValidatingDefaults()

      Skip field default value validation during `completeField(Schema, JsonNode)`}

    - #### type

          public SchemaBuilder.FieldTypeBuilder<R> type()

      Final step in configuring this field, finalizing name, namespace, alias, and order.
      Returns:
        A builder for the field's type and default value.

    - #### type

          public SchemaBuilder.GenericDefault<R> type(Schema type)

      Final step in configuring this field, finalizing name, namespace, alias, and order. Sets the field's type to the provided schema, returns a `SchemaBuilder.GenericDefault`.

    - #### type

          public SchemaBuilder.GenericDefault<R> type(String name)

      Final step in configuring this field, finalizing name, namespace, alias, and order. Sets the field's type to the schema by name reference.

      The name must correspond with a named schema that has already been created in the context of this builder. The name may be a fully qualified name, or a short name. If it is a short name, the namespace context of this builder will be used.

      The name and namespace context rules are the same as the Avro schema JSON specification.

    - #### type

          public SchemaBuilder.GenericDefault<R> type(String name,
                                                      String namespace)

      Final step in configuring this field, finalizing name, namespace, alias, and order. Sets the field's type to the schema by name reference.

      The name must correspond with a named schema that has already been created in the context of this builder. The name may be a fully qualified name, or a short name. If it is a full name, the namespace is ignored. If it is a short name, the namespace provided is used. If the namespace provided is null, the namespace context of this builder will be used.

      The name and namespace context rules are the same as the Avro schema JSON specification.

    - #### self

          protected SchemaBuilder.FieldBuilder<R> self()

      Description copied from class: `SchemaBuilder.PropBuilder`
      a self-type for chaining builder subclasses. Concrete subclasses must return 'this'
      Specified by:
        `self` in class `SchemaBuilder.PropBuilder<SchemaBuilder.FieldBuilder<R>>`

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