Package org.apache.beam.sdk.schemas
Class Schema.Field
- java.lang.Object
-
- org.apache.beam.sdk.schemas.Schema.Field
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- Schema
public abstract static class Schema.Field extends java.lang.Object implements java.io.Serializable
Field of a row. Contains theSchema.FieldType
along with associated metadata.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Schema.Field.Builder
Builder forSchema.Field
.
-
Constructor Summary
Constructors Constructor Description Field()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object o)
abstract java.lang.String
getDescription()
Returns the field's description.abstract java.lang.String
getName()
Returns the field name.abstract Schema.Options
getOptions()
Returns the fieldsSchema.Options
.abstract Schema.FieldType
getType()
Returns the fieldsSchema.FieldType
.int
hashCode()
static Schema.Field
nullable(java.lang.String name, Schema.FieldType fieldType)
Return's a nullable field with the give name and type.static Schema.Field
of(java.lang.String name, Schema.FieldType fieldType)
Return's a field with the give name and type.abstract Schema.Field.Builder
toBuilder()
boolean
typesEqual(Schema.Field other)
Returns true if two fields are equal, ignoring name and description.Schema.Field
withDescription(java.lang.String description)
Returns a copy of the Field with the description set.Schema.Field
withName(java.lang.String name)
Returns a copy of the Field with the name set.Schema.Field
withNullable(boolean isNullable)
Returns a copy of the Field with isNullable set.Schema.Field
withOptions(Schema.Options options)
Returns a copy of the Field with the options set.Schema.Field
withOptions(Schema.Options.Builder optionsBuilder)
Returns a copy of the Field with the options set.Schema.Field
withType(Schema.FieldType fieldType)
Returns a copy of the Field with theSchema.FieldType
set.
-
-
-
Method Detail
-
getName
public abstract java.lang.String getName()
Returns the field name.
-
getDescription
public abstract java.lang.String getDescription()
Returns the field's description.
-
getType
public abstract Schema.FieldType getType()
Returns the fieldsSchema.FieldType
.
-
getOptions
public abstract Schema.Options getOptions()
Returns the fieldsSchema.Options
.
-
toBuilder
public abstract Schema.Field.Builder toBuilder()
-
of
public static Schema.Field of(java.lang.String name, Schema.FieldType fieldType)
Return's a field with the give name and type.
-
nullable
public static Schema.Field nullable(java.lang.String name, Schema.FieldType fieldType)
Return's a nullable field with the give name and type.
-
withName
public Schema.Field withName(java.lang.String name)
Returns a copy of the Field with the name set.
-
withDescription
public Schema.Field withDescription(java.lang.String description)
Returns a copy of the Field with the description set.
-
withType
public Schema.Field withType(Schema.FieldType fieldType)
Returns a copy of the Field with theSchema.FieldType
set.
-
withNullable
public Schema.Field withNullable(boolean isNullable)
Returns a copy of the Field with isNullable set.
-
withOptions
public Schema.Field withOptions(Schema.Options options)
Returns a copy of the Field with the options set.
-
withOptions
public Schema.Field withOptions(Schema.Options.Builder optionsBuilder)
Returns a copy of the Field with the options set.
-
equals
public final boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
typesEqual
public boolean typesEqual(Schema.Field other)
Returns true if two fields are equal, ignoring name and description.
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-