@@ -53,150 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53
53
return this .unknownFields ;
54
54
}
55
55
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
-
200
56
public static final com .google .protobuf .Descriptors .Descriptor getDescriptor () {
201
57
return com .google .cloud .automl .v1 .AnnotationPayloadOuterClass
202
58
.internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor ;
@@ -671,7 +527,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
671
527
if (detailCase_ == 7 ) {
672
528
output .writeMessage (7 , (com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ );
673
529
}
674
- unknownFields .writeTo (output );
530
+ getUnknownFields () .writeTo (output );
675
531
}
676
532
677
533
@ java .lang .Override
@@ -711,7 +567,7 @@ public int getSerializedSize() {
711
567
com .google .protobuf .CodedOutputStream .computeMessageSize (
712
568
7 , (com .google .cloud .automl .v1 .TextSentimentAnnotation ) detail_ );
713
569
}
714
- size += unknownFields .getSerializedSize ();
570
+ size += getUnknownFields () .getSerializedSize ();
715
571
memoizedSize = size ;
716
572
return size ;
717
573
}
@@ -749,7 +605,7 @@ public boolean equals(final java.lang.Object obj) {
749
605
case 0 :
750
606
default :
751
607
}
752
- if (!unknownFields .equals (other .unknownFields )) return false ;
608
+ if (!getUnknownFields () .equals (other .getUnknownFields () )) return false ;
753
609
return true ;
754
610
}
755
611
@@ -788,7 +644,7 @@ public int hashCode() {
788
644
case 0 :
789
645
default :
790
646
}
791
- hash = (29 * hash ) + unknownFields .hashCode ();
647
+ hash = (29 * hash ) + getUnknownFields () .hashCode ();
792
648
memoizedHashCode = hash ;
793
649
return hash ;
794
650
}
@@ -917,22 +773,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
917
773
}
918
774
919
775
// Construct using com.google.cloud.automl.v1.AnnotationPayload.newBuilder()
920
- private Builder () {
921
- maybeForceBuilderInitialization ();
922
- }
776
+ private Builder () {}
923
777
924
778
private Builder (com .google .protobuf .GeneratedMessageV3 .BuilderParent parent ) {
925
779
super (parent );
926
- maybeForceBuilderInitialization ();
927
- }
928
-
929
- private void maybeForceBuilderInitialization () {
930
- if (com .google .protobuf .GeneratedMessageV3 .alwaysUseFieldBuilders ) {}
931
780
}
932
781
933
782
@ java .lang .Override
934
783
public Builder clear () {
935
784
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
+ }
936
800
annotationSpecId_ = "" ;
937
801
938
802
displayName_ = "" ;
@@ -1092,7 +956,7 @@ public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other) {
1092
956
break ;
1093
957
}
1094
958
}
1095
- this .mergeUnknownFields (other .unknownFields );
959
+ this .mergeUnknownFields (other .getUnknownFields () );
1096
960
onChanged ();
1097
961
return this ;
1098
962
}
@@ -1107,17 +971,74 @@ public Builder mergeFrom(
1107
971
com .google .protobuf .CodedInputStream input ,
1108
972
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
1109
973
throws java .io .IOException {
1110
- com .google .cloud .automl .v1 .AnnotationPayload parsedMessage = null ;
974
+ if (extensionRegistry == null ) {
975
+ throw new java .lang .NullPointerException ();
976
+ }
1111
977
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)
1113
1037
} catch (com .google .protobuf .InvalidProtocolBufferException e ) {
1114
- parsedMessage = (com .google .cloud .automl .v1 .AnnotationPayload ) e .getUnfinishedMessage ();
1115
1038
throw e .unwrapIOException ();
1116
1039
} finally {
1117
- if (parsedMessage != null ) {
1118
- mergeFrom (parsedMessage );
1119
- }
1120
- }
1040
+ onChanged ();
1041
+ } // finally
1121
1042
return this ;
1122
1043
}
1123
1044
@@ -2482,7 +2403,18 @@ public AnnotationPayload parsePartialFrom(
2482
2403
com .google .protobuf .CodedInputStream input ,
2483
2404
com .google .protobuf .ExtensionRegistryLite extensionRegistry )
2484
2405
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 ();
2486
2418
}
2487
2419
};
2488
2420
0 commit comments