• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/automl/v1/annotation_payload.proto
18 
19 package com.google.cloud.automl.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Contains annotation information that is relevant to AutoML.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.automl.v1.AnnotationPayload}
29  */
30 public final class AnnotationPayload extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.AnnotationPayload)
33     AnnotationPayloadOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use AnnotationPayload.newBuilder() to construct.
AnnotationPayload(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private AnnotationPayload(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
AnnotationPayload()40   private AnnotationPayload() {
41     annotationSpecId_ = "";
42     displayName_ = "";
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new AnnotationPayload();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
getDescriptor()56   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
57     return com.google.cloud.automl.v1.AnnotationPayloadOuterClass
58         .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.automl.v1.AnnotationPayloadOuterClass
65         .internal_static_google_cloud_automl_v1_AnnotationPayload_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.automl.v1.AnnotationPayload.class,
68             com.google.cloud.automl.v1.AnnotationPayload.Builder.class);
69   }
70 
71   private int detailCase_ = 0;
72   private java.lang.Object detail_;
73 
74   public enum DetailCase
75       implements
76           com.google.protobuf.Internal.EnumLite,
77           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
78     TRANSLATION(2),
79     CLASSIFICATION(3),
80     IMAGE_OBJECT_DETECTION(4),
81     TEXT_EXTRACTION(6),
82     TEXT_SENTIMENT(7),
83     DETAIL_NOT_SET(0);
84     private final int value;
85 
DetailCase(int value)86     private DetailCase(int value) {
87       this.value = value;
88     }
89     /**
90      * @param value The number of the enum to look for.
91      * @return The enum associated with the given number.
92      * @deprecated Use {@link #forNumber(int)} instead.
93      */
94     @java.lang.Deprecated
valueOf(int value)95     public static DetailCase valueOf(int value) {
96       return forNumber(value);
97     }
98 
forNumber(int value)99     public static DetailCase forNumber(int value) {
100       switch (value) {
101         case 2:
102           return TRANSLATION;
103         case 3:
104           return CLASSIFICATION;
105         case 4:
106           return IMAGE_OBJECT_DETECTION;
107         case 6:
108           return TEXT_EXTRACTION;
109         case 7:
110           return TEXT_SENTIMENT;
111         case 0:
112           return DETAIL_NOT_SET;
113         default:
114           return null;
115       }
116     }
117 
getNumber()118     public int getNumber() {
119       return this.value;
120     }
121   };
122 
getDetailCase()123   public DetailCase getDetailCase() {
124     return DetailCase.forNumber(detailCase_);
125   }
126 
127   public static final int TRANSLATION_FIELD_NUMBER = 2;
128   /**
129    *
130    *
131    * <pre>
132    * Annotation details for translation.
133    * </pre>
134    *
135    * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
136    *
137    * @return Whether the translation field is set.
138    */
139   @java.lang.Override
hasTranslation()140   public boolean hasTranslation() {
141     return detailCase_ == 2;
142   }
143   /**
144    *
145    *
146    * <pre>
147    * Annotation details for translation.
148    * </pre>
149    *
150    * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
151    *
152    * @return The translation.
153    */
154   @java.lang.Override
getTranslation()155   public com.google.cloud.automl.v1.TranslationAnnotation getTranslation() {
156     if (detailCase_ == 2) {
157       return (com.google.cloud.automl.v1.TranslationAnnotation) detail_;
158     }
159     return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
160   }
161   /**
162    *
163    *
164    * <pre>
165    * Annotation details for translation.
166    * </pre>
167    *
168    * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
169    */
170   @java.lang.Override
getTranslationOrBuilder()171   public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder() {
172     if (detailCase_ == 2) {
173       return (com.google.cloud.automl.v1.TranslationAnnotation) detail_;
174     }
175     return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
176   }
177 
178   public static final int CLASSIFICATION_FIELD_NUMBER = 3;
179   /**
180    *
181    *
182    * <pre>
183    * Annotation details for content or image classification.
184    * </pre>
185    *
186    * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
187    *
188    * @return Whether the classification field is set.
189    */
190   @java.lang.Override
hasClassification()191   public boolean hasClassification() {
192     return detailCase_ == 3;
193   }
194   /**
195    *
196    *
197    * <pre>
198    * Annotation details for content or image classification.
199    * </pre>
200    *
201    * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
202    *
203    * @return The classification.
204    */
205   @java.lang.Override
getClassification()206   public com.google.cloud.automl.v1.ClassificationAnnotation getClassification() {
207     if (detailCase_ == 3) {
208       return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_;
209     }
210     return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
211   }
212   /**
213    *
214    *
215    * <pre>
216    * Annotation details for content or image classification.
217    * </pre>
218    *
219    * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
220    */
221   @java.lang.Override
getClassificationOrBuilder()222   public com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder getClassificationOrBuilder() {
223     if (detailCase_ == 3) {
224       return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_;
225     }
226     return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
227   }
228 
229   public static final int IMAGE_OBJECT_DETECTION_FIELD_NUMBER = 4;
230   /**
231    *
232    *
233    * <pre>
234    * Annotation details for image object detection.
235    * </pre>
236    *
237    * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;</code>
238    *
239    * @return Whether the imageObjectDetection field is set.
240    */
241   @java.lang.Override
hasImageObjectDetection()242   public boolean hasImageObjectDetection() {
243     return detailCase_ == 4;
244   }
245   /**
246    *
247    *
248    * <pre>
249    * Annotation details for image object detection.
250    * </pre>
251    *
252    * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;</code>
253    *
254    * @return The imageObjectDetection.
255    */
256   @java.lang.Override
getImageObjectDetection()257   public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getImageObjectDetection() {
258     if (detailCase_ == 4) {
259       return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_;
260     }
261     return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
262   }
263   /**
264    *
265    *
266    * <pre>
267    * Annotation details for image object detection.
268    * </pre>
269    *
270    * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;</code>
271    */
272   @java.lang.Override
273   public com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder
getImageObjectDetectionOrBuilder()274       getImageObjectDetectionOrBuilder() {
275     if (detailCase_ == 4) {
276       return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_;
277     }
278     return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
279   }
280 
281   public static final int TEXT_EXTRACTION_FIELD_NUMBER = 6;
282   /**
283    *
284    *
285    * <pre>
286    * Annotation details for text extraction.
287    * </pre>
288    *
289    * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
290    *
291    * @return Whether the textExtraction field is set.
292    */
293   @java.lang.Override
hasTextExtraction()294   public boolean hasTextExtraction() {
295     return detailCase_ == 6;
296   }
297   /**
298    *
299    *
300    * <pre>
301    * Annotation details for text extraction.
302    * </pre>
303    *
304    * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
305    *
306    * @return The textExtraction.
307    */
308   @java.lang.Override
getTextExtraction()309   public com.google.cloud.automl.v1.TextExtractionAnnotation getTextExtraction() {
310     if (detailCase_ == 6) {
311       return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_;
312     }
313     return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
314   }
315   /**
316    *
317    *
318    * <pre>
319    * Annotation details for text extraction.
320    * </pre>
321    *
322    * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
323    */
324   @java.lang.Override
getTextExtractionOrBuilder()325   public com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder getTextExtractionOrBuilder() {
326     if (detailCase_ == 6) {
327       return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_;
328     }
329     return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
330   }
331 
332   public static final int TEXT_SENTIMENT_FIELD_NUMBER = 7;
333   /**
334    *
335    *
336    * <pre>
337    * Annotation details for text sentiment.
338    * </pre>
339    *
340    * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
341    *
342    * @return Whether the textSentiment field is set.
343    */
344   @java.lang.Override
hasTextSentiment()345   public boolean hasTextSentiment() {
346     return detailCase_ == 7;
347   }
348   /**
349    *
350    *
351    * <pre>
352    * Annotation details for text sentiment.
353    * </pre>
354    *
355    * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
356    *
357    * @return The textSentiment.
358    */
359   @java.lang.Override
getTextSentiment()360   public com.google.cloud.automl.v1.TextSentimentAnnotation getTextSentiment() {
361     if (detailCase_ == 7) {
362       return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_;
363     }
364     return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
365   }
366   /**
367    *
368    *
369    * <pre>
370    * Annotation details for text sentiment.
371    * </pre>
372    *
373    * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
374    */
375   @java.lang.Override
getTextSentimentOrBuilder()376   public com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder getTextSentimentOrBuilder() {
377     if (detailCase_ == 7) {
378       return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_;
379     }
380     return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
381   }
382 
383   public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1;
384 
385   @SuppressWarnings("serial")
386   private volatile java.lang.Object annotationSpecId_ = "";
387   /**
388    *
389    *
390    * <pre>
391    * Output only . The resource ID of the annotation spec that
392    * this annotation pertains to. The annotation spec comes from either an
393    * ancestor dataset, or the dataset that was used to train the model in use.
394    * </pre>
395    *
396    * <code>string annotation_spec_id = 1;</code>
397    *
398    * @return The annotationSpecId.
399    */
400   @java.lang.Override
getAnnotationSpecId()401   public java.lang.String getAnnotationSpecId() {
402     java.lang.Object ref = annotationSpecId_;
403     if (ref instanceof java.lang.String) {
404       return (java.lang.String) ref;
405     } else {
406       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
407       java.lang.String s = bs.toStringUtf8();
408       annotationSpecId_ = s;
409       return s;
410     }
411   }
412   /**
413    *
414    *
415    * <pre>
416    * Output only . The resource ID of the annotation spec that
417    * this annotation pertains to. The annotation spec comes from either an
418    * ancestor dataset, or the dataset that was used to train the model in use.
419    * </pre>
420    *
421    * <code>string annotation_spec_id = 1;</code>
422    *
423    * @return The bytes for annotationSpecId.
424    */
425   @java.lang.Override
getAnnotationSpecIdBytes()426   public com.google.protobuf.ByteString getAnnotationSpecIdBytes() {
427     java.lang.Object ref = annotationSpecId_;
428     if (ref instanceof java.lang.String) {
429       com.google.protobuf.ByteString b =
430           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
431       annotationSpecId_ = b;
432       return b;
433     } else {
434       return (com.google.protobuf.ByteString) ref;
435     }
436   }
437 
438   public static final int DISPLAY_NAME_FIELD_NUMBER = 5;
439 
440   @SuppressWarnings("serial")
441   private volatile java.lang.Object displayName_ = "";
442   /**
443    *
444    *
445    * <pre>
446    * Output only. The value of
447    * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
448    * when the model was trained. Because this field returns a value at model
449    * training time, for different models trained using the same dataset, the
450    * returned value could be different as model owner could update the
451    * `display_name` between any two model training.
452    * </pre>
453    *
454    * <code>string display_name = 5;</code>
455    *
456    * @return The displayName.
457    */
458   @java.lang.Override
getDisplayName()459   public java.lang.String getDisplayName() {
460     java.lang.Object ref = displayName_;
461     if (ref instanceof java.lang.String) {
462       return (java.lang.String) ref;
463     } else {
464       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
465       java.lang.String s = bs.toStringUtf8();
466       displayName_ = s;
467       return s;
468     }
469   }
470   /**
471    *
472    *
473    * <pre>
474    * Output only. The value of
475    * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
476    * when the model was trained. Because this field returns a value at model
477    * training time, for different models trained using the same dataset, the
478    * returned value could be different as model owner could update the
479    * `display_name` between any two model training.
480    * </pre>
481    *
482    * <code>string display_name = 5;</code>
483    *
484    * @return The bytes for displayName.
485    */
486   @java.lang.Override
getDisplayNameBytes()487   public com.google.protobuf.ByteString getDisplayNameBytes() {
488     java.lang.Object ref = displayName_;
489     if (ref instanceof java.lang.String) {
490       com.google.protobuf.ByteString b =
491           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
492       displayName_ = b;
493       return b;
494     } else {
495       return (com.google.protobuf.ByteString) ref;
496     }
497   }
498 
499   private byte memoizedIsInitialized = -1;
500 
501   @java.lang.Override
isInitialized()502   public final boolean isInitialized() {
503     byte isInitialized = memoizedIsInitialized;
504     if (isInitialized == 1) return true;
505     if (isInitialized == 0) return false;
506 
507     memoizedIsInitialized = 1;
508     return true;
509   }
510 
511   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)512   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
513     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(annotationSpecId_)) {
514       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_);
515     }
516     if (detailCase_ == 2) {
517       output.writeMessage(2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_);
518     }
519     if (detailCase_ == 3) {
520       output.writeMessage(3, (com.google.cloud.automl.v1.ClassificationAnnotation) detail_);
521     }
522     if (detailCase_ == 4) {
523       output.writeMessage(4, (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_);
524     }
525     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
526       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_);
527     }
528     if (detailCase_ == 6) {
529       output.writeMessage(6, (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_);
530     }
531     if (detailCase_ == 7) {
532       output.writeMessage(7, (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_);
533     }
534     getUnknownFields().writeTo(output);
535   }
536 
537   @java.lang.Override
getSerializedSize()538   public int getSerializedSize() {
539     int size = memoizedSize;
540     if (size != -1) return size;
541 
542     size = 0;
543     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(annotationSpecId_)) {
544       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, annotationSpecId_);
545     }
546     if (detailCase_ == 2) {
547       size +=
548           com.google.protobuf.CodedOutputStream.computeMessageSize(
549               2, (com.google.cloud.automl.v1.TranslationAnnotation) detail_);
550     }
551     if (detailCase_ == 3) {
552       size +=
553           com.google.protobuf.CodedOutputStream.computeMessageSize(
554               3, (com.google.cloud.automl.v1.ClassificationAnnotation) detail_);
555     }
556     if (detailCase_ == 4) {
557       size +=
558           com.google.protobuf.CodedOutputStream.computeMessageSize(
559               4, (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_);
560     }
561     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
562       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_);
563     }
564     if (detailCase_ == 6) {
565       size +=
566           com.google.protobuf.CodedOutputStream.computeMessageSize(
567               6, (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_);
568     }
569     if (detailCase_ == 7) {
570       size +=
571           com.google.protobuf.CodedOutputStream.computeMessageSize(
572               7, (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_);
573     }
574     size += getUnknownFields().getSerializedSize();
575     memoizedSize = size;
576     return size;
577   }
578 
579   @java.lang.Override
equals(final java.lang.Object obj)580   public boolean equals(final java.lang.Object obj) {
581     if (obj == this) {
582       return true;
583     }
584     if (!(obj instanceof com.google.cloud.automl.v1.AnnotationPayload)) {
585       return super.equals(obj);
586     }
587     com.google.cloud.automl.v1.AnnotationPayload other =
588         (com.google.cloud.automl.v1.AnnotationPayload) obj;
589 
590     if (!getAnnotationSpecId().equals(other.getAnnotationSpecId())) return false;
591     if (!getDisplayName().equals(other.getDisplayName())) return false;
592     if (!getDetailCase().equals(other.getDetailCase())) return false;
593     switch (detailCase_) {
594       case 2:
595         if (!getTranslation().equals(other.getTranslation())) return false;
596         break;
597       case 3:
598         if (!getClassification().equals(other.getClassification())) return false;
599         break;
600       case 4:
601         if (!getImageObjectDetection().equals(other.getImageObjectDetection())) return false;
602         break;
603       case 6:
604         if (!getTextExtraction().equals(other.getTextExtraction())) return false;
605         break;
606       case 7:
607         if (!getTextSentiment().equals(other.getTextSentiment())) return false;
608         break;
609       case 0:
610       default:
611     }
612     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
613     return true;
614   }
615 
616   @java.lang.Override
hashCode()617   public int hashCode() {
618     if (memoizedHashCode != 0) {
619       return memoizedHashCode;
620     }
621     int hash = 41;
622     hash = (19 * hash) + getDescriptor().hashCode();
623     hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER;
624     hash = (53 * hash) + getAnnotationSpecId().hashCode();
625     hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
626     hash = (53 * hash) + getDisplayName().hashCode();
627     switch (detailCase_) {
628       case 2:
629         hash = (37 * hash) + TRANSLATION_FIELD_NUMBER;
630         hash = (53 * hash) + getTranslation().hashCode();
631         break;
632       case 3:
633         hash = (37 * hash) + CLASSIFICATION_FIELD_NUMBER;
634         hash = (53 * hash) + getClassification().hashCode();
635         break;
636       case 4:
637         hash = (37 * hash) + IMAGE_OBJECT_DETECTION_FIELD_NUMBER;
638         hash = (53 * hash) + getImageObjectDetection().hashCode();
639         break;
640       case 6:
641         hash = (37 * hash) + TEXT_EXTRACTION_FIELD_NUMBER;
642         hash = (53 * hash) + getTextExtraction().hashCode();
643         break;
644       case 7:
645         hash = (37 * hash) + TEXT_SENTIMENT_FIELD_NUMBER;
646         hash = (53 * hash) + getTextSentiment().hashCode();
647         break;
648       case 0:
649       default:
650     }
651     hash = (29 * hash) + getUnknownFields().hashCode();
652     memoizedHashCode = hash;
653     return hash;
654   }
655 
parseFrom(java.nio.ByteBuffer data)656   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(java.nio.ByteBuffer data)
657       throws com.google.protobuf.InvalidProtocolBufferException {
658     return PARSER.parseFrom(data);
659   }
660 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)661   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
662       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
663       throws com.google.protobuf.InvalidProtocolBufferException {
664     return PARSER.parseFrom(data, extensionRegistry);
665   }
666 
parseFrom( com.google.protobuf.ByteString data)667   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
668       com.google.protobuf.ByteString data)
669       throws com.google.protobuf.InvalidProtocolBufferException {
670     return PARSER.parseFrom(data);
671   }
672 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)673   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
674       com.google.protobuf.ByteString data,
675       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
676       throws com.google.protobuf.InvalidProtocolBufferException {
677     return PARSER.parseFrom(data, extensionRegistry);
678   }
679 
parseFrom(byte[] data)680   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(byte[] data)
681       throws com.google.protobuf.InvalidProtocolBufferException {
682     return PARSER.parseFrom(data);
683   }
684 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)685   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
686       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
687       throws com.google.protobuf.InvalidProtocolBufferException {
688     return PARSER.parseFrom(data, extensionRegistry);
689   }
690 
parseFrom(java.io.InputStream input)691   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(java.io.InputStream input)
692       throws java.io.IOException {
693     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
694   }
695 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)696   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
697       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
698       throws java.io.IOException {
699     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
700         PARSER, input, extensionRegistry);
701   }
702 
parseDelimitedFrom( java.io.InputStream input)703   public static com.google.cloud.automl.v1.AnnotationPayload parseDelimitedFrom(
704       java.io.InputStream input) throws java.io.IOException {
705     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
706   }
707 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)708   public static com.google.cloud.automl.v1.AnnotationPayload parseDelimitedFrom(
709       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
710       throws java.io.IOException {
711     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
712         PARSER, input, extensionRegistry);
713   }
714 
parseFrom( com.google.protobuf.CodedInputStream input)715   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
716       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
717     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
718   }
719 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)720   public static com.google.cloud.automl.v1.AnnotationPayload parseFrom(
721       com.google.protobuf.CodedInputStream input,
722       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
723       throws java.io.IOException {
724     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
725         PARSER, input, extensionRegistry);
726   }
727 
728   @java.lang.Override
newBuilderForType()729   public Builder newBuilderForType() {
730     return newBuilder();
731   }
732 
newBuilder()733   public static Builder newBuilder() {
734     return DEFAULT_INSTANCE.toBuilder();
735   }
736 
newBuilder(com.google.cloud.automl.v1.AnnotationPayload prototype)737   public static Builder newBuilder(com.google.cloud.automl.v1.AnnotationPayload prototype) {
738     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
739   }
740 
741   @java.lang.Override
toBuilder()742   public Builder toBuilder() {
743     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
744   }
745 
746   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)747   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
748     Builder builder = new Builder(parent);
749     return builder;
750   }
751   /**
752    *
753    *
754    * <pre>
755    * Contains annotation information that is relevant to AutoML.
756    * </pre>
757    *
758    * Protobuf type {@code google.cloud.automl.v1.AnnotationPayload}
759    */
760   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
761       implements
762       // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.AnnotationPayload)
763       com.google.cloud.automl.v1.AnnotationPayloadOrBuilder {
getDescriptor()764     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
765       return com.google.cloud.automl.v1.AnnotationPayloadOuterClass
766           .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor;
767     }
768 
769     @java.lang.Override
770     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()771         internalGetFieldAccessorTable() {
772       return com.google.cloud.automl.v1.AnnotationPayloadOuterClass
773           .internal_static_google_cloud_automl_v1_AnnotationPayload_fieldAccessorTable
774           .ensureFieldAccessorsInitialized(
775               com.google.cloud.automl.v1.AnnotationPayload.class,
776               com.google.cloud.automl.v1.AnnotationPayload.Builder.class);
777     }
778 
779     // Construct using com.google.cloud.automl.v1.AnnotationPayload.newBuilder()
Builder()780     private Builder() {}
781 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)782     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
783       super(parent);
784     }
785 
786     @java.lang.Override
clear()787     public Builder clear() {
788       super.clear();
789       bitField0_ = 0;
790       if (translationBuilder_ != null) {
791         translationBuilder_.clear();
792       }
793       if (classificationBuilder_ != null) {
794         classificationBuilder_.clear();
795       }
796       if (imageObjectDetectionBuilder_ != null) {
797         imageObjectDetectionBuilder_.clear();
798       }
799       if (textExtractionBuilder_ != null) {
800         textExtractionBuilder_.clear();
801       }
802       if (textSentimentBuilder_ != null) {
803         textSentimentBuilder_.clear();
804       }
805       annotationSpecId_ = "";
806       displayName_ = "";
807       detailCase_ = 0;
808       detail_ = null;
809       return this;
810     }
811 
812     @java.lang.Override
getDescriptorForType()813     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
814       return com.google.cloud.automl.v1.AnnotationPayloadOuterClass
815           .internal_static_google_cloud_automl_v1_AnnotationPayload_descriptor;
816     }
817 
818     @java.lang.Override
getDefaultInstanceForType()819     public com.google.cloud.automl.v1.AnnotationPayload getDefaultInstanceForType() {
820       return com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance();
821     }
822 
823     @java.lang.Override
build()824     public com.google.cloud.automl.v1.AnnotationPayload build() {
825       com.google.cloud.automl.v1.AnnotationPayload result = buildPartial();
826       if (!result.isInitialized()) {
827         throw newUninitializedMessageException(result);
828       }
829       return result;
830     }
831 
832     @java.lang.Override
buildPartial()833     public com.google.cloud.automl.v1.AnnotationPayload buildPartial() {
834       com.google.cloud.automl.v1.AnnotationPayload result =
835           new com.google.cloud.automl.v1.AnnotationPayload(this);
836       if (bitField0_ != 0) {
837         buildPartial0(result);
838       }
839       buildPartialOneofs(result);
840       onBuilt();
841       return result;
842     }
843 
buildPartial0(com.google.cloud.automl.v1.AnnotationPayload result)844     private void buildPartial0(com.google.cloud.automl.v1.AnnotationPayload result) {
845       int from_bitField0_ = bitField0_;
846       if (((from_bitField0_ & 0x00000020) != 0)) {
847         result.annotationSpecId_ = annotationSpecId_;
848       }
849       if (((from_bitField0_ & 0x00000040) != 0)) {
850         result.displayName_ = displayName_;
851       }
852     }
853 
buildPartialOneofs(com.google.cloud.automl.v1.AnnotationPayload result)854     private void buildPartialOneofs(com.google.cloud.automl.v1.AnnotationPayload result) {
855       result.detailCase_ = detailCase_;
856       result.detail_ = this.detail_;
857       if (detailCase_ == 2 && translationBuilder_ != null) {
858         result.detail_ = translationBuilder_.build();
859       }
860       if (detailCase_ == 3 && classificationBuilder_ != null) {
861         result.detail_ = classificationBuilder_.build();
862       }
863       if (detailCase_ == 4 && imageObjectDetectionBuilder_ != null) {
864         result.detail_ = imageObjectDetectionBuilder_.build();
865       }
866       if (detailCase_ == 6 && textExtractionBuilder_ != null) {
867         result.detail_ = textExtractionBuilder_.build();
868       }
869       if (detailCase_ == 7 && textSentimentBuilder_ != null) {
870         result.detail_ = textSentimentBuilder_.build();
871       }
872     }
873 
874     @java.lang.Override
clone()875     public Builder clone() {
876       return super.clone();
877     }
878 
879     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)880     public Builder setField(
881         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
882       return super.setField(field, value);
883     }
884 
885     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)886     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
887       return super.clearField(field);
888     }
889 
890     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)891     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
892       return super.clearOneof(oneof);
893     }
894 
895     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)896     public Builder setRepeatedField(
897         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
898       return super.setRepeatedField(field, index, value);
899     }
900 
901     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)902     public Builder addRepeatedField(
903         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
904       return super.addRepeatedField(field, value);
905     }
906 
907     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)908     public Builder mergeFrom(com.google.protobuf.Message other) {
909       if (other instanceof com.google.cloud.automl.v1.AnnotationPayload) {
910         return mergeFrom((com.google.cloud.automl.v1.AnnotationPayload) other);
911       } else {
912         super.mergeFrom(other);
913         return this;
914       }
915     }
916 
mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other)917     public Builder mergeFrom(com.google.cloud.automl.v1.AnnotationPayload other) {
918       if (other == com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance()) return this;
919       if (!other.getAnnotationSpecId().isEmpty()) {
920         annotationSpecId_ = other.annotationSpecId_;
921         bitField0_ |= 0x00000020;
922         onChanged();
923       }
924       if (!other.getDisplayName().isEmpty()) {
925         displayName_ = other.displayName_;
926         bitField0_ |= 0x00000040;
927         onChanged();
928       }
929       switch (other.getDetailCase()) {
930         case TRANSLATION:
931           {
932             mergeTranslation(other.getTranslation());
933             break;
934           }
935         case CLASSIFICATION:
936           {
937             mergeClassification(other.getClassification());
938             break;
939           }
940         case IMAGE_OBJECT_DETECTION:
941           {
942             mergeImageObjectDetection(other.getImageObjectDetection());
943             break;
944           }
945         case TEXT_EXTRACTION:
946           {
947             mergeTextExtraction(other.getTextExtraction());
948             break;
949           }
950         case TEXT_SENTIMENT:
951           {
952             mergeTextSentiment(other.getTextSentiment());
953             break;
954           }
955         case DETAIL_NOT_SET:
956           {
957             break;
958           }
959       }
960       this.mergeUnknownFields(other.getUnknownFields());
961       onChanged();
962       return this;
963     }
964 
965     @java.lang.Override
isInitialized()966     public final boolean isInitialized() {
967       return true;
968     }
969 
970     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)971     public Builder mergeFrom(
972         com.google.protobuf.CodedInputStream input,
973         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
974         throws java.io.IOException {
975       if (extensionRegistry == null) {
976         throw new java.lang.NullPointerException();
977       }
978       try {
979         boolean done = false;
980         while (!done) {
981           int tag = input.readTag();
982           switch (tag) {
983             case 0:
984               done = true;
985               break;
986             case 10:
987               {
988                 annotationSpecId_ = input.readStringRequireUtf8();
989                 bitField0_ |= 0x00000020;
990                 break;
991               } // case 10
992             case 18:
993               {
994                 input.readMessage(getTranslationFieldBuilder().getBuilder(), extensionRegistry);
995                 detailCase_ = 2;
996                 break;
997               } // case 18
998             case 26:
999               {
1000                 input.readMessage(getClassificationFieldBuilder().getBuilder(), extensionRegistry);
1001                 detailCase_ = 3;
1002                 break;
1003               } // case 26
1004             case 34:
1005               {
1006                 input.readMessage(
1007                     getImageObjectDetectionFieldBuilder().getBuilder(), extensionRegistry);
1008                 detailCase_ = 4;
1009                 break;
1010               } // case 34
1011             case 42:
1012               {
1013                 displayName_ = input.readStringRequireUtf8();
1014                 bitField0_ |= 0x00000040;
1015                 break;
1016               } // case 42
1017             case 50:
1018               {
1019                 input.readMessage(getTextExtractionFieldBuilder().getBuilder(), extensionRegistry);
1020                 detailCase_ = 6;
1021                 break;
1022               } // case 50
1023             case 58:
1024               {
1025                 input.readMessage(getTextSentimentFieldBuilder().getBuilder(), extensionRegistry);
1026                 detailCase_ = 7;
1027                 break;
1028               } // case 58
1029             default:
1030               {
1031                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1032                   done = true; // was an endgroup tag
1033                 }
1034                 break;
1035               } // default:
1036           } // switch (tag)
1037         } // while (!done)
1038       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1039         throw e.unwrapIOException();
1040       } finally {
1041         onChanged();
1042       } // finally
1043       return this;
1044     }
1045 
1046     private int detailCase_ = 0;
1047     private java.lang.Object detail_;
1048 
getDetailCase()1049     public DetailCase getDetailCase() {
1050       return DetailCase.forNumber(detailCase_);
1051     }
1052 
clearDetail()1053     public Builder clearDetail() {
1054       detailCase_ = 0;
1055       detail_ = null;
1056       onChanged();
1057       return this;
1058     }
1059 
1060     private int bitField0_;
1061 
1062     private com.google.protobuf.SingleFieldBuilderV3<
1063             com.google.cloud.automl.v1.TranslationAnnotation,
1064             com.google.cloud.automl.v1.TranslationAnnotation.Builder,
1065             com.google.cloud.automl.v1.TranslationAnnotationOrBuilder>
1066         translationBuilder_;
1067     /**
1068      *
1069      *
1070      * <pre>
1071      * Annotation details for translation.
1072      * </pre>
1073      *
1074      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1075      *
1076      * @return Whether the translation field is set.
1077      */
1078     @java.lang.Override
hasTranslation()1079     public boolean hasTranslation() {
1080       return detailCase_ == 2;
1081     }
1082     /**
1083      *
1084      *
1085      * <pre>
1086      * Annotation details for translation.
1087      * </pre>
1088      *
1089      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1090      *
1091      * @return The translation.
1092      */
1093     @java.lang.Override
getTranslation()1094     public com.google.cloud.automl.v1.TranslationAnnotation getTranslation() {
1095       if (translationBuilder_ == null) {
1096         if (detailCase_ == 2) {
1097           return (com.google.cloud.automl.v1.TranslationAnnotation) detail_;
1098         }
1099         return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
1100       } else {
1101         if (detailCase_ == 2) {
1102           return translationBuilder_.getMessage();
1103         }
1104         return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
1105       }
1106     }
1107     /**
1108      *
1109      *
1110      * <pre>
1111      * Annotation details for translation.
1112      * </pre>
1113      *
1114      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1115      */
setTranslation(com.google.cloud.automl.v1.TranslationAnnotation value)1116     public Builder setTranslation(com.google.cloud.automl.v1.TranslationAnnotation value) {
1117       if (translationBuilder_ == null) {
1118         if (value == null) {
1119           throw new NullPointerException();
1120         }
1121         detail_ = value;
1122         onChanged();
1123       } else {
1124         translationBuilder_.setMessage(value);
1125       }
1126       detailCase_ = 2;
1127       return this;
1128     }
1129     /**
1130      *
1131      *
1132      * <pre>
1133      * Annotation details for translation.
1134      * </pre>
1135      *
1136      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1137      */
setTranslation( com.google.cloud.automl.v1.TranslationAnnotation.Builder builderForValue)1138     public Builder setTranslation(
1139         com.google.cloud.automl.v1.TranslationAnnotation.Builder builderForValue) {
1140       if (translationBuilder_ == null) {
1141         detail_ = builderForValue.build();
1142         onChanged();
1143       } else {
1144         translationBuilder_.setMessage(builderForValue.build());
1145       }
1146       detailCase_ = 2;
1147       return this;
1148     }
1149     /**
1150      *
1151      *
1152      * <pre>
1153      * Annotation details for translation.
1154      * </pre>
1155      *
1156      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1157      */
mergeTranslation(com.google.cloud.automl.v1.TranslationAnnotation value)1158     public Builder mergeTranslation(com.google.cloud.automl.v1.TranslationAnnotation value) {
1159       if (translationBuilder_ == null) {
1160         if (detailCase_ == 2
1161             && detail_ != com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance()) {
1162           detail_ =
1163               com.google.cloud.automl.v1.TranslationAnnotation.newBuilder(
1164                       (com.google.cloud.automl.v1.TranslationAnnotation) detail_)
1165                   .mergeFrom(value)
1166                   .buildPartial();
1167         } else {
1168           detail_ = value;
1169         }
1170         onChanged();
1171       } else {
1172         if (detailCase_ == 2) {
1173           translationBuilder_.mergeFrom(value);
1174         } else {
1175           translationBuilder_.setMessage(value);
1176         }
1177       }
1178       detailCase_ = 2;
1179       return this;
1180     }
1181     /**
1182      *
1183      *
1184      * <pre>
1185      * Annotation details for translation.
1186      * </pre>
1187      *
1188      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1189      */
clearTranslation()1190     public Builder clearTranslation() {
1191       if (translationBuilder_ == null) {
1192         if (detailCase_ == 2) {
1193           detailCase_ = 0;
1194           detail_ = null;
1195           onChanged();
1196         }
1197       } else {
1198         if (detailCase_ == 2) {
1199           detailCase_ = 0;
1200           detail_ = null;
1201         }
1202         translationBuilder_.clear();
1203       }
1204       return this;
1205     }
1206     /**
1207      *
1208      *
1209      * <pre>
1210      * Annotation details for translation.
1211      * </pre>
1212      *
1213      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1214      */
getTranslationBuilder()1215     public com.google.cloud.automl.v1.TranslationAnnotation.Builder getTranslationBuilder() {
1216       return getTranslationFieldBuilder().getBuilder();
1217     }
1218     /**
1219      *
1220      *
1221      * <pre>
1222      * Annotation details for translation.
1223      * </pre>
1224      *
1225      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1226      */
1227     @java.lang.Override
getTranslationOrBuilder()1228     public com.google.cloud.automl.v1.TranslationAnnotationOrBuilder getTranslationOrBuilder() {
1229       if ((detailCase_ == 2) && (translationBuilder_ != null)) {
1230         return translationBuilder_.getMessageOrBuilder();
1231       } else {
1232         if (detailCase_ == 2) {
1233           return (com.google.cloud.automl.v1.TranslationAnnotation) detail_;
1234         }
1235         return com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
1236       }
1237     }
1238     /**
1239      *
1240      *
1241      * <pre>
1242      * Annotation details for translation.
1243      * </pre>
1244      *
1245      * <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
1246      */
1247     private com.google.protobuf.SingleFieldBuilderV3<
1248             com.google.cloud.automl.v1.TranslationAnnotation,
1249             com.google.cloud.automl.v1.TranslationAnnotation.Builder,
1250             com.google.cloud.automl.v1.TranslationAnnotationOrBuilder>
getTranslationFieldBuilder()1251         getTranslationFieldBuilder() {
1252       if (translationBuilder_ == null) {
1253         if (!(detailCase_ == 2)) {
1254           detail_ = com.google.cloud.automl.v1.TranslationAnnotation.getDefaultInstance();
1255         }
1256         translationBuilder_ =
1257             new com.google.protobuf.SingleFieldBuilderV3<
1258                 com.google.cloud.automl.v1.TranslationAnnotation,
1259                 com.google.cloud.automl.v1.TranslationAnnotation.Builder,
1260                 com.google.cloud.automl.v1.TranslationAnnotationOrBuilder>(
1261                 (com.google.cloud.automl.v1.TranslationAnnotation) detail_,
1262                 getParentForChildren(),
1263                 isClean());
1264         detail_ = null;
1265       }
1266       detailCase_ = 2;
1267       onChanged();
1268       return translationBuilder_;
1269     }
1270 
1271     private com.google.protobuf.SingleFieldBuilderV3<
1272             com.google.cloud.automl.v1.ClassificationAnnotation,
1273             com.google.cloud.automl.v1.ClassificationAnnotation.Builder,
1274             com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder>
1275         classificationBuilder_;
1276     /**
1277      *
1278      *
1279      * <pre>
1280      * Annotation details for content or image classification.
1281      * </pre>
1282      *
1283      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1284      *
1285      * @return Whether the classification field is set.
1286      */
1287     @java.lang.Override
hasClassification()1288     public boolean hasClassification() {
1289       return detailCase_ == 3;
1290     }
1291     /**
1292      *
1293      *
1294      * <pre>
1295      * Annotation details for content or image classification.
1296      * </pre>
1297      *
1298      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1299      *
1300      * @return The classification.
1301      */
1302     @java.lang.Override
getClassification()1303     public com.google.cloud.automl.v1.ClassificationAnnotation getClassification() {
1304       if (classificationBuilder_ == null) {
1305         if (detailCase_ == 3) {
1306           return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_;
1307         }
1308         return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
1309       } else {
1310         if (detailCase_ == 3) {
1311           return classificationBuilder_.getMessage();
1312         }
1313         return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
1314       }
1315     }
1316     /**
1317      *
1318      *
1319      * <pre>
1320      * Annotation details for content or image classification.
1321      * </pre>
1322      *
1323      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1324      */
setClassification(com.google.cloud.automl.v1.ClassificationAnnotation value)1325     public Builder setClassification(com.google.cloud.automl.v1.ClassificationAnnotation value) {
1326       if (classificationBuilder_ == null) {
1327         if (value == null) {
1328           throw new NullPointerException();
1329         }
1330         detail_ = value;
1331         onChanged();
1332       } else {
1333         classificationBuilder_.setMessage(value);
1334       }
1335       detailCase_ = 3;
1336       return this;
1337     }
1338     /**
1339      *
1340      *
1341      * <pre>
1342      * Annotation details for content or image classification.
1343      * </pre>
1344      *
1345      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1346      */
setClassification( com.google.cloud.automl.v1.ClassificationAnnotation.Builder builderForValue)1347     public Builder setClassification(
1348         com.google.cloud.automl.v1.ClassificationAnnotation.Builder builderForValue) {
1349       if (classificationBuilder_ == null) {
1350         detail_ = builderForValue.build();
1351         onChanged();
1352       } else {
1353         classificationBuilder_.setMessage(builderForValue.build());
1354       }
1355       detailCase_ = 3;
1356       return this;
1357     }
1358     /**
1359      *
1360      *
1361      * <pre>
1362      * Annotation details for content or image classification.
1363      * </pre>
1364      *
1365      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1366      */
mergeClassification(com.google.cloud.automl.v1.ClassificationAnnotation value)1367     public Builder mergeClassification(com.google.cloud.automl.v1.ClassificationAnnotation value) {
1368       if (classificationBuilder_ == null) {
1369         if (detailCase_ == 3
1370             && detail_
1371                 != com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance()) {
1372           detail_ =
1373               com.google.cloud.automl.v1.ClassificationAnnotation.newBuilder(
1374                       (com.google.cloud.automl.v1.ClassificationAnnotation) detail_)
1375                   .mergeFrom(value)
1376                   .buildPartial();
1377         } else {
1378           detail_ = value;
1379         }
1380         onChanged();
1381       } else {
1382         if (detailCase_ == 3) {
1383           classificationBuilder_.mergeFrom(value);
1384         } else {
1385           classificationBuilder_.setMessage(value);
1386         }
1387       }
1388       detailCase_ = 3;
1389       return this;
1390     }
1391     /**
1392      *
1393      *
1394      * <pre>
1395      * Annotation details for content or image classification.
1396      * </pre>
1397      *
1398      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1399      */
clearClassification()1400     public Builder clearClassification() {
1401       if (classificationBuilder_ == null) {
1402         if (detailCase_ == 3) {
1403           detailCase_ = 0;
1404           detail_ = null;
1405           onChanged();
1406         }
1407       } else {
1408         if (detailCase_ == 3) {
1409           detailCase_ = 0;
1410           detail_ = null;
1411         }
1412         classificationBuilder_.clear();
1413       }
1414       return this;
1415     }
1416     /**
1417      *
1418      *
1419      * <pre>
1420      * Annotation details for content or image classification.
1421      * </pre>
1422      *
1423      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1424      */
getClassificationBuilder()1425     public com.google.cloud.automl.v1.ClassificationAnnotation.Builder getClassificationBuilder() {
1426       return getClassificationFieldBuilder().getBuilder();
1427     }
1428     /**
1429      *
1430      *
1431      * <pre>
1432      * Annotation details for content or image classification.
1433      * </pre>
1434      *
1435      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1436      */
1437     @java.lang.Override
1438     public com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder
getClassificationOrBuilder()1439         getClassificationOrBuilder() {
1440       if ((detailCase_ == 3) && (classificationBuilder_ != null)) {
1441         return classificationBuilder_.getMessageOrBuilder();
1442       } else {
1443         if (detailCase_ == 3) {
1444           return (com.google.cloud.automl.v1.ClassificationAnnotation) detail_;
1445         }
1446         return com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
1447       }
1448     }
1449     /**
1450      *
1451      *
1452      * <pre>
1453      * Annotation details for content or image classification.
1454      * </pre>
1455      *
1456      * <code>.google.cloud.automl.v1.ClassificationAnnotation classification = 3;</code>
1457      */
1458     private com.google.protobuf.SingleFieldBuilderV3<
1459             com.google.cloud.automl.v1.ClassificationAnnotation,
1460             com.google.cloud.automl.v1.ClassificationAnnotation.Builder,
1461             com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder>
getClassificationFieldBuilder()1462         getClassificationFieldBuilder() {
1463       if (classificationBuilder_ == null) {
1464         if (!(detailCase_ == 3)) {
1465           detail_ = com.google.cloud.automl.v1.ClassificationAnnotation.getDefaultInstance();
1466         }
1467         classificationBuilder_ =
1468             new com.google.protobuf.SingleFieldBuilderV3<
1469                 com.google.cloud.automl.v1.ClassificationAnnotation,
1470                 com.google.cloud.automl.v1.ClassificationAnnotation.Builder,
1471                 com.google.cloud.automl.v1.ClassificationAnnotationOrBuilder>(
1472                 (com.google.cloud.automl.v1.ClassificationAnnotation) detail_,
1473                 getParentForChildren(),
1474                 isClean());
1475         detail_ = null;
1476       }
1477       detailCase_ = 3;
1478       onChanged();
1479       return classificationBuilder_;
1480     }
1481 
1482     private com.google.protobuf.SingleFieldBuilderV3<
1483             com.google.cloud.automl.v1.ImageObjectDetectionAnnotation,
1484             com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder,
1485             com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder>
1486         imageObjectDetectionBuilder_;
1487     /**
1488      *
1489      *
1490      * <pre>
1491      * Annotation details for image object detection.
1492      * </pre>
1493      *
1494      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1495      * </code>
1496      *
1497      * @return Whether the imageObjectDetection field is set.
1498      */
1499     @java.lang.Override
hasImageObjectDetection()1500     public boolean hasImageObjectDetection() {
1501       return detailCase_ == 4;
1502     }
1503     /**
1504      *
1505      *
1506      * <pre>
1507      * Annotation details for image object detection.
1508      * </pre>
1509      *
1510      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1511      * </code>
1512      *
1513      * @return The imageObjectDetection.
1514      */
1515     @java.lang.Override
getImageObjectDetection()1516     public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation getImageObjectDetection() {
1517       if (imageObjectDetectionBuilder_ == null) {
1518         if (detailCase_ == 4) {
1519           return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_;
1520         }
1521         return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
1522       } else {
1523         if (detailCase_ == 4) {
1524           return imageObjectDetectionBuilder_.getMessage();
1525         }
1526         return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
1527       }
1528     }
1529     /**
1530      *
1531      *
1532      * <pre>
1533      * Annotation details for image object detection.
1534      * </pre>
1535      *
1536      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1537      * </code>
1538      */
setImageObjectDetection( com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value)1539     public Builder setImageObjectDetection(
1540         com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value) {
1541       if (imageObjectDetectionBuilder_ == null) {
1542         if (value == null) {
1543           throw new NullPointerException();
1544         }
1545         detail_ = value;
1546         onChanged();
1547       } else {
1548         imageObjectDetectionBuilder_.setMessage(value);
1549       }
1550       detailCase_ = 4;
1551       return this;
1552     }
1553     /**
1554      *
1555      *
1556      * <pre>
1557      * Annotation details for image object detection.
1558      * </pre>
1559      *
1560      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1561      * </code>
1562      */
setImageObjectDetection( com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder builderForValue)1563     public Builder setImageObjectDetection(
1564         com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder builderForValue) {
1565       if (imageObjectDetectionBuilder_ == null) {
1566         detail_ = builderForValue.build();
1567         onChanged();
1568       } else {
1569         imageObjectDetectionBuilder_.setMessage(builderForValue.build());
1570       }
1571       detailCase_ = 4;
1572       return this;
1573     }
1574     /**
1575      *
1576      *
1577      * <pre>
1578      * Annotation details for image object detection.
1579      * </pre>
1580      *
1581      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1582      * </code>
1583      */
mergeImageObjectDetection( com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value)1584     public Builder mergeImageObjectDetection(
1585         com.google.cloud.automl.v1.ImageObjectDetectionAnnotation value) {
1586       if (imageObjectDetectionBuilder_ == null) {
1587         if (detailCase_ == 4
1588             && detail_
1589                 != com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance()) {
1590           detail_ =
1591               com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.newBuilder(
1592                       (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_)
1593                   .mergeFrom(value)
1594                   .buildPartial();
1595         } else {
1596           detail_ = value;
1597         }
1598         onChanged();
1599       } else {
1600         if (detailCase_ == 4) {
1601           imageObjectDetectionBuilder_.mergeFrom(value);
1602         } else {
1603           imageObjectDetectionBuilder_.setMessage(value);
1604         }
1605       }
1606       detailCase_ = 4;
1607       return this;
1608     }
1609     /**
1610      *
1611      *
1612      * <pre>
1613      * Annotation details for image object detection.
1614      * </pre>
1615      *
1616      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1617      * </code>
1618      */
clearImageObjectDetection()1619     public Builder clearImageObjectDetection() {
1620       if (imageObjectDetectionBuilder_ == null) {
1621         if (detailCase_ == 4) {
1622           detailCase_ = 0;
1623           detail_ = null;
1624           onChanged();
1625         }
1626       } else {
1627         if (detailCase_ == 4) {
1628           detailCase_ = 0;
1629           detail_ = null;
1630         }
1631         imageObjectDetectionBuilder_.clear();
1632       }
1633       return this;
1634     }
1635     /**
1636      *
1637      *
1638      * <pre>
1639      * Annotation details for image object detection.
1640      * </pre>
1641      *
1642      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1643      * </code>
1644      */
1645     public com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder
getImageObjectDetectionBuilder()1646         getImageObjectDetectionBuilder() {
1647       return getImageObjectDetectionFieldBuilder().getBuilder();
1648     }
1649     /**
1650      *
1651      *
1652      * <pre>
1653      * Annotation details for image object detection.
1654      * </pre>
1655      *
1656      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1657      * </code>
1658      */
1659     @java.lang.Override
1660     public com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder
getImageObjectDetectionOrBuilder()1661         getImageObjectDetectionOrBuilder() {
1662       if ((detailCase_ == 4) && (imageObjectDetectionBuilder_ != null)) {
1663         return imageObjectDetectionBuilder_.getMessageOrBuilder();
1664       } else {
1665         if (detailCase_ == 4) {
1666           return (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_;
1667         }
1668         return com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
1669       }
1670     }
1671     /**
1672      *
1673      *
1674      * <pre>
1675      * Annotation details for image object detection.
1676      * </pre>
1677      *
1678      * <code>.google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4;
1679      * </code>
1680      */
1681     private com.google.protobuf.SingleFieldBuilderV3<
1682             com.google.cloud.automl.v1.ImageObjectDetectionAnnotation,
1683             com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder,
1684             com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder>
getImageObjectDetectionFieldBuilder()1685         getImageObjectDetectionFieldBuilder() {
1686       if (imageObjectDetectionBuilder_ == null) {
1687         if (!(detailCase_ == 4)) {
1688           detail_ = com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.getDefaultInstance();
1689         }
1690         imageObjectDetectionBuilder_ =
1691             new com.google.protobuf.SingleFieldBuilderV3<
1692                 com.google.cloud.automl.v1.ImageObjectDetectionAnnotation,
1693                 com.google.cloud.automl.v1.ImageObjectDetectionAnnotation.Builder,
1694                 com.google.cloud.automl.v1.ImageObjectDetectionAnnotationOrBuilder>(
1695                 (com.google.cloud.automl.v1.ImageObjectDetectionAnnotation) detail_,
1696                 getParentForChildren(),
1697                 isClean());
1698         detail_ = null;
1699       }
1700       detailCase_ = 4;
1701       onChanged();
1702       return imageObjectDetectionBuilder_;
1703     }
1704 
1705     private com.google.protobuf.SingleFieldBuilderV3<
1706             com.google.cloud.automl.v1.TextExtractionAnnotation,
1707             com.google.cloud.automl.v1.TextExtractionAnnotation.Builder,
1708             com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder>
1709         textExtractionBuilder_;
1710     /**
1711      *
1712      *
1713      * <pre>
1714      * Annotation details for text extraction.
1715      * </pre>
1716      *
1717      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1718      *
1719      * @return Whether the textExtraction field is set.
1720      */
1721     @java.lang.Override
hasTextExtraction()1722     public boolean hasTextExtraction() {
1723       return detailCase_ == 6;
1724     }
1725     /**
1726      *
1727      *
1728      * <pre>
1729      * Annotation details for text extraction.
1730      * </pre>
1731      *
1732      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1733      *
1734      * @return The textExtraction.
1735      */
1736     @java.lang.Override
getTextExtraction()1737     public com.google.cloud.automl.v1.TextExtractionAnnotation getTextExtraction() {
1738       if (textExtractionBuilder_ == null) {
1739         if (detailCase_ == 6) {
1740           return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_;
1741         }
1742         return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
1743       } else {
1744         if (detailCase_ == 6) {
1745           return textExtractionBuilder_.getMessage();
1746         }
1747         return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
1748       }
1749     }
1750     /**
1751      *
1752      *
1753      * <pre>
1754      * Annotation details for text extraction.
1755      * </pre>
1756      *
1757      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1758      */
setTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value)1759     public Builder setTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value) {
1760       if (textExtractionBuilder_ == null) {
1761         if (value == null) {
1762           throw new NullPointerException();
1763         }
1764         detail_ = value;
1765         onChanged();
1766       } else {
1767         textExtractionBuilder_.setMessage(value);
1768       }
1769       detailCase_ = 6;
1770       return this;
1771     }
1772     /**
1773      *
1774      *
1775      * <pre>
1776      * Annotation details for text extraction.
1777      * </pre>
1778      *
1779      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1780      */
setTextExtraction( com.google.cloud.automl.v1.TextExtractionAnnotation.Builder builderForValue)1781     public Builder setTextExtraction(
1782         com.google.cloud.automl.v1.TextExtractionAnnotation.Builder builderForValue) {
1783       if (textExtractionBuilder_ == null) {
1784         detail_ = builderForValue.build();
1785         onChanged();
1786       } else {
1787         textExtractionBuilder_.setMessage(builderForValue.build());
1788       }
1789       detailCase_ = 6;
1790       return this;
1791     }
1792     /**
1793      *
1794      *
1795      * <pre>
1796      * Annotation details for text extraction.
1797      * </pre>
1798      *
1799      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1800      */
mergeTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value)1801     public Builder mergeTextExtraction(com.google.cloud.automl.v1.TextExtractionAnnotation value) {
1802       if (textExtractionBuilder_ == null) {
1803         if (detailCase_ == 6
1804             && detail_
1805                 != com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance()) {
1806           detail_ =
1807               com.google.cloud.automl.v1.TextExtractionAnnotation.newBuilder(
1808                       (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_)
1809                   .mergeFrom(value)
1810                   .buildPartial();
1811         } else {
1812           detail_ = value;
1813         }
1814         onChanged();
1815       } else {
1816         if (detailCase_ == 6) {
1817           textExtractionBuilder_.mergeFrom(value);
1818         } else {
1819           textExtractionBuilder_.setMessage(value);
1820         }
1821       }
1822       detailCase_ = 6;
1823       return this;
1824     }
1825     /**
1826      *
1827      *
1828      * <pre>
1829      * Annotation details for text extraction.
1830      * </pre>
1831      *
1832      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1833      */
clearTextExtraction()1834     public Builder clearTextExtraction() {
1835       if (textExtractionBuilder_ == null) {
1836         if (detailCase_ == 6) {
1837           detailCase_ = 0;
1838           detail_ = null;
1839           onChanged();
1840         }
1841       } else {
1842         if (detailCase_ == 6) {
1843           detailCase_ = 0;
1844           detail_ = null;
1845         }
1846         textExtractionBuilder_.clear();
1847       }
1848       return this;
1849     }
1850     /**
1851      *
1852      *
1853      * <pre>
1854      * Annotation details for text extraction.
1855      * </pre>
1856      *
1857      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1858      */
getTextExtractionBuilder()1859     public com.google.cloud.automl.v1.TextExtractionAnnotation.Builder getTextExtractionBuilder() {
1860       return getTextExtractionFieldBuilder().getBuilder();
1861     }
1862     /**
1863      *
1864      *
1865      * <pre>
1866      * Annotation details for text extraction.
1867      * </pre>
1868      *
1869      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1870      */
1871     @java.lang.Override
1872     public com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder
getTextExtractionOrBuilder()1873         getTextExtractionOrBuilder() {
1874       if ((detailCase_ == 6) && (textExtractionBuilder_ != null)) {
1875         return textExtractionBuilder_.getMessageOrBuilder();
1876       } else {
1877         if (detailCase_ == 6) {
1878           return (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_;
1879         }
1880         return com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
1881       }
1882     }
1883     /**
1884      *
1885      *
1886      * <pre>
1887      * Annotation details for text extraction.
1888      * </pre>
1889      *
1890      * <code>.google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6;</code>
1891      */
1892     private com.google.protobuf.SingleFieldBuilderV3<
1893             com.google.cloud.automl.v1.TextExtractionAnnotation,
1894             com.google.cloud.automl.v1.TextExtractionAnnotation.Builder,
1895             com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder>
getTextExtractionFieldBuilder()1896         getTextExtractionFieldBuilder() {
1897       if (textExtractionBuilder_ == null) {
1898         if (!(detailCase_ == 6)) {
1899           detail_ = com.google.cloud.automl.v1.TextExtractionAnnotation.getDefaultInstance();
1900         }
1901         textExtractionBuilder_ =
1902             new com.google.protobuf.SingleFieldBuilderV3<
1903                 com.google.cloud.automl.v1.TextExtractionAnnotation,
1904                 com.google.cloud.automl.v1.TextExtractionAnnotation.Builder,
1905                 com.google.cloud.automl.v1.TextExtractionAnnotationOrBuilder>(
1906                 (com.google.cloud.automl.v1.TextExtractionAnnotation) detail_,
1907                 getParentForChildren(),
1908                 isClean());
1909         detail_ = null;
1910       }
1911       detailCase_ = 6;
1912       onChanged();
1913       return textExtractionBuilder_;
1914     }
1915 
1916     private com.google.protobuf.SingleFieldBuilderV3<
1917             com.google.cloud.automl.v1.TextSentimentAnnotation,
1918             com.google.cloud.automl.v1.TextSentimentAnnotation.Builder,
1919             com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder>
1920         textSentimentBuilder_;
1921     /**
1922      *
1923      *
1924      * <pre>
1925      * Annotation details for text sentiment.
1926      * </pre>
1927      *
1928      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
1929      *
1930      * @return Whether the textSentiment field is set.
1931      */
1932     @java.lang.Override
hasTextSentiment()1933     public boolean hasTextSentiment() {
1934       return detailCase_ == 7;
1935     }
1936     /**
1937      *
1938      *
1939      * <pre>
1940      * Annotation details for text sentiment.
1941      * </pre>
1942      *
1943      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
1944      *
1945      * @return The textSentiment.
1946      */
1947     @java.lang.Override
getTextSentiment()1948     public com.google.cloud.automl.v1.TextSentimentAnnotation getTextSentiment() {
1949       if (textSentimentBuilder_ == null) {
1950         if (detailCase_ == 7) {
1951           return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_;
1952         }
1953         return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
1954       } else {
1955         if (detailCase_ == 7) {
1956           return textSentimentBuilder_.getMessage();
1957         }
1958         return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
1959       }
1960     }
1961     /**
1962      *
1963      *
1964      * <pre>
1965      * Annotation details for text sentiment.
1966      * </pre>
1967      *
1968      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
1969      */
setTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value)1970     public Builder setTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value) {
1971       if (textSentimentBuilder_ == null) {
1972         if (value == null) {
1973           throw new NullPointerException();
1974         }
1975         detail_ = value;
1976         onChanged();
1977       } else {
1978         textSentimentBuilder_.setMessage(value);
1979       }
1980       detailCase_ = 7;
1981       return this;
1982     }
1983     /**
1984      *
1985      *
1986      * <pre>
1987      * Annotation details for text sentiment.
1988      * </pre>
1989      *
1990      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
1991      */
setTextSentiment( com.google.cloud.automl.v1.TextSentimentAnnotation.Builder builderForValue)1992     public Builder setTextSentiment(
1993         com.google.cloud.automl.v1.TextSentimentAnnotation.Builder builderForValue) {
1994       if (textSentimentBuilder_ == null) {
1995         detail_ = builderForValue.build();
1996         onChanged();
1997       } else {
1998         textSentimentBuilder_.setMessage(builderForValue.build());
1999       }
2000       detailCase_ = 7;
2001       return this;
2002     }
2003     /**
2004      *
2005      *
2006      * <pre>
2007      * Annotation details for text sentiment.
2008      * </pre>
2009      *
2010      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
2011      */
mergeTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value)2012     public Builder mergeTextSentiment(com.google.cloud.automl.v1.TextSentimentAnnotation value) {
2013       if (textSentimentBuilder_ == null) {
2014         if (detailCase_ == 7
2015             && detail_ != com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance()) {
2016           detail_ =
2017               com.google.cloud.automl.v1.TextSentimentAnnotation.newBuilder(
2018                       (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_)
2019                   .mergeFrom(value)
2020                   .buildPartial();
2021         } else {
2022           detail_ = value;
2023         }
2024         onChanged();
2025       } else {
2026         if (detailCase_ == 7) {
2027           textSentimentBuilder_.mergeFrom(value);
2028         } else {
2029           textSentimentBuilder_.setMessage(value);
2030         }
2031       }
2032       detailCase_ = 7;
2033       return this;
2034     }
2035     /**
2036      *
2037      *
2038      * <pre>
2039      * Annotation details for text sentiment.
2040      * </pre>
2041      *
2042      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
2043      */
clearTextSentiment()2044     public Builder clearTextSentiment() {
2045       if (textSentimentBuilder_ == null) {
2046         if (detailCase_ == 7) {
2047           detailCase_ = 0;
2048           detail_ = null;
2049           onChanged();
2050         }
2051       } else {
2052         if (detailCase_ == 7) {
2053           detailCase_ = 0;
2054           detail_ = null;
2055         }
2056         textSentimentBuilder_.clear();
2057       }
2058       return this;
2059     }
2060     /**
2061      *
2062      *
2063      * <pre>
2064      * Annotation details for text sentiment.
2065      * </pre>
2066      *
2067      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
2068      */
getTextSentimentBuilder()2069     public com.google.cloud.automl.v1.TextSentimentAnnotation.Builder getTextSentimentBuilder() {
2070       return getTextSentimentFieldBuilder().getBuilder();
2071     }
2072     /**
2073      *
2074      *
2075      * <pre>
2076      * Annotation details for text sentiment.
2077      * </pre>
2078      *
2079      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
2080      */
2081     @java.lang.Override
getTextSentimentOrBuilder()2082     public com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder getTextSentimentOrBuilder() {
2083       if ((detailCase_ == 7) && (textSentimentBuilder_ != null)) {
2084         return textSentimentBuilder_.getMessageOrBuilder();
2085       } else {
2086         if (detailCase_ == 7) {
2087           return (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_;
2088         }
2089         return com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
2090       }
2091     }
2092     /**
2093      *
2094      *
2095      * <pre>
2096      * Annotation details for text sentiment.
2097      * </pre>
2098      *
2099      * <code>.google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7;</code>
2100      */
2101     private com.google.protobuf.SingleFieldBuilderV3<
2102             com.google.cloud.automl.v1.TextSentimentAnnotation,
2103             com.google.cloud.automl.v1.TextSentimentAnnotation.Builder,
2104             com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder>
getTextSentimentFieldBuilder()2105         getTextSentimentFieldBuilder() {
2106       if (textSentimentBuilder_ == null) {
2107         if (!(detailCase_ == 7)) {
2108           detail_ = com.google.cloud.automl.v1.TextSentimentAnnotation.getDefaultInstance();
2109         }
2110         textSentimentBuilder_ =
2111             new com.google.protobuf.SingleFieldBuilderV3<
2112                 com.google.cloud.automl.v1.TextSentimentAnnotation,
2113                 com.google.cloud.automl.v1.TextSentimentAnnotation.Builder,
2114                 com.google.cloud.automl.v1.TextSentimentAnnotationOrBuilder>(
2115                 (com.google.cloud.automl.v1.TextSentimentAnnotation) detail_,
2116                 getParentForChildren(),
2117                 isClean());
2118         detail_ = null;
2119       }
2120       detailCase_ = 7;
2121       onChanged();
2122       return textSentimentBuilder_;
2123     }
2124 
2125     private java.lang.Object annotationSpecId_ = "";
2126     /**
2127      *
2128      *
2129      * <pre>
2130      * Output only . The resource ID of the annotation spec that
2131      * this annotation pertains to. The annotation spec comes from either an
2132      * ancestor dataset, or the dataset that was used to train the model in use.
2133      * </pre>
2134      *
2135      * <code>string annotation_spec_id = 1;</code>
2136      *
2137      * @return The annotationSpecId.
2138      */
getAnnotationSpecId()2139     public java.lang.String getAnnotationSpecId() {
2140       java.lang.Object ref = annotationSpecId_;
2141       if (!(ref instanceof java.lang.String)) {
2142         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2143         java.lang.String s = bs.toStringUtf8();
2144         annotationSpecId_ = s;
2145         return s;
2146       } else {
2147         return (java.lang.String) ref;
2148       }
2149     }
2150     /**
2151      *
2152      *
2153      * <pre>
2154      * Output only . The resource ID of the annotation spec that
2155      * this annotation pertains to. The annotation spec comes from either an
2156      * ancestor dataset, or the dataset that was used to train the model in use.
2157      * </pre>
2158      *
2159      * <code>string annotation_spec_id = 1;</code>
2160      *
2161      * @return The bytes for annotationSpecId.
2162      */
getAnnotationSpecIdBytes()2163     public com.google.protobuf.ByteString getAnnotationSpecIdBytes() {
2164       java.lang.Object ref = annotationSpecId_;
2165       if (ref instanceof String) {
2166         com.google.protobuf.ByteString b =
2167             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2168         annotationSpecId_ = b;
2169         return b;
2170       } else {
2171         return (com.google.protobuf.ByteString) ref;
2172       }
2173     }
2174     /**
2175      *
2176      *
2177      * <pre>
2178      * Output only . The resource ID of the annotation spec that
2179      * this annotation pertains to. The annotation spec comes from either an
2180      * ancestor dataset, or the dataset that was used to train the model in use.
2181      * </pre>
2182      *
2183      * <code>string annotation_spec_id = 1;</code>
2184      *
2185      * @param value The annotationSpecId to set.
2186      * @return This builder for chaining.
2187      */
setAnnotationSpecId(java.lang.String value)2188     public Builder setAnnotationSpecId(java.lang.String value) {
2189       if (value == null) {
2190         throw new NullPointerException();
2191       }
2192       annotationSpecId_ = value;
2193       bitField0_ |= 0x00000020;
2194       onChanged();
2195       return this;
2196     }
2197     /**
2198      *
2199      *
2200      * <pre>
2201      * Output only . The resource ID of the annotation spec that
2202      * this annotation pertains to. The annotation spec comes from either an
2203      * ancestor dataset, or the dataset that was used to train the model in use.
2204      * </pre>
2205      *
2206      * <code>string annotation_spec_id = 1;</code>
2207      *
2208      * @return This builder for chaining.
2209      */
clearAnnotationSpecId()2210     public Builder clearAnnotationSpecId() {
2211       annotationSpecId_ = getDefaultInstance().getAnnotationSpecId();
2212       bitField0_ = (bitField0_ & ~0x00000020);
2213       onChanged();
2214       return this;
2215     }
2216     /**
2217      *
2218      *
2219      * <pre>
2220      * Output only . The resource ID of the annotation spec that
2221      * this annotation pertains to. The annotation spec comes from either an
2222      * ancestor dataset, or the dataset that was used to train the model in use.
2223      * </pre>
2224      *
2225      * <code>string annotation_spec_id = 1;</code>
2226      *
2227      * @param value The bytes for annotationSpecId to set.
2228      * @return This builder for chaining.
2229      */
setAnnotationSpecIdBytes(com.google.protobuf.ByteString value)2230     public Builder setAnnotationSpecIdBytes(com.google.protobuf.ByteString value) {
2231       if (value == null) {
2232         throw new NullPointerException();
2233       }
2234       checkByteStringIsUtf8(value);
2235       annotationSpecId_ = value;
2236       bitField0_ |= 0x00000020;
2237       onChanged();
2238       return this;
2239     }
2240 
2241     private java.lang.Object displayName_ = "";
2242     /**
2243      *
2244      *
2245      * <pre>
2246      * Output only. The value of
2247      * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
2248      * when the model was trained. Because this field returns a value at model
2249      * training time, for different models trained using the same dataset, the
2250      * returned value could be different as model owner could update the
2251      * `display_name` between any two model training.
2252      * </pre>
2253      *
2254      * <code>string display_name = 5;</code>
2255      *
2256      * @return The displayName.
2257      */
getDisplayName()2258     public java.lang.String getDisplayName() {
2259       java.lang.Object ref = displayName_;
2260       if (!(ref instanceof java.lang.String)) {
2261         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2262         java.lang.String s = bs.toStringUtf8();
2263         displayName_ = s;
2264         return s;
2265       } else {
2266         return (java.lang.String) ref;
2267       }
2268     }
2269     /**
2270      *
2271      *
2272      * <pre>
2273      * Output only. The value of
2274      * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
2275      * when the model was trained. Because this field returns a value at model
2276      * training time, for different models trained using the same dataset, the
2277      * returned value could be different as model owner could update the
2278      * `display_name` between any two model training.
2279      * </pre>
2280      *
2281      * <code>string display_name = 5;</code>
2282      *
2283      * @return The bytes for displayName.
2284      */
getDisplayNameBytes()2285     public com.google.protobuf.ByteString getDisplayNameBytes() {
2286       java.lang.Object ref = displayName_;
2287       if (ref instanceof String) {
2288         com.google.protobuf.ByteString b =
2289             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2290         displayName_ = b;
2291         return b;
2292       } else {
2293         return (com.google.protobuf.ByteString) ref;
2294       }
2295     }
2296     /**
2297      *
2298      *
2299      * <pre>
2300      * Output only. The value of
2301      * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
2302      * when the model was trained. Because this field returns a value at model
2303      * training time, for different models trained using the same dataset, the
2304      * returned value could be different as model owner could update the
2305      * `display_name` between any two model training.
2306      * </pre>
2307      *
2308      * <code>string display_name = 5;</code>
2309      *
2310      * @param value The displayName to set.
2311      * @return This builder for chaining.
2312      */
setDisplayName(java.lang.String value)2313     public Builder setDisplayName(java.lang.String value) {
2314       if (value == null) {
2315         throw new NullPointerException();
2316       }
2317       displayName_ = value;
2318       bitField0_ |= 0x00000040;
2319       onChanged();
2320       return this;
2321     }
2322     /**
2323      *
2324      *
2325      * <pre>
2326      * Output only. The value of
2327      * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
2328      * when the model was trained. Because this field returns a value at model
2329      * training time, for different models trained using the same dataset, the
2330      * returned value could be different as model owner could update the
2331      * `display_name` between any two model training.
2332      * </pre>
2333      *
2334      * <code>string display_name = 5;</code>
2335      *
2336      * @return This builder for chaining.
2337      */
clearDisplayName()2338     public Builder clearDisplayName() {
2339       displayName_ = getDefaultInstance().getDisplayName();
2340       bitField0_ = (bitField0_ & ~0x00000040);
2341       onChanged();
2342       return this;
2343     }
2344     /**
2345      *
2346      *
2347      * <pre>
2348      * Output only. The value of
2349      * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name]
2350      * when the model was trained. Because this field returns a value at model
2351      * training time, for different models trained using the same dataset, the
2352      * returned value could be different as model owner could update the
2353      * `display_name` between any two model training.
2354      * </pre>
2355      *
2356      * <code>string display_name = 5;</code>
2357      *
2358      * @param value The bytes for displayName to set.
2359      * @return This builder for chaining.
2360      */
setDisplayNameBytes(com.google.protobuf.ByteString value)2361     public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
2362       if (value == null) {
2363         throw new NullPointerException();
2364       }
2365       checkByteStringIsUtf8(value);
2366       displayName_ = value;
2367       bitField0_ |= 0x00000040;
2368       onChanged();
2369       return this;
2370     }
2371 
2372     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2373     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
2374       return super.setUnknownFields(unknownFields);
2375     }
2376 
2377     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2378     public final Builder mergeUnknownFields(
2379         final com.google.protobuf.UnknownFieldSet unknownFields) {
2380       return super.mergeUnknownFields(unknownFields);
2381     }
2382 
2383     // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.AnnotationPayload)
2384   }
2385 
2386   // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.AnnotationPayload)
2387   private static final com.google.cloud.automl.v1.AnnotationPayload DEFAULT_INSTANCE;
2388 
2389   static {
2390     DEFAULT_INSTANCE = new com.google.cloud.automl.v1.AnnotationPayload();
2391   }
2392 
getDefaultInstance()2393   public static com.google.cloud.automl.v1.AnnotationPayload getDefaultInstance() {
2394     return DEFAULT_INSTANCE;
2395   }
2396 
2397   private static final com.google.protobuf.Parser<AnnotationPayload> PARSER =
2398       new com.google.protobuf.AbstractParser<AnnotationPayload>() {
2399         @java.lang.Override
2400         public AnnotationPayload parsePartialFrom(
2401             com.google.protobuf.CodedInputStream input,
2402             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2403             throws com.google.protobuf.InvalidProtocolBufferException {
2404           Builder builder = newBuilder();
2405           try {
2406             builder.mergeFrom(input, extensionRegistry);
2407           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2408             throw e.setUnfinishedMessage(builder.buildPartial());
2409           } catch (com.google.protobuf.UninitializedMessageException e) {
2410             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
2411           } catch (java.io.IOException e) {
2412             throw new com.google.protobuf.InvalidProtocolBufferException(e)
2413                 .setUnfinishedMessage(builder.buildPartial());
2414           }
2415           return builder.buildPartial();
2416         }
2417       };
2418 
parser()2419   public static com.google.protobuf.Parser<AnnotationPayload> parser() {
2420     return PARSER;
2421   }
2422 
2423   @java.lang.Override
getParserForType()2424   public com.google.protobuf.Parser<AnnotationPayload> getParserForType() {
2425     return PARSER;
2426   }
2427 
2428   @java.lang.Override
getDefaultInstanceForType()2429   public com.google.cloud.automl.v1.AnnotationPayload getDefaultInstanceForType() {
2430     return DEFAULT_INSTANCE;
2431   }
2432 }
2433