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 class
Field.Builder
static class
Field.Mode
Mode for a BigQuery Table field.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getCollation()
String
getDefaultValueExpression()
Return the default value of the field.String
getDescription()
Returns the field description.Long
getMaxLength()
Returns the maximum length of the field for STRING or BYTES type.Field.Mode
getMode()
Returns the field mode.String
getName()
Returns the field name.PolicyTags
getPolicyTags()
Returns the policy tags for the field.Long
getPrecision()
Returns the maximum number of total digits allowed for NUMERIC or BIGNUMERIC types.Long
getScale()
Returns the maximum number of digits set in the fractional part of a NUMERIC or BIGNUMERIC type.FieldList
getSubFields()
Returns the list of sub-fields ifgetType()
is aLegacySQLTypeName.RECORD
.LegacySQLTypeName
getType()
Returns the field type.int
hashCode()
static Field.Builder
newBuilder(String name, LegacySQLTypeName type, Field... subFields)
Returns a builder for a Field object with given name and type.static Field.Builder
newBuilder(String name, LegacySQLTypeName type, FieldList subFields)
Returns a builder for a Field object with given name and type.static Field.Builder
newBuilder(String name, StandardSQLTypeName type, Field... subFields)
Returns a builder for a Field object with given name and type.static Field.Builder
newBuilder(String name, StandardSQLTypeName type, FieldList subFields)
Returns a builder for a Field object with given name and type.static Field
of(String name, LegacySQLTypeName type, Field... subFields)
Returns a Field object with given name and type.static Field
of(String name, LegacySQLTypeName type, FieldList subFields)
Returns a Field object with given name and type.static Field
of(String name, StandardSQLTypeName type, Field... subFields)
Returns a Field object with given name and type.static Field
of(String name, StandardSQLTypeName type, FieldList subFields)
Returns a Field object with given name and type.Field.Builder
toBuilder()
Returns a builder for theField
object.String
toString()
-
-
-
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.NULLABLE
is 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 theField
object.
-
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.
-
-