@@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
5252 return this .unknownFields ;
5353 }
5454
55- private AnalyzeEntitiesRequest (
56- com .google .protobuf .CodedInputStream input ,
57- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
58- throws com .google .protobuf .InvalidProtocolBufferException {
59- this ();
60- if (extensionRegistry == null ) {
61- throw new java .lang .NullPointerException ();
62- }
63- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
64- com .google .protobuf .UnknownFieldSet .newBuilder ();
65- try {
66- boolean done = false ;
67- while (!done ) {
68- int tag = input .readTag ();
69- switch (tag ) {
70- case 0 :
71- done = true ;
72- break ;
73- case 10 :
74- {
75- com .google .cloud .language .v1 .Document .Builder subBuilder = null ;
76- if (document_ != null ) {
77- subBuilder = document_ .toBuilder ();
78- }
79- document_ =
80- input .readMessage (
81- com .google .cloud .language .v1 .Document .parser (), extensionRegistry );
82- if (subBuilder != null ) {
83- subBuilder .mergeFrom (document_ );
84- document_ = subBuilder .buildPartial ();
85- }
86-
87- break ;
88- }
89- case 16 :
90- {
91- int rawValue = input .readEnum ();
92-
93- encodingType_ = rawValue ;
94- break ;
95- }
96- default :
97- {
98- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
99- done = true ;
100- }
101- break ;
102- }
103- }
104- }
105- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
106- throw e .setUnfinishedMessage (this );
107- } catch (com .google .protobuf .UninitializedMessageException e ) {
108- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
109- } catch (java .io .IOException e ) {
110- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
111- } finally {
112- this .unknownFields = unknownFields .build ();
113- makeExtensionsImmutable ();
114- }
115- }
116-
11755 public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
11856 return com .google .cloud .language .v1 .LanguageServiceProto
11957 .internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor ;
@@ -239,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
239177 if (encodingType_ != com .google .cloud .language .v1 .EncodingType .NONE .getNumber ()) {
240178 output .writeEnum (2 , encodingType_ );
241179 }
242- unknownFields .writeTo (output );
180+ getUnknownFields () .writeTo (output );
243181 }
244182
245183 @ java .lang .Override
@@ -254,7 +192,7 @@ public int getSerializedSize() {
254192 if (encodingType_ != com .google .cloud .language .v1 .EncodingType .NONE .getNumber ()) {
255193 size += com .google .protobuf .CodedOutputStream .computeEnumSize (2 , encodingType_ );
256194 }
257- size += unknownFields .getSerializedSize ();
195+ size += getUnknownFields () .getSerializedSize ();
258196 memoizedSize = size ;
259197 return size ;
260198 }
@@ -275,7 +213,7 @@ public boolean equals(final java.lang.Object obj) {
275213 if (!getDocument ().equals (other .getDocument ())) return false ;
276214 }
277215 if (encodingType_ != other .encodingType_ ) return false ;
278- if (!unknownFields .equals (other .unknownFields )) return false ;
216+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
279217 return true ;
280218 }
281219
@@ -292,7 +230,7 @@ public int hashCode() {
292230 }
293231 hash = (37 * hash ) + ENCODING_TYPE_FIELD_NUMBER ;
294232 hash = (53 * hash ) + encodingType_ ;
295- hash = (29 * hash ) + unknownFields .hashCode ();
233+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
296234 memoizedHashCode = hash ;
297235 return hash ;
298236 }
@@ -421,17 +359,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
421359 }
422360
423361 // Construct using com.google.cloud.language.v1.AnalyzeEntitiesRequest.newBuilder()
424- private Builder () {
425- maybeForceBuilderInitialization ();
426- }
362+ private Builder () {}
427363
428364 private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
429365 super (parent );
430- maybeForceBuilderInitialization ();
431- }
432-
433- private void maybeForceBuilderInitialization () {
434- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
435366 }
436367
437368 @ java .lang .Override
@@ -534,7 +465,7 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnalyzeEntitiesRequest oth
534465 if (other .encodingType_ != 0 ) {
535466 setEncodingTypeValue (other .getEncodingTypeValue ());
536467 }
537- this .mergeUnknownFields (other .unknownFields );
468+ this .mergeUnknownFields (other .getUnknownFields () );
538469 onChanged ();
539470 return this ;
540471 }
@@ -549,18 +480,43 @@ public Builder mergeFrom(
549480 com .google .protobuf .CodedInputStream input ,
550481 com .google .protobuf .ExtensionRegistryLite extensionRegistry )
551482 throws java .io .IOException {
552- com .google .cloud .language .v1 .AnalyzeEntitiesRequest parsedMessage = null ;
483+ if (extensionRegistry == null ) {
484+ throw new java .lang .NullPointerException ();
485+ }
553486 try {
554- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
487+ boolean done = false ;
488+ while (!done ) {
489+ int tag = input .readTag ();
490+ switch (tag ) {
491+ case 0 :
492+ done = true ;
493+ break ;
494+ case 10 :
495+ {
496+ input .readMessage (getDocumentFieldBuilder ().getBuilder (), extensionRegistry );
497+
498+ break ;
499+ } // case 10
500+ case 16 :
501+ {
502+ encodingType_ = input .readEnum ();
503+
504+ break ;
505+ } // case 16
506+ default :
507+ {
508+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
509+ done = true ; // was an endgroup tag
510+ }
511+ break ;
512+ } // default:
513+ } // switch (tag)
514+ } // while (!done)
555515 } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
556- parsedMessage =
557- (com .google .cloud .language .v1 .AnalyzeEntitiesRequest ) e .getUnfinishedMessage ();
558516 throw e .unwrapIOException ();
559517 } finally {
560- if (parsedMessage != null ) {
561- mergeFrom (parsedMessage );
562- }
563- }
518+ onChanged ();
519+ } // finally
564520 return this ;
565521 }
566522
@@ -890,7 +846,18 @@ public AnalyzeEntitiesRequest parsePartialFrom(
890846 com .google .protobuf .CodedInputStream input ,
891847 com .google .protobuf .ExtensionRegistryLite extensionRegistry )
892848 throws com .google .protobuf .InvalidProtocolBufferException {
893- return new AnalyzeEntitiesRequest (input , extensionRegistry );
849+ Builder builder = newBuilder ();
850+ try {
851+ builder .mergeFrom (input , extensionRegistry );
852+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
853+ throw e .setUnfinishedMessage (builder .buildPartial ());
854+ } catch (com .google .protobuf .UninitializedMessageException e ) {
855+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
856+ } catch (java .io .IOException e ) {
857+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
858+ .setUnfinishedMessage (builder .buildPartial ());
859+ }
860+ return builder .buildPartial ();
894861 }
895862 };
896863
0 commit comments