Package org.apache.avro
Class SchemaBuilder.BaseFieldTypeBuilder<R>
java.lang.Object
org.apache.avro.SchemaBuilder.BaseFieldTypeBuilder<R>
- Direct Known Subclasses:
SchemaBuilder.FieldTypeBuilder
- Enclosing class:
SchemaBuilder
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
FieldsModifier and TypeFieldDescriptionprotected final SchemaBuilder.FieldBuilder
<R> protected final org.apache.avro.SchemaBuilder.NameContext
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseFieldTypeBuilder
(SchemaBuilder.FieldBuilder<R> bldr, org.apache.avro.SchemaBuilder.CompletionWrapper wrapper) -
Method Summary
Modifier and TypeMethodDescriptionarray()
Build an Avro array typeBuild a boolean type that can set custom properties.final SchemaBuilder.BooleanDefault
<R> A plain boolean type without custom properties.Build a bytes type that can set custom properties.final SchemaBuilder.BytesDefault
<R> A plain bytes type without custom properties.Build a double type that can set custom properties.final SchemaBuilder.DoubleDefault
<R> A plain double type without custom properties.enumeration
(String name) Build an Avro enum type.Build an Avro fixed type.Build a float type that can set custom properties.final SchemaBuilder.FloatDefault
<R> A plain float type without custom properties.Build an int type that can set custom properties.final SchemaBuilder.IntDefault
<R> intType()
A plain int type without custom properties.Build a long type that can set custom properties.final SchemaBuilder.LongDefault
<R> longType()
A plain long type without custom properties.map()
Build an Avro map typeBuild a null type that can set custom properties.final SchemaBuilder.NullDefault
<R> nullType()
A plain null type without custom properties.Build an Avro record type.Build a string type that can set custom properties.final SchemaBuilder.StringDefault
<R> A plain string type without custom properties.
-
Field Details
-
bldr
-
names
protected final org.apache.avro.SchemaBuilder.NameContext names
-
-
Constructor Details
-
BaseFieldTypeBuilder
protected BaseFieldTypeBuilder(SchemaBuilder.FieldBuilder<R> bldr, org.apache.avro.SchemaBuilder.CompletionWrapper wrapper)
-
-
Method Details
-
booleanType
A plain boolean type without custom properties. This is equivalent to:booleanBuilder().endBoolean();
-
booleanBuilder
Build a boolean type that can set custom properties. If custom properties are not needed it is simpler to usebooleanType()
. -
intType
A plain int type without custom properties. This is equivalent to:intBuilder().endInt();
-
intBuilder
Build an int type that can set custom properties. If custom properties are not needed it is simpler to useintType()
. -
longType
A plain long type without custom properties. This is equivalent to:longBuilder().endLong();
-
longBuilder
Build a long type that can set custom properties. If custom properties are not needed it is simpler to uselongType()
. -
floatType
A plain float type without custom properties. This is equivalent to:floatBuilder().endFloat();
-
floatBuilder
Build a float type that can set custom properties. If custom properties are not needed it is simpler to usefloatType()
. -
doubleType
A plain double type without custom properties. This is equivalent to:doubleBuilder().endDouble();
-
doubleBuilder
Build a double type that can set custom properties. If custom properties are not needed it is simpler to usedoubleType()
. -
stringType
A plain string type without custom properties. This is equivalent to:stringBuilder().endString();
-
stringBuilder
Build a string type that can set custom properties. If custom properties are not needed it is simpler to usestringType()
. -
bytesType
A plain bytes type without custom properties. This is equivalent to:bytesBuilder().endBytes();
-
bytesBuilder
Build a bytes type that can set custom properties. If custom properties are not needed it is simpler to usebytesType()
. -
nullType
A plain null type without custom properties. This is equivalent to:nullBuilder().endNull();
-
nullBuilder
Build a null type that can set custom properties. If custom properties are not needed it is simpler to usenullType()
. -
map
Build an Avro map type -
array
Build an Avro array type -
fixed
Build an Avro fixed type. -
enumeration
Build an Avro enum type. -
record
Build an Avro record type.
-