@@ -50,61 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
50
50
return this .unknownFields ;
51
51
}
52
52
53
- private BatchDocumentInputConfig (
54
- com .google .protobuf .CodedInputStream input ,
55
- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
56
- throws com .google .protobuf .InvalidProtocolBufferException {
57
- this ();
58
- if (extensionRegistry == null ) {
59
- throw new java .lang .NullPointerException ();
60
- }
61
- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
62
- com .google .protobuf .UnknownFieldSet .newBuilder ();
63
- try {
64
- boolean done = false ;
65
- while (!done ) {
66
- int tag = input .readTag ();
67
- switch (tag ) {
68
- case 0 :
69
- done = true ;
70
- break ;
71
- case 10 :
72
- {
73
- com .google .cloud .translate .v3 .GcsSource .Builder subBuilder = null ;
74
- if (sourceCase_ == 1 ) {
75
- subBuilder = ((com .google .cloud .translate .v3 .GcsSource ) source_ ).toBuilder ();
76
- }
77
- source_ =
78
- input .readMessage (
79
- com .google .cloud .translate .v3 .GcsSource .parser (), extensionRegistry );
80
- if (subBuilder != null ) {
81
- subBuilder .mergeFrom ((com .google .cloud .translate .v3 .GcsSource ) source_ );
82
- source_ = subBuilder .buildPartial ();
83
- }
84
- sourceCase_ = 1 ;
85
- break ;
86
- }
87
- default :
88
- {
89
- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
90
- done = true ;
91
- }
92
- break ;
93
- }
94
- }
95
- }
96
- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
97
- throw e .setUnfinishedMessage (this );
98
- } catch (com .google .protobuf .UninitializedMessageException e ) {
99
- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
100
- } catch (java .io .IOException e ) {
101
- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
102
- } finally {
103
- this .unknownFields = unknownFields .build ();
104
- makeExtensionsImmutable ();
105
- }
106
- }
107
-
108
53
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
109
54
return com .google .cloud .translate .v3 .TranslationServiceProto
110
55
.internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor ;
@@ -280,7 +225,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
280
225
if (sourceCase_ == 1 ) {
281
226
output .writeMessage (1 , (com .google .cloud .translate .v3 .GcsSource ) source_ );
282
227
}
283
- unknownFields .writeTo (output );
228
+ getUnknownFields () .writeTo (output );
284
229
}
285
230
286
231
@ java .lang .Override
@@ -294,7 +239,7 @@ public int getSerializedSize() {
294
239
com .google .protobuf .CodedOutputStream .computeMessageSize (
295
240
1 , (com .google .cloud .translate .v3 .GcsSource ) source_ );
296
241
}
297
- size += unknownFields .getSerializedSize ();
242
+ size += getUnknownFields () .getSerializedSize ();
298
243
memoizedSize = size ;
299
244
return size ;
300
245
}
@@ -318,7 +263,7 @@ public boolean equals(final java.lang.Object obj) {
318
263
case 0 :
319
264
default :
320
265
}
321
- if (!unknownFields .equals (other .unknownFields )) return false ;
266
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
322
267
return true ;
323
268
}
324
269
@@ -337,7 +282,7 @@ public int hashCode() {
337
282
case 0 :
338
283
default :
339
284
}
340
- hash = (29 * hash ) + unknownFields .hashCode ();
285
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
341
286
memoizedHashCode = hash ;
342
287
return hash ;
343
288
}
@@ -467,22 +412,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
467
412
}
468
413
469
414
// Construct using com.google.cloud.translate.v3.BatchDocumentInputConfig.newBuilder()
470
- private Builder () {
471
- maybeForceBuilderInitialization ();
472
- }
415
+ private Builder () {}
473
416
474
417
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
475
418
super (parent );
476
- maybeForceBuilderInitialization ();
477
- }
478
-
479
- private void maybeForceBuilderInitialization () {
480
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
481
419
}
482
420
483
421
@ java .lang .Override
484
422
public Builder clear () {
485
423
super .clear ();
424
+ if (gcsSourceBuilder_ != null ) {
425
+ gcsSourceBuilder_ .clear ();
426
+ }
486
427
sourceCase_ = 0 ;
487
428
source_ = null ;
488
429
return this ;
@@ -581,7 +522,7 @@ public Builder mergeFrom(com.google.cloud.translate.v3.BatchDocumentInputConfig
581
522
break ;
582
523
}
583
524
}
584
- this .mergeUnknownFields (other .unknownFields );
525
+ this .mergeUnknownFields (other .getUnknownFields () );
585
526
onChanged ();
586
527
return this ;
587
528
}
@@ -596,18 +537,37 @@ public Builder mergeFrom(
596
537
com .google .protobuf .CodedInputStream input ,
597
538
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
598
539
throws java .io .IOException {
599
- com .google .cloud .translate .v3 .BatchDocumentInputConfig parsedMessage = null ;
540
+ if (extensionRegistry == null ) {
541
+ throw new java .lang .NullPointerException ();
542
+ }
600
543
try {
601
- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
544
+ boolean done = false ;
545
+ while (!done ) {
546
+ int tag = input .readTag ();
547
+ switch (tag ) {
548
+ case 0 :
549
+ done = true ;
550
+ break ;
551
+ case 10 :
552
+ {
553
+ input .readMessage (getGcsSourceFieldBuilder ().getBuilder (), extensionRegistry );
554
+ sourceCase_ = 1 ;
555
+ break ;
556
+ } // case 10
557
+ default :
558
+ {
559
+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
560
+ done = true ; // was an endgroup tag
561
+ }
562
+ break ;
563
+ } // default:
564
+ } // switch (tag)
565
+ } // while (!done)
602
566
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
603
- parsedMessage =
604
- (com .google .cloud .translate .v3 .BatchDocumentInputConfig ) e .getUnfinishedMessage ();
605
567
throw e .unwrapIOException ();
606
568
} finally {
607
- if (parsedMessage != null ) {
608
- mergeFrom (parsedMessage );
609
- }
610
- }
569
+ onChanged ();
570
+ } // finally
611
571
return this ;
612
572
}
613
573
@@ -1010,7 +970,18 @@ public BatchDocumentInputConfig parsePartialFrom(
1010
970
com .google .protobuf .CodedInputStream input ,
1011
971
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
1012
972
throws com .google .protobuf .InvalidProtocolBufferException {
1013
- return new BatchDocumentInputConfig (input , extensionRegistry );
973
+ Builder builder = newBuilder ();
974
+ try {
975
+ builder .mergeFrom (input , extensionRegistry );
976
+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
977
+ throw e .setUnfinishedMessage (builder .buildPartial ());
978
+ } catch (com .google .protobuf .UninitializedMessageException e ) {
979
+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
980
+ } catch (java .io .IOException e ) {
981
+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
982
+ .setUnfinishedMessage (builder .buildPartial ());
983
+ }
984
+ return builder .buildPartial ();
1014
985
}
1015
986
};
1016
987
0 commit comments