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:
  • Method Details

    • getName

      public String getName()
      Returns the field name.
    • getType

      public LegacySQLTypeName getType()
      Returns the field type.
      See Also:
    • getMode

      public Field.Mode getMode()
      Returns the field mode. By default Field.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()
      Returns the list of sub-fields if getType() is a LegacySQLTypeName.RECORD. Returns null otherwise.
    • toBuilder

      public Field.Builder toBuilder()
      Returns a builder for the Field object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class 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.