@@ -72,19 +72,15 @@ public static class Type implements Serializable {
7272
7373 private static final long serialVersionUID = 2841484762609576959L ;
7474
75- public enum Value {
76- BYTES , STRING , INTEGER , FLOAT , BOOLEAN , TIMESTAMP , RECORD
77- }
78-
79- private final Value value ;
75+ private final LegacySQLTypeName value ;
8076 private final List <Field > fields ;
8177
82- private Type (Value value ) {
78+ private Type (LegacySQLTypeName value ) {
8379 this .value = checkNotNull (value );
8480 this .fields = null ;
8581 }
8682
87- private Type (Value value , List <Field > fields ) {
83+ private Type (LegacySQLTypeName value , List <Field > fields ) {
8884 checkArgument (fields .size () > 0 , "Record must have at least one field" );
8985 this .value = value ;
9086 this .fields = fields ;
@@ -97,7 +93,7 @@ private Type(Value value, List<Field> fields) {
9793 * Data Types</a>
9894 */
9995 @ Deprecated
100- public Value value () {
96+ public LegacySQLTypeName value () {
10197 return getValue ();
10298 }
10399
@@ -107,81 +103,81 @@ public Value value() {
107103 * @see <a href="https://cloud.google.com/bigquery/preparing-data-for-bigquery#datatypes">
108104 * Data Types</a>
109105 */
110- public Value getValue () {
106+ public LegacySQLTypeName getValue () {
111107 return value ;
112108 }
113109
114110 /**
115- * Returns the list of sub-fields if {@link #value()} is set to {@link Value#RECORD}. Returns
116- * {@code null} otherwise.
111+ * Returns the list of sub-fields if {@link #value()} is set to {@link
112+ * LegacySQLTypeName#RECORD}. Returns {@code null} otherwise.
117113 */
118114 @ Deprecated
119115 public List <Field > fields () {
120116 return getFields ();
121117 }
122118
123119 /**
124- * Returns the list of sub-fields if {@link #value()} is set to {@link Value#RECORD}. Returns
125- * {@code null} otherwise.
120+ * Returns the list of sub-fields if {@link #value()} is set to {@link
121+ * LegacySQLTypeName#RECORD}. Returns {@code null} otherwise.
126122 */
127123 public List <Field > getFields () {
128124 return fields ;
129125 }
130126
131127 /**
132- * Returns a {@link Value #BYTES} field value.
128+ * Returns a {@link LegacySQLTypeName #BYTES} field value.
133129 */
134130 public static Type bytes () {
135- return new Type (Value .BYTES );
131+ return new Type (LegacySQLTypeName .BYTES );
136132 }
137133
138134 /**
139- * Returns a {@link Value #STRING} field value.
135+ * Returns a {@link LegacySQLTypeName #STRING} field value.
140136 */
141137 public static Type string () {
142- return new Type (Value .STRING );
138+ return new Type (LegacySQLTypeName .STRING );
143139 }
144140
145141 /**
146- * Returns an {@link Value #INTEGER} field value.
142+ * Returns an {@link LegacySQLTypeName #INTEGER} field value.
147143 */
148144 public static Type integer () {
149- return new Type (Value .INTEGER );
145+ return new Type (LegacySQLTypeName .INTEGER );
150146 }
151147
152148 /**
153- * Returns a {@link Value #FLOAT} field value.
149+ * Returns a {@link LegacySQLTypeName #FLOAT} field value.
154150 */
155151 public static Type floatingPoint () {
156- return new Type (Value .FLOAT );
152+ return new Type (LegacySQLTypeName .FLOAT );
157153 }
158154
159155 /**
160- * Returns a {@link Value #BOOLEAN} field value.
156+ * Returns a {@link LegacySQLTypeName #BOOLEAN} field value.
161157 */
162158 public static Type bool () {
163- return new Type (Value .BOOLEAN );
159+ return new Type (LegacySQLTypeName .BOOLEAN );
164160 }
165161
166162 /**
167- * Returns a {@link Value #TIMESTAMP} field value.
163+ * Returns a {@link LegacySQLTypeName #TIMESTAMP} field value.
168164 */
169165 public static Type timestamp () {
170- return new Type (Value .TIMESTAMP );
166+ return new Type (LegacySQLTypeName .TIMESTAMP );
171167 }
172168
173169 /**
174- * Returns a {@link Value #RECORD} field value with associated list of sub-fields.
170+ * Returns a {@link LegacySQLTypeName #RECORD} field value with associated list of sub-fields.
175171 */
176172 public static Type record (Field ... fields ) {
177- return new Type (Value .RECORD , ImmutableList .copyOf (fields ));
173+ return new Type (LegacySQLTypeName .RECORD , ImmutableList .copyOf (fields ));
178174 }
179175
180176 /**
181- * Returns a {@link Value #RECORD} field value with associated list of sub-fields.
177+ * Returns a {@link LegacySQLTypeName #RECORD} field value with associated list of sub-fields.
182178 */
183179 public static Type record (List <Field > fields ) {
184- return new Type (Value .RECORD , ImmutableList .copyOf (checkNotNull (fields )));
180+ return new Type (LegacySQLTypeName .RECORD , ImmutableList .copyOf (checkNotNull (fields )));
185181 }
186182
187183 @ Override
@@ -389,17 +385,17 @@ public String getDescription() {
389385 }
390386
391387 /**
392- * Returns the list of sub-fields if {@link #type()} is a {@link Type.Value #RECORD}. Returns
393- * {@code null} otherwise.
388+ * Returns the list of sub-fields if {@link #type()} is a {@link LegacySQLTypeName #RECORD}.
389+ * Returns {@code null} otherwise.
394390 */
395391 @ Deprecated
396392 public List <Field > fields () {
397393 return getFields ();
398394 }
399395
400396 /**
401- * Returns the list of sub-fields if {@link #type()} is a {@link Type.Value #RECORD}. Returns
402- * {@code null} otherwise.
397+ * Returns the list of sub-fields if {@link #type()} is a {@link LegacySQLTypeName #RECORD}.
398+ * Returns {@code null} otherwise.
403399 */
404400 public List <Field > getFields () {
405401 return type .getFields ();
@@ -474,7 +470,7 @@ public static Builder newBuilder(String name, Type type) {
474470 static Field fromPb (TableFieldSchema fieldSchemaPb ) {
475471 Builder fieldBuilder = new Builder ();
476472 fieldBuilder .setName (fieldSchemaPb .getName ());
477- Type . Value enumValue = Type . Value .valueOf (fieldSchemaPb .getType ());
473+ LegacySQLTypeName enumValue = LegacySQLTypeName .valueOf (fieldSchemaPb .getType ());
478474 if (fieldSchemaPb .getMode () != null ) {
479475 fieldBuilder .setMode (Mode .valueOf (fieldSchemaPb .getMode ()));
480476 }
0 commit comments