Class Field (2.23.2)

public final class Field implements Serializable

Google BigQuery Table schema field. A table field has a name, a type, a mode and possibly a description.

Inheritance

Object > Field

Implements

Serializable

Static Methods

newBuilder(String name, LegacySQLTypeName type, Field[] subFields)

public static Field.Builder newBuilder(String name, LegacySQLTypeName type, Field[] subFields)

Returns a builder for a Field object with given name and type.

Parameters
NameDescription
nameString
typeLegacySQLTypeName
subFieldsField[]
Returns
TypeDescription
Field.Builder

newBuilder(String name, LegacySQLTypeName type, FieldList subFields)

public static Field.Builder newBuilder(String name, LegacySQLTypeName type, FieldList subFields)

Returns a builder for a Field object with given name and type.

Parameters
NameDescription
nameString
typeLegacySQLTypeName
subFieldsFieldList
Returns
TypeDescription
Field.Builder

newBuilder(String name, StandardSQLTypeName type, Field[] subFields)

public static Field.Builder newBuilder(String name, StandardSQLTypeName type, Field[] subFields)

Returns a builder for a Field object with given name and type.

Parameters
NameDescription
nameString
typeStandardSQLTypeName
subFieldsField[]
Returns
TypeDescription
Field.Builder

newBuilder(String name, StandardSQLTypeName type, FieldList subFields)

public static Field.Builder newBuilder(String name, StandardSQLTypeName type, FieldList subFields)

Returns a builder for a Field object with given name and type.

Parameters
NameDescription
nameString
typeStandardSQLTypeName
subFieldsFieldList
Returns
TypeDescription
Field.Builder

of(String name, LegacySQLTypeName type, Field[] subFields)

public static Field of(String name, LegacySQLTypeName type, Field[] subFields)

Returns a Field object with given name and type.

Parameters
NameDescription
nameString
typeLegacySQLTypeName
subFieldsField[]
Returns
TypeDescription
Field

of(String name, LegacySQLTypeName type, FieldList subFields)

public static Field of(String name, LegacySQLTypeName type, FieldList subFields)

Returns a Field object with given name and type.

Parameters
NameDescription
nameString
typeLegacySQLTypeName
subFieldsFieldList
Returns
TypeDescription
Field

of(String name, StandardSQLTypeName type, Field[] subFields)

public static Field of(String name, StandardSQLTypeName type, Field[] subFields)

Returns a Field object with given name and type.

Parameters
NameDescription
nameString
typeStandardSQLTypeName
subFieldsField[]
Returns
TypeDescription
Field

of(String name, StandardSQLTypeName type, FieldList subFields)

public static Field of(String name, StandardSQLTypeName type, FieldList subFields)

Returns a Field object with given name and type.

Parameters
NameDescription
nameString
typeStandardSQLTypeName
subFieldsFieldList
Returns
TypeDescription
Field

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCollation()

public String getCollation()
Returns
TypeDescription
String

getDefaultValueExpression()

public String getDefaultValueExpression()

Return the default value of the field.

Returns
TypeDescription
String

getDescription()

public String getDescription()

Returns the field description.

Returns
TypeDescription
String

getMaxLength()

public Long getMaxLength()

Returns the maximum length of the field for STRING or BYTES type.

Returns
TypeDescription
Long

getMode()

public Field.Mode getMode()

Returns the field mode. By default Mode#NULLABLE is used.

Returns
TypeDescription
Field.Mode

getName()

public String getName()

Returns the field name.

Returns
TypeDescription
String

getPolicyTags()

public PolicyTags getPolicyTags()

Returns the policy tags for the field.

Returns
TypeDescription
PolicyTags

getPrecision()

public Long getPrecision()

Returns the maximum number of total digits allowed for NUMERIC or BIGNUMERIC types.

Returns
TypeDescription
Long

getScale()

public Long getScale()

Returns the maximum number of digits set in the fractional part of a NUMERIC or BIGNUMERIC type.

Returns
TypeDescription
Long

getSubFields()

public FieldList getSubFields()

Returns the list of sub-fields if #getType() is a LegacySQLTypeName#RECORD. Returns null otherwise.

Returns
TypeDescription
FieldList

getType()

public LegacySQLTypeName getType()

Returns the field type. See Also: Data Types

Returns
TypeDescription
LegacySQLTypeName

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toBuilder()

public Field.Builder toBuilder()

Returns a builder for the Field object.

Returns
TypeDescription
Field.Builder

toString()

public String toString()
Returns
TypeDescription
String
Overrides