Class Schema.Builder (2.0.0)

public static final class Schema.Builder

A builder which constructs Schema objects.

Inheritance

java.lang.Object > Schema.Builder

Constructors

Builder()

protected Builder()

Constructs a builder for a schema.

Methods

addTypedField(String fieldName, Field.FieldType fieldType)

public Schema.Builder addTypedField(String fieldName, Field.FieldType fieldType)

Adds typed field name to the schema builder. Allows multiple field types with the same name.

Parameters
NameDescription
fieldNameString

the field name to add to the schema

fieldTypeField.FieldType
Returns
TypeDescription
Schema.Builder

this document builder

build()

public Schema build()

Builds a valid document. The builder must have set a valid document id, and have a non-empty set of valid fields.

Returns
TypeDescription
Schema

the schema built by this builder