@@ -51,68 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
51
51
return this .unknownFields ;
52
52
}
53
53
54
- private StreamingTranslateSpeechConfig (
55
- com .google .protobuf .CodedInputStream input ,
56
- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
57
- throws com .google .protobuf .InvalidProtocolBufferException {
58
- this ();
59
- if (extensionRegistry == null ) {
60
- throw new java .lang .NullPointerException ();
61
- }
62
- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
63
- com .google .protobuf .UnknownFieldSet .newBuilder ();
64
- try {
65
- boolean done = false ;
66
- while (!done ) {
67
- int tag = input .readTag ();
68
- switch (tag ) {
69
- case 0 :
70
- done = true ;
71
- break ;
72
- case 10 :
73
- {
74
- com .google .cloud .mediatranslation .v1beta1 .TranslateSpeechConfig .Builder subBuilder =
75
- null ;
76
- if (audioConfig_ != null ) {
77
- subBuilder = audioConfig_ .toBuilder ();
78
- }
79
- audioConfig_ =
80
- input .readMessage (
81
- com .google .cloud .mediatranslation .v1beta1 .TranslateSpeechConfig .parser (),
82
- extensionRegistry );
83
- if (subBuilder != null ) {
84
- subBuilder .mergeFrom (audioConfig_ );
85
- audioConfig_ = subBuilder .buildPartial ();
86
- }
87
-
88
- break ;
89
- }
90
- case 16 :
91
- {
92
- singleUtterance_ = input .readBool ();
93
- break ;
94
- }
95
- default :
96
- {
97
- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
98
- done = true ;
99
- }
100
- break ;
101
- }
102
- }
103
- }
104
- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
105
- throw e .setUnfinishedMessage (this );
106
- } catch (com .google .protobuf .UninitializedMessageException e ) {
107
- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
108
- } catch (java .io .IOException e ) {
109
- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
110
- } finally {
111
- this .unknownFields = unknownFields .build ();
112
- makeExtensionsImmutable ();
113
- }
114
- }
115
-
116
54
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
117
55
return com .google .cloud .mediatranslation .v1beta1 .MediaTranslationProto
118
56
.internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechConfig_descriptor ;
@@ -233,7 +171,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
233
171
if (singleUtterance_ != false ) {
234
172
output .writeBool (2 , singleUtterance_ );
235
173
}
236
- unknownFields .writeTo (output );
174
+ getUnknownFields () .writeTo (output );
237
175
}
238
176
239
177
@ java .lang .Override
@@ -248,7 +186,7 @@ public int getSerializedSize() {
248
186
if (singleUtterance_ != false ) {
249
187
size += com .google .protobuf .CodedOutputStream .computeBoolSize (2 , singleUtterance_ );
250
188
}
251
- size += unknownFields .getSerializedSize ();
189
+ size += getUnknownFields () .getSerializedSize ();
252
190
memoizedSize = size ;
253
191
return size ;
254
192
}
@@ -270,7 +208,7 @@ public boolean equals(final java.lang.Object obj) {
270
208
if (!getAudioConfig ().equals (other .getAudioConfig ())) return false ;
271
209
}
272
210
if (getSingleUtterance () != other .getSingleUtterance ()) return false ;
273
- if (!unknownFields .equals (other .unknownFields )) return false ;
211
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
274
212
return true ;
275
213
}
276
214
@@ -287,7 +225,7 @@ public int hashCode() {
287
225
}
288
226
hash = (37 * hash ) + SINGLE_UTTERANCE_FIELD_NUMBER ;
289
227
hash = (53 * hash ) + com .google .protobuf .Internal .hashBoolean (getSingleUtterance ());
290
- hash = (29 * hash ) + unknownFields .hashCode ();
228
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
291
229
memoizedHashCode = hash ;
292
230
return hash ;
293
231
}
@@ -420,17 +358,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
420
358
421
359
// Construct using
422
360
// com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.newBuilder()
423
- private Builder () {
424
- maybeForceBuilderInitialization ();
425
- }
361
+ private Builder () {}
426
362
427
363
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
428
364
super (parent );
429
- maybeForceBuilderInitialization ();
430
- }
431
-
432
- private void maybeForceBuilderInitialization () {
433
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
434
365
}
435
366
436
367
@ java .lang .Override
@@ -540,7 +471,7 @@ public Builder mergeFrom(
540
471
if (other .getSingleUtterance () != false ) {
541
472
setSingleUtterance (other .getSingleUtterance ());
542
473
}
543
- this .mergeUnknownFields (other .unknownFields );
474
+ this .mergeUnknownFields (other .getUnknownFields () );
544
475
onChanged ();
545
476
return this ;
546
477
}
@@ -555,19 +486,43 @@ public Builder mergeFrom(
555
486
com .google .protobuf .CodedInputStream input ,
556
487
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
557
488
throws java .io .IOException {
558
- com .google .cloud .mediatranslation .v1beta1 .StreamingTranslateSpeechConfig parsedMessage = null ;
489
+ if (extensionRegistry == null ) {
490
+ throw new java .lang .NullPointerException ();
491
+ }
559
492
try {
560
- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
493
+ boolean done = false ;
494
+ while (!done ) {
495
+ int tag = input .readTag ();
496
+ switch (tag ) {
497
+ case 0 :
498
+ done = true ;
499
+ break ;
500
+ case 10 :
501
+ {
502
+ input .readMessage (getAudioConfigFieldBuilder ().getBuilder (), extensionRegistry );
503
+
504
+ break ;
505
+ } // case 10
506
+ case 16 :
507
+ {
508
+ singleUtterance_ = input .readBool ();
509
+
510
+ break ;
511
+ } // case 16
512
+ default :
513
+ {
514
+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
515
+ done = true ; // was an endgroup tag
516
+ }
517
+ break ;
518
+ } // default:
519
+ } // switch (tag)
520
+ } // while (!done)
561
521
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
562
- parsedMessage =
563
- (com .google .cloud .mediatranslation .v1beta1 .StreamingTranslateSpeechConfig )
564
- e .getUnfinishedMessage ();
565
522
throw e .unwrapIOException ();
566
523
} finally {
567
- if (parsedMessage != null ) {
568
- mergeFrom (parsedMessage );
569
- }
570
- }
524
+ onChanged ();
525
+ } // finally
571
526
return this ;
572
527
}
573
528
@@ -903,7 +858,18 @@ public StreamingTranslateSpeechConfig parsePartialFrom(
903
858
com .google .protobuf .CodedInputStream input ,
904
859
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
905
860
throws com .google .protobuf .InvalidProtocolBufferException {
906
- return new StreamingTranslateSpeechConfig (input , extensionRegistry );
861
+ Builder builder = newBuilder ();
862
+ try {
863
+ builder .mergeFrom (input , extensionRegistry );
864
+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
865
+ throw e .setUnfinishedMessage (builder .buildPartial ());
866
+ } catch (com .google .protobuf .UninitializedMessageException e ) {
867
+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
868
+ } catch (java .io .IOException e ) {
869
+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
870
+ .setUnfinishedMessage (builder .buildPartial ());
871
+ }
872
+ return builder .buildPartial ();
907
873
}
908
874
};
909
875
0 commit comments