Class Field (2.55.2)

publicfinalclass FieldimplementsSerializable

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)

publicstaticField.BuildernewBuilder(Stringname,LegacySQLTypeNametype,Field[]subFields)

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

Parameters
Name Description
name String
type LegacySQLTypeName
subFields Field[]
Returns
Type Description
Field.Builder

newBuilder(String name, LegacySQLTypeName type, FieldList subFields)

publicstaticField.BuildernewBuilder(Stringname,LegacySQLTypeNametype,FieldListsubFields)

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

Parameters
Name Description
name String
type LegacySQLTypeName
subFields FieldList
Returns
Type Description
Field.Builder

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

publicstaticField.BuildernewBuilder(Stringname,StandardSQLTypeNametype,Field[]subFields)

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

Parameters
Name Description
name String
type StandardSQLTypeName
subFields Field[]
Returns
Type Description
Field.Builder

newBuilder(String name, StandardSQLTypeName type, FieldList subFields)

publicstaticField.BuildernewBuilder(Stringname,StandardSQLTypeNametype,FieldListsubFields)

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

Parameters
Name Description
name String
type StandardSQLTypeName
subFields FieldList
Returns
Type Description
Field.Builder

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

publicstaticFieldof(Stringname,LegacySQLTypeNametype,Field[]subFields)

Returns a Field object with given name and type.

Parameters
Name Description
name String
type LegacySQLTypeName
subFields Field[]
Returns
Type Description
Field

of(String name, LegacySQLTypeName type, FieldList subFields)

publicstaticFieldof(Stringname,LegacySQLTypeNametype,FieldListsubFields)

Returns a Field object with given name and type.

Parameters
Name Description
name String
type LegacySQLTypeName
subFields FieldList
Returns
Type Description
Field

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

publicstaticFieldof(Stringname,StandardSQLTypeNametype,Field[]subFields)

Returns a Field object with given name and type.

Parameters
Name Description
name String
type StandardSQLTypeName
subFields Field[]
Returns
Type Description
Field

of(String name, StandardSQLTypeName type, FieldList subFields)

publicstaticFieldof(Stringname,StandardSQLTypeNametype,FieldListsubFields)

Returns a Field object with given name and type.

Parameters
Name Description
name String
type StandardSQLTypeName
subFields FieldList
Returns
Type Description
Field

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCollation()

publicStringgetCollation()
Returns
Type Description
String

getDefaultValueExpression()

publicStringgetDefaultValueExpression()

Return the default value of the field.

Returns
Type Description
String

getDescription()

publicStringgetDescription()

Returns the field description.

Returns
Type Description
String

getMaxLength()

publicLonggetMaxLength()

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

Returns
Type Description
Long

getMode()

publicField.ModegetMode()

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

Returns
Type Description
Field.Mode

getName()

publicStringgetName()

Returns the field name.

Returns
Type Description
String

getPolicyTags()

publicPolicyTagsgetPolicyTags()

Returns the policy tags for the field.

Returns
Type Description
PolicyTags

getPrecision()

publicLonggetPrecision()

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

Returns
Type Description
Long

getRangeElementType()

publicFieldElementTypegetRangeElementType()

Return the range element type the field.

Returns
Type Description
FieldElementType

getScale()

publicLonggetScale()

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

Returns
Type Description
Long

getSubFields()

publicFieldListgetSubFields()

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

Returns
Type Description
FieldList

getType()

publicLegacySQLTypeNamegetType()

Returns the field type. See Also: Data Types

Returns
Type Description
LegacySQLTypeName

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

toBuilder()

publicField.BuildertoBuilder()

Returns a builder for the Field object.

Returns
Type Description
Field.Builder

toString()

publicStringtoString()
Returns
Type Description
String
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.