1717
1818import com .google .auto .value .AutoValue ;
1919import java .io .Serializable ;
20- import javax .annotation .Nullable ;
2120
2221/**
2322 * Google BigQuery DataFormatOptions. Configures the output format for data types returned from
@@ -45,11 +44,12 @@ public String toString() {
4544
4645 public abstract boolean useInt64Timestamp ();
4746
48- @ Nullable
4947 public abstract TimestampFormatOptions timestampFormatOptions ();
5048
5149 public static Builder newBuilder () {
52- return new AutoValue_DataFormatOptions .Builder ().useInt64Timestamp (false );
50+ return new AutoValue_DataFormatOptions .Builder ()
51+ .useInt64Timestamp (false )
52+ .timestampFormatOptions (TimestampFormatOptions .TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED );
5353 }
5454
5555 public abstract Builder toBuilder ();
@@ -62,27 +62,19 @@ public abstract static class Builder {
6262
6363 abstract TimestampFormatOptions timestampFormatOptions ();
6464
65- abstract DataFormatOptions autoBuild ();
66-
67- public DataFormatOptions build () {
68- if (timestampFormatOptions () == null ) {
69- timestampFormatOptions (TimestampFormatOptions .TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED );
70- }
71- return autoBuild ();
72- }
65+ public abstract DataFormatOptions build ();
7366 }
7467
7568 com .google .api .services .bigquery .model .DataFormatOptions toPb () {
7669 com .google .api .services .bigquery .model .DataFormatOptions request =
7770 new com .google .api .services .bigquery .model .DataFormatOptions ();
7871 request .setUseInt64Timestamp (useInt64Timestamp ());
79- if (timestampFormatOptions () != null ) {
80- request .setTimestampOutputFormat (timestampFormatOptions ().toString ());
81- }
72+ request .setTimestampOutputFormat (timestampFormatOptions ().toString ());
8273 return request ;
8374 }
8475
85- DataFormatOptions fromPb (com .google .api .services .bigquery .model .DataFormatOptions request ) {
76+ static DataFormatOptions fromPb (
77+ com .google .api .services .bigquery .model .DataFormatOptions request ) {
8678 AutoValue_DataFormatOptions .Builder builder = new AutoValue_DataFormatOptions .Builder ();
8779 if (request .getUseInt64Timestamp () != null ) {
8880 builder .useInt64Timestamp (request .getUseInt64Timestamp ());
0 commit comments