@Immutable public abstract static class Schema.FieldType extends java.lang.Object implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static Schema.FieldType |
BOOLEAN
The type of boolean fields.
|
static Schema.FieldType |
BYTE
The type of byte fields.
|
static Schema.FieldType |
BYTES
The type of bytes fields.
|
static Schema.FieldType |
DATETIME
The type of datetime fields.
|
static Schema.FieldType |
DECIMAL
The type of decimal fields.
|
static Schema.FieldType |
DOUBLE
The type of double fields.
|
static Schema.FieldType |
FLOAT
The type of float fields.
|
static Schema.FieldType |
INT16
The type of int16 fields.
|
static Schema.FieldType |
INT32
The type of int32 fields.
|
static Schema.FieldType |
INT64
The type of int64 fields.
|
static Schema.FieldType |
STRING
The type of string fields.
|
Constructor and Description |
---|
FieldType() |
Modifier and Type | Method and Description |
---|---|
static Schema.FieldType |
array(Schema.FieldType elementType)
Create an array type for the given field type.
|
static Schema.FieldType |
array(Schema.FieldType elementType,
boolean nullable)
Deprecated.
Set the nullability on the elementType instead
|
boolean |
equals(@Nullable java.lang.Object o) |
boolean |
equivalent(Schema.FieldType other,
Schema.EquivalenceNullablePolicy nullablePolicy)
Check whether two types are equivalent.
|
static org.apache.beam.sdk.schemas.Schema.FieldType.Builder |
forTypeName(Schema.TypeName typeName) |
java.util.Map<java.lang.String,byte[]> |
getAllMetadata()
Deprecated.
use schema options instead.
|
abstract @Nullable Schema.FieldType |
getCollectionElementType() |
abstract @Nullable Schema.LogicalType<?,?> |
getLogicalType() |
<InputT,BaseT,LogicalTypeT extends Schema.LogicalType<InputT,BaseT>> |
getLogicalType(java.lang.Class<LogicalTypeT> logicalTypeClass)
Helper function for retrieving the concrete logical type subclass.
|
abstract @Nullable Schema.FieldType |
getMapKeyType() |
abstract @Nullable Schema.FieldType |
getMapValueType() |
byte[] |
getMetadata(java.lang.String key)
Deprecated.
use schema options instead.
|
java.lang.String |
getMetadataString(java.lang.String key)
Deprecated.
use schema options instead.
|
abstract java.lang.Boolean |
getNullable() |
abstract @Nullable Schema |
getRowSchema() |
abstract Schema.TypeName |
getTypeName() |
int |
hashCode() |
boolean |
isLogicalType(java.lang.String logicalTypeIdentifier) |
static Schema.FieldType |
iterable(Schema.FieldType elementType) |
static <InputT,BaseT> |
logicalType(Schema.LogicalType<InputT,BaseT> logicalType)
Creates a logical type based on a primitive field type.
|
static Schema.FieldType |
map(Schema.FieldType keyType,
Schema.FieldType valueType)
Create a map type for the given key and value types.
|
static Schema.FieldType |
map(Schema.FieldType keyType,
Schema.FieldType valueType,
boolean valueTypeNullable)
Deprecated.
Set the nullability on the valueType instead
|
static Schema.FieldType |
of(Schema.TypeName typeName)
Create a
Schema.FieldType for the given type. |
static Schema.FieldType |
row(Schema schema)
Create a map type for the given key and value types.
|
abstract org.apache.beam.sdk.schemas.Schema.FieldType.Builder |
toBuilder() |
java.lang.String |
toString() |
boolean |
typesEqual(Schema.FieldType other)
Returns true if two FieldTypes are equal.
|
Schema.FieldType |
withMetadata(java.util.Map<java.lang.String,byte[]> metadata)
Deprecated.
use schema options instead.
|
Schema.FieldType |
withMetadata(java.lang.String key,
byte[] metadata)
Deprecated.
use schema options instead.
|
Schema.FieldType |
withMetadata(java.lang.String key,
java.lang.String metadata)
Deprecated.
use schema options instead.
|
Schema.FieldType |
withNullable(boolean nullable) |
public static final Schema.FieldType STRING
public static final Schema.FieldType BYTE
public static final Schema.FieldType BYTES
public static final Schema.FieldType INT16
public static final Schema.FieldType INT32
public static final Schema.FieldType INT64
public static final Schema.FieldType FLOAT
public static final Schema.FieldType DOUBLE
public static final Schema.FieldType DECIMAL
public static final Schema.FieldType BOOLEAN
public static final Schema.FieldType DATETIME
public abstract Schema.TypeName getTypeName()
public abstract java.lang.Boolean getNullable()
public abstract @Nullable Schema.LogicalType<?,?> getLogicalType()
public abstract @Nullable Schema.FieldType getCollectionElementType()
public abstract @Nullable Schema.FieldType getMapKeyType()
public abstract @Nullable Schema.FieldType getMapValueType()
public abstract @Nullable Schema getRowSchema()
public abstract org.apache.beam.sdk.schemas.Schema.FieldType.Builder toBuilder()
public boolean isLogicalType(java.lang.String logicalTypeIdentifier)
public <InputT,BaseT,LogicalTypeT extends Schema.LogicalType<InputT,BaseT>> LogicalTypeT getLogicalType(java.lang.Class<LogicalTypeT> logicalTypeClass)
public static org.apache.beam.sdk.schemas.Schema.FieldType.Builder forTypeName(Schema.TypeName typeName)
public static Schema.FieldType of(Schema.TypeName typeName)
Schema.FieldType
for the given type.public static Schema.FieldType array(Schema.FieldType elementType)
@Deprecated public static Schema.FieldType array(Schema.FieldType elementType, boolean nullable)
public static Schema.FieldType iterable(Schema.FieldType elementType)
public static Schema.FieldType map(Schema.FieldType keyType, Schema.FieldType valueType)
@Deprecated public static Schema.FieldType map(Schema.FieldType keyType, Schema.FieldType valueType, boolean valueTypeNullable)
public static Schema.FieldType row(Schema schema)
public static <InputT,BaseT> Schema.FieldType logicalType(Schema.LogicalType<InputT,BaseT> logicalType)
@Deprecated public Schema.FieldType withMetadata(java.util.Map<java.lang.String,byte[]> metadata)
@Deprecated public Schema.FieldType withMetadata(java.lang.String key, byte[] metadata)
@Deprecated public Schema.FieldType withMetadata(java.lang.String key, java.lang.String metadata)
@Deprecated public java.util.Map<java.lang.String,byte[]> getAllMetadata()
@Deprecated public byte[] getMetadata(java.lang.String key)
@Deprecated public java.lang.String getMetadataString(java.lang.String key)
public Schema.FieldType withNullable(boolean nullable)
public final boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public boolean typesEqual(Schema.FieldType other)
public boolean equivalent(Schema.FieldType other, Schema.EquivalenceNullablePolicy nullablePolicy)
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object