@@ -72,19 +72,15 @@ public static class Type implements Serializable {
72
72
73
73
private static final long serialVersionUID = 2841484762609576959L ;
74
74
75
- public enum Value {
76
- BYTES , STRING , INTEGER , FLOAT , BOOLEAN , TIMESTAMP , RECORD
77
- }
78
-
79
- private final Value value ;
75
+ private final LegacySQLTypeName value ;
80
76
private final List <Field > fields ;
81
77
82
- private Type (Value value ) {
78
+ private Type (LegacySQLTypeName value ) {
83
79
this .value = checkNotNull (value );
84
80
this .fields = null ;
85
81
}
86
82
87
- private Type (Value value , List <Field > fields ) {
83
+ private Type (LegacySQLTypeName value , List <Field > fields ) {
88
84
checkArgument (fields .size () > 0 , "Record must have at least one field" );
89
85
this .value = value ;
90
86
this .fields = fields ;
@@ -97,7 +93,7 @@ private Type(Value value, List<Field> fields) {
97
93
* Data Types</a>
98
94
*/
99
95
@ Deprecated
100
- public Value value () {
96
+ public LegacySQLTypeName value () {
101
97
return getValue ();
102
98
}
103
99
@@ -107,81 +103,81 @@ public Value value() {
107
103
* @see <a href="https://cloud.google.com/bigquery/preparing-data-for-bigquery#datatypes">
108
104
* Data Types</a>
109
105
*/
110
- public Value getValue () {
106
+ public LegacySQLTypeName getValue () {
111
107
return value ;
112
108
}
113
109
114
110
/**
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.
117
113
*/
118
114
@ Deprecated
119
115
public List <Field > fields () {
120
116
return getFields ();
121
117
}
122
118
123
119
/**
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.
126
122
*/
127
123
public List <Field > getFields () {
128
124
return fields ;
129
125
}
130
126
131
127
/**
132
- * Returns a {@link Value #BYTES} field value.
128
+ * Returns a {@link LegacySQLTypeName #BYTES} field value.
133
129
*/
134
130
public static Type bytes () {
135
- return new Type (Value .BYTES );
131
+ return new Type (LegacySQLTypeName .BYTES );
136
132
}
137
133
138
134
/**
139
- * Returns a {@link Value #STRING} field value.
135
+ * Returns a {@link LegacySQLTypeName #STRING} field value.
140
136
*/
141
137
public static Type string () {
142
- return new Type (Value .STRING );
138
+ return new Type (LegacySQLTypeName .STRING );
143
139
}
144
140
145
141
/**
146
- * Returns an {@link Value #INTEGER} field value.
142
+ * Returns an {@link LegacySQLTypeName #INTEGER} field value.
147
143
*/
148
144
public static Type integer () {
149
- return new Type (Value .INTEGER );
145
+ return new Type (LegacySQLTypeName .INTEGER );
150
146
}
151
147
152
148
/**
153
- * Returns a {@link Value #FLOAT} field value.
149
+ * Returns a {@link LegacySQLTypeName #FLOAT} field value.
154
150
*/
155
151
public static Type floatingPoint () {
156
- return new Type (Value .FLOAT );
152
+ return new Type (LegacySQLTypeName .FLOAT );
157
153
}
158
154
159
155
/**
160
- * Returns a {@link Value #BOOLEAN} field value.
156
+ * Returns a {@link LegacySQLTypeName #BOOLEAN} field value.
161
157
*/
162
158
public static Type bool () {
163
- return new Type (Value .BOOLEAN );
159
+ return new Type (LegacySQLTypeName .BOOLEAN );
164
160
}
165
161
166
162
/**
167
- * Returns a {@link Value #TIMESTAMP} field value.
163
+ * Returns a {@link LegacySQLTypeName #TIMESTAMP} field value.
168
164
*/
169
165
public static Type timestamp () {
170
- return new Type (Value .TIMESTAMP );
166
+ return new Type (LegacySQLTypeName .TIMESTAMP );
171
167
}
172
168
173
169
/**
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.
175
171
*/
176
172
public static Type record (Field ... fields ) {
177
- return new Type (Value .RECORD , ImmutableList .copyOf (fields ));
173
+ return new Type (LegacySQLTypeName .RECORD , ImmutableList .copyOf (fields ));
178
174
}
179
175
180
176
/**
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.
182
178
*/
183
179
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 )));
185
181
}
186
182
187
183
@ Override
@@ -389,17 +385,17 @@ public String getDescription() {
389
385
}
390
386
391
387
/**
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.
394
390
*/
395
391
@ Deprecated
396
392
public List <Field > fields () {
397
393
return getFields ();
398
394
}
399
395
400
396
/**
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.
403
399
*/
404
400
public List <Field > getFields () {
405
401
return type .getFields ();
@@ -474,7 +470,7 @@ public static Builder newBuilder(String name, Type type) {
474
470
static Field fromPb (TableFieldSchema fieldSchemaPb ) {
475
471
Builder fieldBuilder = new Builder ();
476
472
fieldBuilder .setName (fieldSchemaPb .getName ());
477
- Type . Value enumValue = Type . Value .valueOf (fieldSchemaPb .getType ());
473
+ LegacySQLTypeName enumValue = LegacySQLTypeName .valueOf (fieldSchemaPb .getType ());
478
474
if (fieldSchemaPb .getMode () != null ) {
479
475
fieldBuilder .setMode (Mode .valueOf (fieldSchemaPb .getMode ()));
480
476
}
0 commit comments