Package org.apache.avro
Class SchemaBuilder.FieldAssembler<R>
java.lang.Object
org.apache.avro.SchemaBuilder.FieldAssembler<R>
- Enclosing class:
SchemaBuilder
-
Method Summary
Modifier and TypeMethodDescriptionEnd adding fields to this record, returning control to the context that this record builder was created in.Add a field with the given name.nullableBoolean
(String fieldName, boolean defaultVal) Shortcut for creating a nullable boolean field: a union of boolean and null with an boolean default.nullableBytes
(String fieldName, byte[] defaultVal) Shortcut for creating a nullable bytes field: a union of bytes and null with a bytes default.nullableDouble
(String fieldName, double defaultVal) Shortcut for creating a nullable double field: a union of double and null with a double default.nullableFloat
(String fieldName, float defaultVal) Shortcut for creating a nullable float field: a union of float and null with a float default.nullableInt
(String fieldName, int defaultVal) Shortcut for creating a nullable int field: a union of int and null with an int default.nullableLong
(String fieldName, long defaultVal) Shortcut for creating a nullable long field: a union of long and null with a long default.nullableString
(String fieldName, String defaultVal) Shortcut for creating a nullable string field: a union of string and null with a string default.optionalBoolean
(String fieldName) Shortcut for creating an optional boolean field: a union of null and boolean with null default.optionalBytes
(String fieldName) Shortcut for creating an optional bytes field: a union of null and bytes with null default.optionalDouble
(String fieldName) Shortcut for creating an optional double field: a union of null and double with null default.optionalFloat
(String fieldName) Shortcut for creating an optional float field: a union of null and float with null default.optionalInt
(String fieldName) Shortcut for creating an optional int field: a union of null and int with null default.optionalLong
(String fieldName) Shortcut for creating an optional long field: a union of null and long with null default.optionalString
(String fieldName) Shortcut for creating an optional string field: a union of null and string with null default.requiredBoolean
(String fieldName) Shortcut for creating a boolean field with the given name and no default.requiredBytes
(String fieldName) Shortcut for creating a bytes field with the given name and no default.requiredDouble
(String fieldName) Shortcut for creating a double field with the given name and no default.requiredFloat
(String fieldName) Shortcut for creating a float field with the given name and no default.requiredInt
(String fieldName) Shortcut for creating an int field with the given name and no default.requiredLong
(String fieldName) Shortcut for creating a long field with the given name and no default.requiredString
(String fieldName) Shortcut for creating a string field with the given name and no default.
-
Method Details
-
name
Add a field with the given name.- Returns:
- A
SchemaBuilder.FieldBuilder
for the given name.
-
requiredBoolean
Shortcut for creating a boolean field with the given name and no default. This is equivalent to:name(fieldName).type().booleanType().noDefault()
-
optionalBoolean
Shortcut for creating an optional boolean field: a union of null and boolean with null default. This is equivalent to:name(fieldName).type().optional().booleanType()
-
nullableBoolean
Shortcut for creating a nullable boolean field: a union of boolean and null with an boolean default. This is equivalent to:name(fieldName).type().nullable().booleanType().booleanDefault(defaultVal)
-
requiredInt
Shortcut for creating an int field with the given name and no default. This is equivalent to:name(fieldName).type().intType().noDefault()
-
optionalInt
Shortcut for creating an optional int field: a union of null and int with null default. This is equivalent to:name(fieldName).type().optional().intType()
-
nullableInt
Shortcut for creating a nullable int field: a union of int and null with an int default. This is equivalent to:name(fieldName).type().nullable().intType().intDefault(defaultVal)
-
requiredLong
Shortcut for creating a long field with the given name and no default. This is equivalent to:name(fieldName).type().longType().noDefault()
-
optionalLong
Shortcut for creating an optional long field: a union of null and long with null default. This is equivalent to:name(fieldName).type().optional().longType()
-
nullableLong
Shortcut for creating a nullable long field: a union of long and null with a long default. This is equivalent to:name(fieldName).type().nullable().longType().longDefault(defaultVal)
-
requiredFloat
Shortcut for creating a float field with the given name and no default. This is equivalent to:name(fieldName).type().floatType().noDefault()
-
optionalFloat
Shortcut for creating an optional float field: a union of null and float with null default. This is equivalent to:name(fieldName).type().optional().floatType()
-
nullableFloat
Shortcut for creating a nullable float field: a union of float and null with a float default. This is equivalent to:name(fieldName).type().nullable().floatType().floatDefault(defaultVal)
-
requiredDouble
Shortcut for creating a double field with the given name and no default. This is equivalent to:name(fieldName).type().doubleType().noDefault()
-
optionalDouble
Shortcut for creating an optional double field: a union of null and double with null default. This is equivalent to:name(fieldName).type().optional().doubleType()
-
nullableDouble
Shortcut for creating a nullable double field: a union of double and null with a double default. This is equivalent to:name(fieldName).type().nullable().doubleType().doubleDefault(defaultVal)
-
requiredString
Shortcut for creating a string field with the given name and no default. This is equivalent to:name(fieldName).type().stringType().noDefault()
-
optionalString
Shortcut for creating an optional string field: a union of null and string with null default. This is equivalent to:name(fieldName).type().optional().stringType()
-
nullableString
Shortcut for creating a nullable string field: a union of string and null with a string default. This is equivalent to:name(fieldName).type().nullable().stringType().stringDefault(defaultVal)
-
requiredBytes
Shortcut for creating a bytes field with the given name and no default. This is equivalent to:name(fieldName).type().bytesType().noDefault()
-
optionalBytes
Shortcut for creating an optional bytes field: a union of null and bytes with null default. This is equivalent to:name(fieldName).type().optional().bytesType()
-
nullableBytes
Shortcut for creating a nullable bytes field: a union of bytes and null with a bytes default. This is equivalent to:name(fieldName).type().nullable().bytesType().bytesDefault(defaultVal)
-
endRecord
End adding fields to this record, returning control to the context that this record builder was created in.
-