Package com.google.cloud.bigquery
Class Field
- java.lang.Object
-
- com.google.cloud.bigquery.Field
-
- All Implemented Interfaces:
Serializable
public final class Field extends Object implements Serializable
Google BigQuery Table schema field. A table field has a name, a type, a mode and possibly a description.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classField.Builderstatic classField.ModeMode for a BigQuery Table field.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetCollation()StringgetDefaultValueExpression()Return the default value of the field.StringgetDescription()Returns the field description.LonggetMaxLength()Returns the maximum length of the field for STRING or BYTES type.Field.ModegetMode()Returns the field mode.StringgetName()Returns the field name.PolicyTagsgetPolicyTags()Returns the policy tags for the field.LonggetPrecision()Returns the maximum number of total digits allowed for NUMERIC or BIGNUMERIC types.LonggetScale()Returns the maximum number of digits set in the fractional part of a NUMERIC or BIGNUMERIC type.FieldListgetSubFields()Returns the list of sub-fields ifgetType()is aLegacySQLTypeName.RECORD.LegacySQLTypeNamegetType()Returns the field type.inthashCode()static Field.BuildernewBuilder(String name, LegacySQLTypeName type, Field... subFields)Returns a builder for a Field object with given name and type.static Field.BuildernewBuilder(String name, LegacySQLTypeName type, FieldList subFields)Returns a builder for a Field object with given name and type.static Field.BuildernewBuilder(String name, StandardSQLTypeName type, Field... subFields)Returns a builder for a Field object with given name and type.static Field.BuildernewBuilder(String name, StandardSQLTypeName type, FieldList subFields)Returns a builder for a Field object with given name and type.static Fieldof(String name, LegacySQLTypeName type, Field... subFields)Returns a Field object with given name and type.static Fieldof(String name, LegacySQLTypeName type, FieldList subFields)Returns a Field object with given name and type.static Fieldof(String name, StandardSQLTypeName type, Field... subFields)Returns a Field object with given name and type.static Fieldof(String name, StandardSQLTypeName type, FieldList subFields)Returns a Field object with given name and type.Field.BuildertoBuilder()Returns a builder for theFieldobject.StringtoString()
-
-
-
Method Detail
-
getName
public String getName()
Returns the field name.
-
getType
public LegacySQLTypeName getType()
Returns the field type.- See Also:
- Data Types
-
getMode
public Field.Mode getMode()
Returns the field mode. By defaultField.Mode.NULLABLEis used.
-
getDescription
public String getDescription()
Returns the field description.
-
getPolicyTags
public PolicyTags getPolicyTags()
Returns the policy tags for the field.
-
getMaxLength
public Long getMaxLength()
Returns the maximum length of the field for STRING or BYTES type.
-
getScale
public Long getScale()
Returns the maximum number of digits set in the fractional part of a NUMERIC or BIGNUMERIC type.
-
getPrecision
public Long getPrecision()
Returns the maximum number of total digits allowed for NUMERIC or BIGNUMERIC types.
-
getDefaultValueExpression
public String getDefaultValueExpression()
Return the default value of the field.
-
getCollation
public String getCollation()
-
getSubFields
public FieldList getSubFields()
-
toBuilder
public Field.Builder toBuilder()
Returns a builder for theFieldobject.
-
of
public static Field of(String name, LegacySQLTypeName type, Field... subFields)
Returns a Field object with given name and type.
-
of
public static Field of(String name, StandardSQLTypeName type, Field... subFields)
Returns a Field object with given name and type.
-
of
public static Field of(String name, LegacySQLTypeName type, FieldList subFields)
Returns a Field object with given name and type.
-
of
public static Field of(String name, StandardSQLTypeName type, FieldList subFields)
Returns a Field object with given name and type.
-
newBuilder
public static Field.Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields)
Returns a builder for a Field object with given name and type.
-
newBuilder
public static Field.Builder newBuilder(String name, StandardSQLTypeName type, Field... subFields)
Returns a builder for a Field object with given name and type.
-
newBuilder
public static Field.Builder newBuilder(String name, LegacySQLTypeName type, FieldList subFields)
Returns a builder for a Field object with given name and type.
-
newBuilder
public static Field.Builder newBuilder(String name, StandardSQLTypeName type, FieldList subFields)
Returns a builder for a Field object with given name and type.
-
-