@@ -53,150 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
5353 return this .unknownFields ;
5454 }
5555
56- private AnnotationPayload (
57- com .google .protobuf .CodedInputStream input ,
58- com .google .protobuf .ExtensionRegistryLite extensionRegistry )
59- throws com .google .protobuf .InvalidProtocolBufferException {
60- this ();
61- if (extensionRegistry == null ) {
62- throw new java .lang .NullPointerException ();
63- }
64- com .google .protobuf .UnknownFieldSet .Builder unknownFields =
65- com .google .protobuf .UnknownFieldSet .newBuilder ();
66- try {
67- boolean done = false ;
68- while (!done ) {
69- int tag = input .readTag ();
70- switch (tag ) {
71- case 0 :
72- done = true ;
73- break ;
74- case 10 :
75- {
76- java .lang .String s = input .readStringRequireUtf8 ();
77-
78- annotationSpecId_ = s ;
79- break ;
80- }
81- case 18 :
82- {
83- com .google .cloud .automl .v1 .TranslationAnnotation .Builder subBuilder = null ;
84- if (detailCase_ == 2 ) {
85- subBuilder =
86- ((com .google .cloud .automl .v1 .TranslationAnnotation ) detail_ ).toBuilder ();
87- }
88- detail_ =
89- input .readMessage (
90- com .google .cloud .automl .v1 .TranslationAnnotation .parser (), extensionRegistry );
91- if (subBuilder != null ) {
92- subBuilder .mergeFrom ((com .google .cloud .automl .v1 .TranslationAnnotation ) detail_ );
93- detail_ = subBuilder .buildPartial ();
94- }
95- detailCase_ = 2 ;
96- break ;
97- }
98- case 26 :
99- {
100- com .google .cloud .automl .v1 .ClassificationAnnotation .Builder subBuilder = null ;
101- if (detailCase_ == 3 ) {
102- subBuilder =
103- ((com .google .cloud .automl .v1 .ClassificationAnnotation ) detail_ ).toBuilder ();
104- }
105- detail_ =
106- input .readMessage (
107- com .google .cloud .automl .v1 .ClassificationAnnotation .parser (),
108- extensionRegistry );
109- if (subBuilder != null ) {
110- subBuilder .mergeFrom ((com .google .cloud .automl .v1 .ClassificationAnnotation ) detail_ );
111- detail_ = subBuilder .buildPartial ();
112- }
113- detailCase_ = 3 ;
114- break ;
115- }
116- case 34 :
117- {
118- com .google .cloud .automl .v1 .ImageObjectDetectionAnnotation .Builder subBuilder = null ;
119- if (detailCase_ == 4 ) {
120- subBuilder =
121- ((com .google .cloud .automl .v1 .ImageObjectDetectionAnnotation ) detail_ )
122- .toBuilder ();
123- }
124- detail_ =
125- input .readMessage (
126- com .google .cloud .automl .v1 .ImageObjectDetectionAnnotation .parser (),
127- extensionRegistry );
128- if (subBuilder != null ) {
129- subBuilder .mergeFrom (
130- (com .google .cloud .automl .v1 .ImageObjectDetectionAnnotation ) detail_ );
131- detail_ = subBuilder .buildPartial ();
132- }
133- detailCase_ = 4 ;
134- break ;
135- }
136- case 42 :
137- {
138- java .lang .String s = input .readStringRequireUtf8 ();
139-
140- displayName_ = s ;
141- break ;
142- }
143- case 50 :
144- {
145- com .google .cloud .automl .v1 .TextExtractionAnnotation .Builder subBuilder = null ;
146- if (detailCase_ == 6 ) {
147- subBuilder =
148- ((com .google .cloud .automl .v1 .TextExtractionAnnotation ) detail_ ).toBuilder ();
149- }
150- detail_ =
151- input .readMessage (
152- com .google .cloud .automl .v1 .TextExtractionAnnotation .parser (),
153- extensionRegistry );
154- if (subBuilder != null ) {
155- subBuilder .mergeFrom ((com .google .cloud .automl .v1 .TextExtractionAnnotation ) detail_ );
156- detail_ = subBuilder .buildPartial ();
157- }
158- detailCase_ = 6 ;
159- break ;
160- }
161- case 58 :
162- {
163- com .google .cloud .automl .v1 .TextSentimentAnnotation .Builder subBuilder = null ;
164- if (detailCase_ == 7 ) {
165- subBuilder =
166- ((com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ ).toBuilder ();
167- }
168- detail_ =
169- input .readMessage (
170- com .google .cloud .automl .v1 .TextSentimentAnnotation .parser (),
171- extensionRegistry );
172- if (subBuilder != null ) {
173- subBuilder .mergeFrom ((com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ );
174- detail_ = subBuilder .buildPartial ();
175- }
176- detailCase_ = 7 ;
177- break ;
178- }
179- default :
180- {
181- if (!parseUnknownField (input , unknownFields , extensionRegistry , tag )) {
182- done = true ;
183- }
184- break ;
185- }
186- }
187- }
188- } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
189- throw e .setUnfinishedMessage (this );
190- } catch (com .google .protobuf .UninitializedMessageException e ) {
191- throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (this );
192- } catch (java .io .IOException e ) {
193- throw new com .google .protobuf .InvalidProtocolBufferException (e ).setUnfinishedMessage (this );
194- } finally {
195- this .unknownFields = unknownFields .build ();
196- makeExtensionsImmutable ();
197- }
198- }
199-
20056 public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
20157 return com .google .cloud .automl .v1 .AnnotationPayloadOuterClass
20258 .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor ;
@@ -671,7 +527,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
671527 if (detailCase_ == 7 ) {
672528 output .writeMessage (7 , (com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ );
673529 }
674- unknownFields .writeTo (output );
530+ getUnknownFields () .writeTo (output );
675531 }
676532
677533 @ java .lang .Override
@@ -711,7 +567,7 @@ public int getSerializedSize() {
711567 com .google .protobuf .CodedOutputStream .computeMessageSize (
712568 7 , (com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ );
713569 }
714- size += unknownFields .getSerializedSize ();
570+ size += getUnknownFields () .getSerializedSize ();
715571 memoizedSize = size ;
716572 return size ;
717573 }
@@ -749,7 +605,7 @@ public boolean equals(final java.lang.Object obj) {
749605 case 0 :
750606 default :
751607 }
752- if (!unknownFields .equals (other .unknownFields )) return false ;
608+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
753609 return true ;
754610 }
755611
@@ -788,7 +644,7 @@ public int hashCode() {
788644 case 0 :
789645 default :
790646 }
791- hash = (29 * hash ) + unknownFields .hashCode ();
647+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
792648 memoizedHashCode = hash ;
793649 return hash ;
794650 }
@@ -917,22 +773,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
917773 }
918774
919775 // Construct using com.google.cloud.automl.v1.AnnotationPayload.newBuilder()
920- private Builder () {
921- maybeForceBuilderInitialization ();
922- }
776+ private Builder () {}
923777
924778 private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
925779 super (parent );
926- maybeForceBuilderInitialization ();
927- }
928-
929- private void maybeForceBuilderInitialization () {
930- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
931780 }
932781
933782 @ java .lang .Override
934783 public Builder clear () {
935784 super .clear ();
785+ if (translationBuilder_ != null ) {
786+ translationBuilder_ .clear ();
787+ }
788+ if (classificationBuilder_ != null ) {
789+ classificationBuilder_ .clear ();
790+ }
791+ if (imageObjectDetectionBuilder_ != null ) {
792+ imageObjectDetectionBuilder_ .clear ();
793+ }
794+ if (textExtractionBuilder_ != null ) {
795+ textExtractionBuilder_ .clear ();
796+ }
797+ if (textSentimentBuilder_ != null ) {
798+ textSentimentBuilder_ .clear ();
799+ }
936800 annotationSpecId_ = "" ;
937801
938802 displayName_ = "" ;
@@ -1092,7 +956,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other) {
1092956 break ;
1093957 }
1094958 }
1095- this .mergeUnknownFields (other .unknownFields );
959+ this .mergeUnknownFields (other .getUnknownFields () );
1096960 onChanged ();
1097961 return this ;
1098962 }
@@ -1107,17 +971,74 @@ public Builder mergeFrom(
1107971 com .google .protobuf .CodedInputStream input ,
1108972 com .google .protobuf .ExtensionRegistryLite extensionRegistry )
1109973 throws java .io .IOException {
1110- com .google .cloud .automl .v1 .AnnotationPayload parsedMessage = null ;
974+ if (extensionRegistry == null ) {
975+ throw new java .lang .NullPointerException ();
976+ }
1111977 try {
1112- parsedMessage = PARSER .parsePartialFrom (input , extensionRegistry );
978+ boolean done = false ;
979+ while (!done ) {
980+ int tag = input .readTag ();
981+ switch (tag ) {
982+ case 0 :
983+ done = true ;
984+ break ;
985+ case 10 :
986+ {
987+ annotationSpecId_ = input .readStringRequireUtf8 ();
988+
989+ break ;
990+ } // case 10
991+ case 18 :
992+ {
993+ input .readMessage (getTranslationFieldBuilder ().getBuilder (), extensionRegistry );
994+ detailCase_ = 2 ;
995+ break ;
996+ } // case 18
997+ case 26 :
998+ {
999+ input .readMessage (getClassificationFieldBuilder ().getBuilder (), extensionRegistry );
1000+ detailCase_ = 3 ;
1001+ break ;
1002+ } // case 26
1003+ case 34 :
1004+ {
1005+ input .readMessage (
1006+ getImageObjectDetectionFieldBuilder ().getBuilder (), extensionRegistry );
1007+ detailCase_ = 4 ;
1008+ break ;
1009+ } // case 34
1010+ case 42 :
1011+ {
1012+ displayName_ = input .readStringRequireUtf8 ();
1013+
1014+ break ;
1015+ } // case 42
1016+ case 50 :
1017+ {
1018+ input .readMessage (getTextExtractionFieldBuilder ().getBuilder (), extensionRegistry );
1019+ detailCase_ = 6 ;
1020+ break ;
1021+ } // case 50
1022+ case 58 :
1023+ {
1024+ input .readMessage (getTextSentimentFieldBuilder ().getBuilder (), extensionRegistry );
1025+ detailCase_ = 7 ;
1026+ break ;
1027+ } // case 58
1028+ default :
1029+ {
1030+ if (!super .parseUnknownField (input , extensionRegistry , tag )) {
1031+ done = true ; // was an endgroup tag
1032+ }
1033+ break ;
1034+ } // default:
1035+ } // switch (tag)
1036+ } // while (!done)
11131037 } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
1114- parsedMessage = (com .google .cloud .automl .v1 .AnnotationPayload ) e .getUnfinishedMessage ();
11151038 throw e .unwrapIOException ();
11161039 } finally {
1117- if (parsedMessage != null ) {
1118- mergeFrom (parsedMessage );
1119- }
1120- }
1040+ onChanged ();
1041+ } // finally
11211042 return this ;
11221043 }
11231044
@@ -2482,7 +2403,18 @@ public AnnotationPayload parsePartialFrom(
24822403 com .google .protobuf .CodedInputStream input ,
24832404 com .google .protobuf .ExtensionRegistryLite extensionRegistry )
24842405 throws com .google .protobuf .InvalidProtocolBufferException {
2485- return new AnnotationPayload (input , extensionRegistry );
2406+ Builder builder = newBuilder ();
2407+ try {
2408+ builder .mergeFrom (input , extensionRegistry );
2409+ } catch (com .google .protobuf .InvalidProtocolBufferException e ) {
2410+ throw e .setUnfinishedMessage (builder .buildPartial ());
2411+ } catch (com .google .protobuf .UninitializedMessageException e ) {
2412+ throw e .asInvalidProtocolBufferException ().setUnfinishedMessage (builder .buildPartial ());
2413+ } catch (java .io .IOException e ) {
2414+ throw new com .google .protobuf .InvalidProtocolBufferException (e )
2415+ .setUnfinishedMessage (builder .buildPartial ());
2416+ }
2417+ return builder .buildPartial ();
24862418 }
24872419 };
24882420
0 commit comments