• 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/prediction_service.proto
18 
19 package com.google.cloud.automl.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.automl.v1.PredictResponse}
29  */
30 public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.PredictResponse)
33     PredictResponseOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use PredictResponse.newBuilder() to construct.
PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
PredictResponse()40   private PredictResponse() {
41     payload_ = java.util.Collections.emptyList();
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new PredictResponse();
48   }
49 
50   @java.lang.Override
getUnknownFields()51   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
52     return this.unknownFields;
53   }
54 
getDescriptor()55   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
56     return com.google.cloud.automl.v1.PredictionServiceProto
57         .internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
58   }
59 
60   @SuppressWarnings({"rawtypes"})
61   @java.lang.Override
internalGetMapField(int number)62   protected com.google.protobuf.MapField internalGetMapField(int number) {
63     switch (number) {
64       case 2:
65         return internalGetMetadata();
66       default:
67         throw new RuntimeException("Invalid map field number: " + number);
68     }
69   }
70 
71   @java.lang.Override
72   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()73       internalGetFieldAccessorTable() {
74     return com.google.cloud.automl.v1.PredictionServiceProto
75         .internal_static_google_cloud_automl_v1_PredictResponse_fieldAccessorTable
76         .ensureFieldAccessorsInitialized(
77             com.google.cloud.automl.v1.PredictResponse.class,
78             com.google.cloud.automl.v1.PredictResponse.Builder.class);
79   }
80 
81   public static final int PAYLOAD_FIELD_NUMBER = 1;
82 
83   @SuppressWarnings("serial")
84   private java.util.List<com.google.cloud.automl.v1.AnnotationPayload> payload_;
85   /**
86    *
87    *
88    * <pre>
89    * Prediction result.
90    * AutoML Translation and AutoML Natural Language Sentiment Analysis
91    * return precisely one payload.
92    * </pre>
93    *
94    * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
95    */
96   @java.lang.Override
getPayloadList()97   public java.util.List<com.google.cloud.automl.v1.AnnotationPayload> getPayloadList() {
98     return payload_;
99   }
100   /**
101    *
102    *
103    * <pre>
104    * Prediction result.
105    * AutoML Translation and AutoML Natural Language Sentiment Analysis
106    * return precisely one payload.
107    * </pre>
108    *
109    * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
110    */
111   @java.lang.Override
112   public java.util.List<? extends com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadOrBuilderList()113       getPayloadOrBuilderList() {
114     return payload_;
115   }
116   /**
117    *
118    *
119    * <pre>
120    * Prediction result.
121    * AutoML Translation and AutoML Natural Language Sentiment Analysis
122    * return precisely one payload.
123    * </pre>
124    *
125    * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
126    */
127   @java.lang.Override
getPayloadCount()128   public int getPayloadCount() {
129     return payload_.size();
130   }
131   /**
132    *
133    *
134    * <pre>
135    * Prediction result.
136    * AutoML Translation and AutoML Natural Language Sentiment Analysis
137    * return precisely one payload.
138    * </pre>
139    *
140    * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
141    */
142   @java.lang.Override
getPayload(int index)143   public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) {
144     return payload_.get(index);
145   }
146   /**
147    *
148    *
149    * <pre>
150    * Prediction result.
151    * AutoML Translation and AutoML Natural Language Sentiment Analysis
152    * return precisely one payload.
153    * </pre>
154    *
155    * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
156    */
157   @java.lang.Override
getPayloadOrBuilder(int index)158   public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) {
159     return payload_.get(index);
160   }
161 
162   public static final int PREPROCESSED_INPUT_FIELD_NUMBER = 3;
163   private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_;
164   /**
165    *
166    *
167    * <pre>
168    * The preprocessed example that AutoML actually makes prediction on.
169    * Empty if AutoML does not preprocess the input example.
170    * For AutoML Natural Language (Classification, Entity Extraction, and
171    * Sentiment Analysis), if the input is a document, the recognized text is
172    * returned in the
173    * [document_text][google.cloud.automl.v1.Document.document_text]
174    * property.
175    * </pre>
176    *
177    * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
178    *
179    * @return Whether the preprocessedInput field is set.
180    */
181   @java.lang.Override
hasPreprocessedInput()182   public boolean hasPreprocessedInput() {
183     return preprocessedInput_ != null;
184   }
185   /**
186    *
187    *
188    * <pre>
189    * The preprocessed example that AutoML actually makes prediction on.
190    * Empty if AutoML does not preprocess the input example.
191    * For AutoML Natural Language (Classification, Entity Extraction, and
192    * Sentiment Analysis), if the input is a document, the recognized text is
193    * returned in the
194    * [document_text][google.cloud.automl.v1.Document.document_text]
195    * property.
196    * </pre>
197    *
198    * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
199    *
200    * @return The preprocessedInput.
201    */
202   @java.lang.Override
getPreprocessedInput()203   public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() {
204     return preprocessedInput_ == null
205         ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
206         : preprocessedInput_;
207   }
208   /**
209    *
210    *
211    * <pre>
212    * The preprocessed example that AutoML actually makes prediction on.
213    * Empty if AutoML does not preprocess the input example.
214    * For AutoML Natural Language (Classification, Entity Extraction, and
215    * Sentiment Analysis), if the input is a document, the recognized text is
216    * returned in the
217    * [document_text][google.cloud.automl.v1.Document.document_text]
218    * property.
219    * </pre>
220    *
221    * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
222    */
223   @java.lang.Override
getPreprocessedInputOrBuilder()224   public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() {
225     return preprocessedInput_ == null
226         ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
227         : preprocessedInput_;
228   }
229 
230   public static final int METADATA_FIELD_NUMBER = 2;
231 
232   private static final class MetadataDefaultEntryHolder {
233     static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
234         com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
235             com.google.cloud.automl.v1.PredictionServiceProto
236                 .internal_static_google_cloud_automl_v1_PredictResponse_MetadataEntry_descriptor,
237             com.google.protobuf.WireFormat.FieldType.STRING,
238             "",
239             com.google.protobuf.WireFormat.FieldType.STRING,
240             "");
241   }
242 
243   @SuppressWarnings("serial")
244   private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;
245 
internalGetMetadata()246   private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
247     if (metadata_ == null) {
248       return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
249     }
250     return metadata_;
251   }
252 
getMetadataCount()253   public int getMetadataCount() {
254     return internalGetMetadata().getMap().size();
255   }
256   /**
257    *
258    *
259    * <pre>
260    * Additional domain-specific prediction response metadata.
261    * AutoML Vision Object Detection
262    * `max_bounding_box_count`
263    * : (int64) The maximum number of bounding boxes to return per image.
264    * AutoML Natural Language Sentiment Analysis
265    * `sentiment_score`
266    * : (float, deprecated) A value between -1 and 1,
267    *   -1 maps to least positive sentiment, while 1 maps to the most positive
268    *   one and the higher the score, the more positive the sentiment in the
269    *   document is. Yet these values are relative to the training data, so
270    *   e.g. if all data was positive then -1 is also positive (though
271    *   the least).
272    *   `sentiment_score` is not the same as "score" and "magnitude"
273    *   from Sentiment Analysis in the Natural Language API.
274    * </pre>
275    *
276    * <code>map&lt;string, string&gt; metadata = 2;</code>
277    */
278   @java.lang.Override
containsMetadata(java.lang.String key)279   public boolean containsMetadata(java.lang.String key) {
280     if (key == null) {
281       throw new NullPointerException("map key");
282     }
283     return internalGetMetadata().getMap().containsKey(key);
284   }
285   /** Use {@link #getMetadataMap()} instead. */
286   @java.lang.Override
287   @java.lang.Deprecated
getMetadata()288   public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
289     return getMetadataMap();
290   }
291   /**
292    *
293    *
294    * <pre>
295    * Additional domain-specific prediction response metadata.
296    * AutoML Vision Object Detection
297    * `max_bounding_box_count`
298    * : (int64) The maximum number of bounding boxes to return per image.
299    * AutoML Natural Language Sentiment Analysis
300    * `sentiment_score`
301    * : (float, deprecated) A value between -1 and 1,
302    *   -1 maps to least positive sentiment, while 1 maps to the most positive
303    *   one and the higher the score, the more positive the sentiment in the
304    *   document is. Yet these values are relative to the training data, so
305    *   e.g. if all data was positive then -1 is also positive (though
306    *   the least).
307    *   `sentiment_score` is not the same as "score" and "magnitude"
308    *   from Sentiment Analysis in the Natural Language API.
309    * </pre>
310    *
311    * <code>map&lt;string, string&gt; metadata = 2;</code>
312    */
313   @java.lang.Override
getMetadataMap()314   public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
315     return internalGetMetadata().getMap();
316   }
317   /**
318    *
319    *
320    * <pre>
321    * Additional domain-specific prediction response metadata.
322    * AutoML Vision Object Detection
323    * `max_bounding_box_count`
324    * : (int64) The maximum number of bounding boxes to return per image.
325    * AutoML Natural Language Sentiment Analysis
326    * `sentiment_score`
327    * : (float, deprecated) A value between -1 and 1,
328    *   -1 maps to least positive sentiment, while 1 maps to the most positive
329    *   one and the higher the score, the more positive the sentiment in the
330    *   document is. Yet these values are relative to the training data, so
331    *   e.g. if all data was positive then -1 is also positive (though
332    *   the least).
333    *   `sentiment_score` is not the same as "score" and "magnitude"
334    *   from Sentiment Analysis in the Natural Language API.
335    * </pre>
336    *
337    * <code>map&lt;string, string&gt; metadata = 2;</code>
338    */
339   @java.lang.Override
getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue)340   public /* nullable */ java.lang.String getMetadataOrDefault(
341       java.lang.String key,
342       /* nullable */
343       java.lang.String defaultValue) {
344     if (key == null) {
345       throw new NullPointerException("map key");
346     }
347     java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
348     return map.containsKey(key) ? map.get(key) : defaultValue;
349   }
350   /**
351    *
352    *
353    * <pre>
354    * Additional domain-specific prediction response metadata.
355    * AutoML Vision Object Detection
356    * `max_bounding_box_count`
357    * : (int64) The maximum number of bounding boxes to return per image.
358    * AutoML Natural Language Sentiment Analysis
359    * `sentiment_score`
360    * : (float, deprecated) A value between -1 and 1,
361    *   -1 maps to least positive sentiment, while 1 maps to the most positive
362    *   one and the higher the score, the more positive the sentiment in the
363    *   document is. Yet these values are relative to the training data, so
364    *   e.g. if all data was positive then -1 is also positive (though
365    *   the least).
366    *   `sentiment_score` is not the same as "score" and "magnitude"
367    *   from Sentiment Analysis in the Natural Language API.
368    * </pre>
369    *
370    * <code>map&lt;string, string&gt; metadata = 2;</code>
371    */
372   @java.lang.Override
getMetadataOrThrow(java.lang.String key)373   public java.lang.String getMetadataOrThrow(java.lang.String key) {
374     if (key == null) {
375       throw new NullPointerException("map key");
376     }
377     java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
378     if (!map.containsKey(key)) {
379       throw new java.lang.IllegalArgumentException();
380     }
381     return map.get(key);
382   }
383 
384   private byte memoizedIsInitialized = -1;
385 
386   @java.lang.Override
isInitialized()387   public final boolean isInitialized() {
388     byte isInitialized = memoizedIsInitialized;
389     if (isInitialized == 1) return true;
390     if (isInitialized == 0) return false;
391 
392     memoizedIsInitialized = 1;
393     return true;
394   }
395 
396   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)397   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
398     for (int i = 0; i < payload_.size(); i++) {
399       output.writeMessage(1, payload_.get(i));
400     }
401     com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
402         output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2);
403     if (preprocessedInput_ != null) {
404       output.writeMessage(3, getPreprocessedInput());
405     }
406     getUnknownFields().writeTo(output);
407   }
408 
409   @java.lang.Override
getSerializedSize()410   public int getSerializedSize() {
411     int size = memoizedSize;
412     if (size != -1) return size;
413 
414     size = 0;
415     for (int i = 0; i < payload_.size(); i++) {
416       size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, payload_.get(i));
417     }
418     for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
419         internalGetMetadata().getMap().entrySet()) {
420       com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
421           MetadataDefaultEntryHolder.defaultEntry
422               .newBuilderForType()
423               .setKey(entry.getKey())
424               .setValue(entry.getValue())
425               .build();
426       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__);
427     }
428     if (preprocessedInput_ != null) {
429       size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPreprocessedInput());
430     }
431     size += getUnknownFields().getSerializedSize();
432     memoizedSize = size;
433     return size;
434   }
435 
436   @java.lang.Override
equals(final java.lang.Object obj)437   public boolean equals(final java.lang.Object obj) {
438     if (obj == this) {
439       return true;
440     }
441     if (!(obj instanceof com.google.cloud.automl.v1.PredictResponse)) {
442       return super.equals(obj);
443     }
444     com.google.cloud.automl.v1.PredictResponse other =
445         (com.google.cloud.automl.v1.PredictResponse) obj;
446 
447     if (!getPayloadList().equals(other.getPayloadList())) return false;
448     if (hasPreprocessedInput() != other.hasPreprocessedInput()) return false;
449     if (hasPreprocessedInput()) {
450       if (!getPreprocessedInput().equals(other.getPreprocessedInput())) return false;
451     }
452     if (!internalGetMetadata().equals(other.internalGetMetadata())) return false;
453     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
454     return true;
455   }
456 
457   @java.lang.Override
hashCode()458   public int hashCode() {
459     if (memoizedHashCode != 0) {
460       return memoizedHashCode;
461     }
462     int hash = 41;
463     hash = (19 * hash) + getDescriptor().hashCode();
464     if (getPayloadCount() > 0) {
465       hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
466       hash = (53 * hash) + getPayloadList().hashCode();
467     }
468     if (hasPreprocessedInput()) {
469       hash = (37 * hash) + PREPROCESSED_INPUT_FIELD_NUMBER;
470       hash = (53 * hash) + getPreprocessedInput().hashCode();
471     }
472     if (!internalGetMetadata().getMap().isEmpty()) {
473       hash = (37 * hash) + METADATA_FIELD_NUMBER;
474       hash = (53 * hash) + internalGetMetadata().hashCode();
475     }
476     hash = (29 * hash) + getUnknownFields().hashCode();
477     memoizedHashCode = hash;
478     return hash;
479   }
480 
parseFrom(java.nio.ByteBuffer data)481   public static com.google.cloud.automl.v1.PredictResponse parseFrom(java.nio.ByteBuffer data)
482       throws com.google.protobuf.InvalidProtocolBufferException {
483     return PARSER.parseFrom(data);
484   }
485 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)486   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
487       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
488       throws com.google.protobuf.InvalidProtocolBufferException {
489     return PARSER.parseFrom(data, extensionRegistry);
490   }
491 
parseFrom( com.google.protobuf.ByteString data)492   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
493       com.google.protobuf.ByteString data)
494       throws com.google.protobuf.InvalidProtocolBufferException {
495     return PARSER.parseFrom(data);
496   }
497 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)498   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
499       com.google.protobuf.ByteString data,
500       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
501       throws com.google.protobuf.InvalidProtocolBufferException {
502     return PARSER.parseFrom(data, extensionRegistry);
503   }
504 
parseFrom(byte[] data)505   public static com.google.cloud.automl.v1.PredictResponse parseFrom(byte[] data)
506       throws com.google.protobuf.InvalidProtocolBufferException {
507     return PARSER.parseFrom(data);
508   }
509 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)510   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
511       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
512       throws com.google.protobuf.InvalidProtocolBufferException {
513     return PARSER.parseFrom(data, extensionRegistry);
514   }
515 
parseFrom(java.io.InputStream input)516   public static com.google.cloud.automl.v1.PredictResponse parseFrom(java.io.InputStream input)
517       throws java.io.IOException {
518     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
519   }
520 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)521   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
522       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
523       throws java.io.IOException {
524     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
525         PARSER, input, extensionRegistry);
526   }
527 
parseDelimitedFrom( java.io.InputStream input)528   public static com.google.cloud.automl.v1.PredictResponse parseDelimitedFrom(
529       java.io.InputStream input) throws java.io.IOException {
530     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
531   }
532 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)533   public static com.google.cloud.automl.v1.PredictResponse parseDelimitedFrom(
534       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
535       throws java.io.IOException {
536     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
537         PARSER, input, extensionRegistry);
538   }
539 
parseFrom( com.google.protobuf.CodedInputStream input)540   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
541       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
542     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
543   }
544 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)545   public static com.google.cloud.automl.v1.PredictResponse parseFrom(
546       com.google.protobuf.CodedInputStream input,
547       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
548       throws java.io.IOException {
549     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
550         PARSER, input, extensionRegistry);
551   }
552 
553   @java.lang.Override
newBuilderForType()554   public Builder newBuilderForType() {
555     return newBuilder();
556   }
557 
newBuilder()558   public static Builder newBuilder() {
559     return DEFAULT_INSTANCE.toBuilder();
560   }
561 
newBuilder(com.google.cloud.automl.v1.PredictResponse prototype)562   public static Builder newBuilder(com.google.cloud.automl.v1.PredictResponse prototype) {
563     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
564   }
565 
566   @java.lang.Override
toBuilder()567   public Builder toBuilder() {
568     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
569   }
570 
571   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)572   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
573     Builder builder = new Builder(parent);
574     return builder;
575   }
576   /**
577    *
578    *
579    * <pre>
580    * Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict].
581    * </pre>
582    *
583    * Protobuf type {@code google.cloud.automl.v1.PredictResponse}
584    */
585   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
586       implements
587       // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.PredictResponse)
588       com.google.cloud.automl.v1.PredictResponseOrBuilder {
getDescriptor()589     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
590       return com.google.cloud.automl.v1.PredictionServiceProto
591           .internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
592     }
593 
594     @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)595     protected com.google.protobuf.MapField internalGetMapField(int number) {
596       switch (number) {
597         case 2:
598           return internalGetMetadata();
599         default:
600           throw new RuntimeException("Invalid map field number: " + number);
601       }
602     }
603 
604     @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)605     protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
606       switch (number) {
607         case 2:
608           return internalGetMutableMetadata();
609         default:
610           throw new RuntimeException("Invalid map field number: " + number);
611       }
612     }
613 
614     @java.lang.Override
615     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()616         internalGetFieldAccessorTable() {
617       return com.google.cloud.automl.v1.PredictionServiceProto
618           .internal_static_google_cloud_automl_v1_PredictResponse_fieldAccessorTable
619           .ensureFieldAccessorsInitialized(
620               com.google.cloud.automl.v1.PredictResponse.class,
621               com.google.cloud.automl.v1.PredictResponse.Builder.class);
622     }
623 
624     // Construct using com.google.cloud.automl.v1.PredictResponse.newBuilder()
Builder()625     private Builder() {}
626 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)627     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
628       super(parent);
629     }
630 
631     @java.lang.Override
clear()632     public Builder clear() {
633       super.clear();
634       bitField0_ = 0;
635       if (payloadBuilder_ == null) {
636         payload_ = java.util.Collections.emptyList();
637       } else {
638         payload_ = null;
639         payloadBuilder_.clear();
640       }
641       bitField0_ = (bitField0_ & ~0x00000001);
642       preprocessedInput_ = null;
643       if (preprocessedInputBuilder_ != null) {
644         preprocessedInputBuilder_.dispose();
645         preprocessedInputBuilder_ = null;
646       }
647       internalGetMutableMetadata().clear();
648       return this;
649     }
650 
651     @java.lang.Override
getDescriptorForType()652     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
653       return com.google.cloud.automl.v1.PredictionServiceProto
654           .internal_static_google_cloud_automl_v1_PredictResponse_descriptor;
655     }
656 
657     @java.lang.Override
getDefaultInstanceForType()658     public com.google.cloud.automl.v1.PredictResponse getDefaultInstanceForType() {
659       return com.google.cloud.automl.v1.PredictResponse.getDefaultInstance();
660     }
661 
662     @java.lang.Override
build()663     public com.google.cloud.automl.v1.PredictResponse build() {
664       com.google.cloud.automl.v1.PredictResponse result = buildPartial();
665       if (!result.isInitialized()) {
666         throw newUninitializedMessageException(result);
667       }
668       return result;
669     }
670 
671     @java.lang.Override
buildPartial()672     public com.google.cloud.automl.v1.PredictResponse buildPartial() {
673       com.google.cloud.automl.v1.PredictResponse result =
674           new com.google.cloud.automl.v1.PredictResponse(this);
675       buildPartialRepeatedFields(result);
676       if (bitField0_ != 0) {
677         buildPartial0(result);
678       }
679       onBuilt();
680       return result;
681     }
682 
buildPartialRepeatedFields(com.google.cloud.automl.v1.PredictResponse result)683     private void buildPartialRepeatedFields(com.google.cloud.automl.v1.PredictResponse result) {
684       if (payloadBuilder_ == null) {
685         if (((bitField0_ & 0x00000001) != 0)) {
686           payload_ = java.util.Collections.unmodifiableList(payload_);
687           bitField0_ = (bitField0_ & ~0x00000001);
688         }
689         result.payload_ = payload_;
690       } else {
691         result.payload_ = payloadBuilder_.build();
692       }
693     }
694 
buildPartial0(com.google.cloud.automl.v1.PredictResponse result)695     private void buildPartial0(com.google.cloud.automl.v1.PredictResponse result) {
696       int from_bitField0_ = bitField0_;
697       if (((from_bitField0_ & 0x00000002) != 0)) {
698         result.preprocessedInput_ =
699             preprocessedInputBuilder_ == null
700                 ? preprocessedInput_
701                 : preprocessedInputBuilder_.build();
702       }
703       if (((from_bitField0_ & 0x00000004) != 0)) {
704         result.metadata_ = internalGetMetadata();
705         result.metadata_.makeImmutable();
706       }
707     }
708 
709     @java.lang.Override
clone()710     public Builder clone() {
711       return super.clone();
712     }
713 
714     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)715     public Builder setField(
716         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
717       return super.setField(field, value);
718     }
719 
720     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)721     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
722       return super.clearField(field);
723     }
724 
725     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)726     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
727       return super.clearOneof(oneof);
728     }
729 
730     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)731     public Builder setRepeatedField(
732         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
733       return super.setRepeatedField(field, index, value);
734     }
735 
736     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)737     public Builder addRepeatedField(
738         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
739       return super.addRepeatedField(field, value);
740     }
741 
742     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)743     public Builder mergeFrom(com.google.protobuf.Message other) {
744       if (other instanceof com.google.cloud.automl.v1.PredictResponse) {
745         return mergeFrom((com.google.cloud.automl.v1.PredictResponse) other);
746       } else {
747         super.mergeFrom(other);
748         return this;
749       }
750     }
751 
mergeFrom(com.google.cloud.automl.v1.PredictResponse other)752     public Builder mergeFrom(com.google.cloud.automl.v1.PredictResponse other) {
753       if (other == com.google.cloud.automl.v1.PredictResponse.getDefaultInstance()) return this;
754       if (payloadBuilder_ == null) {
755         if (!other.payload_.isEmpty()) {
756           if (payload_.isEmpty()) {
757             payload_ = other.payload_;
758             bitField0_ = (bitField0_ & ~0x00000001);
759           } else {
760             ensurePayloadIsMutable();
761             payload_.addAll(other.payload_);
762           }
763           onChanged();
764         }
765       } else {
766         if (!other.payload_.isEmpty()) {
767           if (payloadBuilder_.isEmpty()) {
768             payloadBuilder_.dispose();
769             payloadBuilder_ = null;
770             payload_ = other.payload_;
771             bitField0_ = (bitField0_ & ~0x00000001);
772             payloadBuilder_ =
773                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
774                     ? getPayloadFieldBuilder()
775                     : null;
776           } else {
777             payloadBuilder_.addAllMessages(other.payload_);
778           }
779         }
780       }
781       if (other.hasPreprocessedInput()) {
782         mergePreprocessedInput(other.getPreprocessedInput());
783       }
784       internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
785       bitField0_ |= 0x00000004;
786       this.mergeUnknownFields(other.getUnknownFields());
787       onChanged();
788       return this;
789     }
790 
791     @java.lang.Override
isInitialized()792     public final boolean isInitialized() {
793       return true;
794     }
795 
796     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)797     public Builder mergeFrom(
798         com.google.protobuf.CodedInputStream input,
799         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
800         throws java.io.IOException {
801       if (extensionRegistry == null) {
802         throw new java.lang.NullPointerException();
803       }
804       try {
805         boolean done = false;
806         while (!done) {
807           int tag = input.readTag();
808           switch (tag) {
809             case 0:
810               done = true;
811               break;
812             case 10:
813               {
814                 com.google.cloud.automl.v1.AnnotationPayload m =
815                     input.readMessage(
816                         com.google.cloud.automl.v1.AnnotationPayload.parser(), extensionRegistry);
817                 if (payloadBuilder_ == null) {
818                   ensurePayloadIsMutable();
819                   payload_.add(m);
820                 } else {
821                   payloadBuilder_.addMessage(m);
822                 }
823                 break;
824               } // case 10
825             case 18:
826               {
827                 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
828                     input.readMessage(
829                         MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
830                         extensionRegistry);
831                 internalGetMutableMetadata()
832                     .getMutableMap()
833                     .put(metadata__.getKey(), metadata__.getValue());
834                 bitField0_ |= 0x00000004;
835                 break;
836               } // case 18
837             case 26:
838               {
839                 input.readMessage(
840                     getPreprocessedInputFieldBuilder().getBuilder(), extensionRegistry);
841                 bitField0_ |= 0x00000002;
842                 break;
843               } // case 26
844             default:
845               {
846                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
847                   done = true; // was an endgroup tag
848                 }
849                 break;
850               } // default:
851           } // switch (tag)
852         } // while (!done)
853       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
854         throw e.unwrapIOException();
855       } finally {
856         onChanged();
857       } // finally
858       return this;
859     }
860 
861     private int bitField0_;
862 
863     private java.util.List<com.google.cloud.automl.v1.AnnotationPayload> payload_ =
864         java.util.Collections.emptyList();
865 
ensurePayloadIsMutable()866     private void ensurePayloadIsMutable() {
867       if (!((bitField0_ & 0x00000001) != 0)) {
868         payload_ = new java.util.ArrayList<com.google.cloud.automl.v1.AnnotationPayload>(payload_);
869         bitField0_ |= 0x00000001;
870       }
871     }
872 
873     private com.google.protobuf.RepeatedFieldBuilderV3<
874             com.google.cloud.automl.v1.AnnotationPayload,
875             com.google.cloud.automl.v1.AnnotationPayload.Builder,
876             com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
877         payloadBuilder_;
878 
879     /**
880      *
881      *
882      * <pre>
883      * Prediction result.
884      * AutoML Translation and AutoML Natural Language Sentiment Analysis
885      * return precisely one payload.
886      * </pre>
887      *
888      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
889      */
getPayloadList()890     public java.util.List<com.google.cloud.automl.v1.AnnotationPayload> getPayloadList() {
891       if (payloadBuilder_ == null) {
892         return java.util.Collections.unmodifiableList(payload_);
893       } else {
894         return payloadBuilder_.getMessageList();
895       }
896     }
897     /**
898      *
899      *
900      * <pre>
901      * Prediction result.
902      * AutoML Translation and AutoML Natural Language Sentiment Analysis
903      * return precisely one payload.
904      * </pre>
905      *
906      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
907      */
getPayloadCount()908     public int getPayloadCount() {
909       if (payloadBuilder_ == null) {
910         return payload_.size();
911       } else {
912         return payloadBuilder_.getCount();
913       }
914     }
915     /**
916      *
917      *
918      * <pre>
919      * Prediction result.
920      * AutoML Translation and AutoML Natural Language Sentiment Analysis
921      * return precisely one payload.
922      * </pre>
923      *
924      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
925      */
getPayload(int index)926     public com.google.cloud.automl.v1.AnnotationPayload getPayload(int index) {
927       if (payloadBuilder_ == null) {
928         return payload_.get(index);
929       } else {
930         return payloadBuilder_.getMessage(index);
931       }
932     }
933     /**
934      *
935      *
936      * <pre>
937      * Prediction result.
938      * AutoML Translation and AutoML Natural Language Sentiment Analysis
939      * return precisely one payload.
940      * </pre>
941      *
942      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
943      */
setPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value)944     public Builder setPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) {
945       if (payloadBuilder_ == null) {
946         if (value == null) {
947           throw new NullPointerException();
948         }
949         ensurePayloadIsMutable();
950         payload_.set(index, value);
951         onChanged();
952       } else {
953         payloadBuilder_.setMessage(index, value);
954       }
955       return this;
956     }
957     /**
958      *
959      *
960      * <pre>
961      * Prediction result.
962      * AutoML Translation and AutoML Natural Language Sentiment Analysis
963      * return precisely one payload.
964      * </pre>
965      *
966      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
967      */
setPayload( int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue)968     public Builder setPayload(
969         int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
970       if (payloadBuilder_ == null) {
971         ensurePayloadIsMutable();
972         payload_.set(index, builderForValue.build());
973         onChanged();
974       } else {
975         payloadBuilder_.setMessage(index, builderForValue.build());
976       }
977       return this;
978     }
979     /**
980      *
981      *
982      * <pre>
983      * Prediction result.
984      * AutoML Translation and AutoML Natural Language Sentiment Analysis
985      * return precisely one payload.
986      * </pre>
987      *
988      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
989      */
addPayload(com.google.cloud.automl.v1.AnnotationPayload value)990     public Builder addPayload(com.google.cloud.automl.v1.AnnotationPayload value) {
991       if (payloadBuilder_ == null) {
992         if (value == null) {
993           throw new NullPointerException();
994         }
995         ensurePayloadIsMutable();
996         payload_.add(value);
997         onChanged();
998       } else {
999         payloadBuilder_.addMessage(value);
1000       }
1001       return this;
1002     }
1003     /**
1004      *
1005      *
1006      * <pre>
1007      * Prediction result.
1008      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1009      * return precisely one payload.
1010      * </pre>
1011      *
1012      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1013      */
addPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value)1014     public Builder addPayload(int index, com.google.cloud.automl.v1.AnnotationPayload value) {
1015       if (payloadBuilder_ == null) {
1016         if (value == null) {
1017           throw new NullPointerException();
1018         }
1019         ensurePayloadIsMutable();
1020         payload_.add(index, value);
1021         onChanged();
1022       } else {
1023         payloadBuilder_.addMessage(index, value);
1024       }
1025       return this;
1026     }
1027     /**
1028      *
1029      *
1030      * <pre>
1031      * Prediction result.
1032      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1033      * return precisely one payload.
1034      * </pre>
1035      *
1036      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1037      */
addPayload( com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue)1038     public Builder addPayload(
1039         com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
1040       if (payloadBuilder_ == null) {
1041         ensurePayloadIsMutable();
1042         payload_.add(builderForValue.build());
1043         onChanged();
1044       } else {
1045         payloadBuilder_.addMessage(builderForValue.build());
1046       }
1047       return this;
1048     }
1049     /**
1050      *
1051      *
1052      * <pre>
1053      * Prediction result.
1054      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1055      * return precisely one payload.
1056      * </pre>
1057      *
1058      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1059      */
addPayload( int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue)1060     public Builder addPayload(
1061         int index, com.google.cloud.automl.v1.AnnotationPayload.Builder builderForValue) {
1062       if (payloadBuilder_ == null) {
1063         ensurePayloadIsMutable();
1064         payload_.add(index, builderForValue.build());
1065         onChanged();
1066       } else {
1067         payloadBuilder_.addMessage(index, builderForValue.build());
1068       }
1069       return this;
1070     }
1071     /**
1072      *
1073      *
1074      * <pre>
1075      * Prediction result.
1076      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1077      * return precisely one payload.
1078      * </pre>
1079      *
1080      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1081      */
addAllPayload( java.lang.Iterable<? extends com.google.cloud.automl.v1.AnnotationPayload> values)1082     public Builder addAllPayload(
1083         java.lang.Iterable<? extends com.google.cloud.automl.v1.AnnotationPayload> values) {
1084       if (payloadBuilder_ == null) {
1085         ensurePayloadIsMutable();
1086         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, payload_);
1087         onChanged();
1088       } else {
1089         payloadBuilder_.addAllMessages(values);
1090       }
1091       return this;
1092     }
1093     /**
1094      *
1095      *
1096      * <pre>
1097      * Prediction result.
1098      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1099      * return precisely one payload.
1100      * </pre>
1101      *
1102      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1103      */
clearPayload()1104     public Builder clearPayload() {
1105       if (payloadBuilder_ == null) {
1106         payload_ = java.util.Collections.emptyList();
1107         bitField0_ = (bitField0_ & ~0x00000001);
1108         onChanged();
1109       } else {
1110         payloadBuilder_.clear();
1111       }
1112       return this;
1113     }
1114     /**
1115      *
1116      *
1117      * <pre>
1118      * Prediction result.
1119      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1120      * return precisely one payload.
1121      * </pre>
1122      *
1123      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1124      */
removePayload(int index)1125     public Builder removePayload(int index) {
1126       if (payloadBuilder_ == null) {
1127         ensurePayloadIsMutable();
1128         payload_.remove(index);
1129         onChanged();
1130       } else {
1131         payloadBuilder_.remove(index);
1132       }
1133       return this;
1134     }
1135     /**
1136      *
1137      *
1138      * <pre>
1139      * Prediction result.
1140      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1141      * return precisely one payload.
1142      * </pre>
1143      *
1144      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1145      */
getPayloadBuilder(int index)1146     public com.google.cloud.automl.v1.AnnotationPayload.Builder getPayloadBuilder(int index) {
1147       return getPayloadFieldBuilder().getBuilder(index);
1148     }
1149     /**
1150      *
1151      *
1152      * <pre>
1153      * Prediction result.
1154      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1155      * return precisely one payload.
1156      * </pre>
1157      *
1158      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1159      */
getPayloadOrBuilder(int index)1160     public com.google.cloud.automl.v1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index) {
1161       if (payloadBuilder_ == null) {
1162         return payload_.get(index);
1163       } else {
1164         return payloadBuilder_.getMessageOrBuilder(index);
1165       }
1166     }
1167     /**
1168      *
1169      *
1170      * <pre>
1171      * Prediction result.
1172      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1173      * return precisely one payload.
1174      * </pre>
1175      *
1176      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1177      */
1178     public java.util.List<? extends com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadOrBuilderList()1179         getPayloadOrBuilderList() {
1180       if (payloadBuilder_ != null) {
1181         return payloadBuilder_.getMessageOrBuilderList();
1182       } else {
1183         return java.util.Collections.unmodifiableList(payload_);
1184       }
1185     }
1186     /**
1187      *
1188      *
1189      * <pre>
1190      * Prediction result.
1191      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1192      * return precisely one payload.
1193      * </pre>
1194      *
1195      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1196      */
addPayloadBuilder()1197     public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder() {
1198       return getPayloadFieldBuilder()
1199           .addBuilder(com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance());
1200     }
1201     /**
1202      *
1203      *
1204      * <pre>
1205      * Prediction result.
1206      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1207      * return precisely one payload.
1208      * </pre>
1209      *
1210      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1211      */
addPayloadBuilder(int index)1212     public com.google.cloud.automl.v1.AnnotationPayload.Builder addPayloadBuilder(int index) {
1213       return getPayloadFieldBuilder()
1214           .addBuilder(index, com.google.cloud.automl.v1.AnnotationPayload.getDefaultInstance());
1215     }
1216     /**
1217      *
1218      *
1219      * <pre>
1220      * Prediction result.
1221      * AutoML Translation and AutoML Natural Language Sentiment Analysis
1222      * return precisely one payload.
1223      * </pre>
1224      *
1225      * <code>repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;</code>
1226      */
1227     public java.util.List<com.google.cloud.automl.v1.AnnotationPayload.Builder>
getPayloadBuilderList()1228         getPayloadBuilderList() {
1229       return getPayloadFieldBuilder().getBuilderList();
1230     }
1231 
1232     private com.google.protobuf.RepeatedFieldBuilderV3<
1233             com.google.cloud.automl.v1.AnnotationPayload,
1234             com.google.cloud.automl.v1.AnnotationPayload.Builder,
1235             com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>
getPayloadFieldBuilder()1236         getPayloadFieldBuilder() {
1237       if (payloadBuilder_ == null) {
1238         payloadBuilder_ =
1239             new com.google.protobuf.RepeatedFieldBuilderV3<
1240                 com.google.cloud.automl.v1.AnnotationPayload,
1241                 com.google.cloud.automl.v1.AnnotationPayload.Builder,
1242                 com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>(
1243                 payload_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
1244         payload_ = null;
1245       }
1246       return payloadBuilder_;
1247     }
1248 
1249     private com.google.cloud.automl.v1.ExamplePayload preprocessedInput_;
1250     private com.google.protobuf.SingleFieldBuilderV3<
1251             com.google.cloud.automl.v1.ExamplePayload,
1252             com.google.cloud.automl.v1.ExamplePayload.Builder,
1253             com.google.cloud.automl.v1.ExamplePayloadOrBuilder>
1254         preprocessedInputBuilder_;
1255     /**
1256      *
1257      *
1258      * <pre>
1259      * The preprocessed example that AutoML actually makes prediction on.
1260      * Empty if AutoML does not preprocess the input example.
1261      * For AutoML Natural Language (Classification, Entity Extraction, and
1262      * Sentiment Analysis), if the input is a document, the recognized text is
1263      * returned in the
1264      * [document_text][google.cloud.automl.v1.Document.document_text]
1265      * property.
1266      * </pre>
1267      *
1268      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1269      *
1270      * @return Whether the preprocessedInput field is set.
1271      */
hasPreprocessedInput()1272     public boolean hasPreprocessedInput() {
1273       return ((bitField0_ & 0x00000002) != 0);
1274     }
1275     /**
1276      *
1277      *
1278      * <pre>
1279      * The preprocessed example that AutoML actually makes prediction on.
1280      * Empty if AutoML does not preprocess the input example.
1281      * For AutoML Natural Language (Classification, Entity Extraction, and
1282      * Sentiment Analysis), if the input is a document, the recognized text is
1283      * returned in the
1284      * [document_text][google.cloud.automl.v1.Document.document_text]
1285      * property.
1286      * </pre>
1287      *
1288      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1289      *
1290      * @return The preprocessedInput.
1291      */
getPreprocessedInput()1292     public com.google.cloud.automl.v1.ExamplePayload getPreprocessedInput() {
1293       if (preprocessedInputBuilder_ == null) {
1294         return preprocessedInput_ == null
1295             ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
1296             : preprocessedInput_;
1297       } else {
1298         return preprocessedInputBuilder_.getMessage();
1299       }
1300     }
1301     /**
1302      *
1303      *
1304      * <pre>
1305      * The preprocessed example that AutoML actually makes prediction on.
1306      * Empty if AutoML does not preprocess the input example.
1307      * For AutoML Natural Language (Classification, Entity Extraction, and
1308      * Sentiment Analysis), if the input is a document, the recognized text is
1309      * returned in the
1310      * [document_text][google.cloud.automl.v1.Document.document_text]
1311      * property.
1312      * </pre>
1313      *
1314      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1315      */
setPreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value)1316     public Builder setPreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) {
1317       if (preprocessedInputBuilder_ == null) {
1318         if (value == null) {
1319           throw new NullPointerException();
1320         }
1321         preprocessedInput_ = value;
1322       } else {
1323         preprocessedInputBuilder_.setMessage(value);
1324       }
1325       bitField0_ |= 0x00000002;
1326       onChanged();
1327       return this;
1328     }
1329     /**
1330      *
1331      *
1332      * <pre>
1333      * The preprocessed example that AutoML actually makes prediction on.
1334      * Empty if AutoML does not preprocess the input example.
1335      * For AutoML Natural Language (Classification, Entity Extraction, and
1336      * Sentiment Analysis), if the input is a document, the recognized text is
1337      * returned in the
1338      * [document_text][google.cloud.automl.v1.Document.document_text]
1339      * property.
1340      * </pre>
1341      *
1342      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1343      */
setPreprocessedInput( com.google.cloud.automl.v1.ExamplePayload.Builder builderForValue)1344     public Builder setPreprocessedInput(
1345         com.google.cloud.automl.v1.ExamplePayload.Builder builderForValue) {
1346       if (preprocessedInputBuilder_ == null) {
1347         preprocessedInput_ = builderForValue.build();
1348       } else {
1349         preprocessedInputBuilder_.setMessage(builderForValue.build());
1350       }
1351       bitField0_ |= 0x00000002;
1352       onChanged();
1353       return this;
1354     }
1355     /**
1356      *
1357      *
1358      * <pre>
1359      * The preprocessed example that AutoML actually makes prediction on.
1360      * Empty if AutoML does not preprocess the input example.
1361      * For AutoML Natural Language (Classification, Entity Extraction, and
1362      * Sentiment Analysis), if the input is a document, the recognized text is
1363      * returned in the
1364      * [document_text][google.cloud.automl.v1.Document.document_text]
1365      * property.
1366      * </pre>
1367      *
1368      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1369      */
mergePreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value)1370     public Builder mergePreprocessedInput(com.google.cloud.automl.v1.ExamplePayload value) {
1371       if (preprocessedInputBuilder_ == null) {
1372         if (((bitField0_ & 0x00000002) != 0)
1373             && preprocessedInput_ != null
1374             && preprocessedInput_
1375                 != com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()) {
1376           getPreprocessedInputBuilder().mergeFrom(value);
1377         } else {
1378           preprocessedInput_ = value;
1379         }
1380       } else {
1381         preprocessedInputBuilder_.mergeFrom(value);
1382       }
1383       bitField0_ |= 0x00000002;
1384       onChanged();
1385       return this;
1386     }
1387     /**
1388      *
1389      *
1390      * <pre>
1391      * The preprocessed example that AutoML actually makes prediction on.
1392      * Empty if AutoML does not preprocess the input example.
1393      * For AutoML Natural Language (Classification, Entity Extraction, and
1394      * Sentiment Analysis), if the input is a document, the recognized text is
1395      * returned in the
1396      * [document_text][google.cloud.automl.v1.Document.document_text]
1397      * property.
1398      * </pre>
1399      *
1400      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1401      */
clearPreprocessedInput()1402     public Builder clearPreprocessedInput() {
1403       bitField0_ = (bitField0_ & ~0x00000002);
1404       preprocessedInput_ = null;
1405       if (preprocessedInputBuilder_ != null) {
1406         preprocessedInputBuilder_.dispose();
1407         preprocessedInputBuilder_ = null;
1408       }
1409       onChanged();
1410       return this;
1411     }
1412     /**
1413      *
1414      *
1415      * <pre>
1416      * The preprocessed example that AutoML actually makes prediction on.
1417      * Empty if AutoML does not preprocess the input example.
1418      * For AutoML Natural Language (Classification, Entity Extraction, and
1419      * Sentiment Analysis), if the input is a document, the recognized text is
1420      * returned in the
1421      * [document_text][google.cloud.automl.v1.Document.document_text]
1422      * property.
1423      * </pre>
1424      *
1425      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1426      */
getPreprocessedInputBuilder()1427     public com.google.cloud.automl.v1.ExamplePayload.Builder getPreprocessedInputBuilder() {
1428       bitField0_ |= 0x00000002;
1429       onChanged();
1430       return getPreprocessedInputFieldBuilder().getBuilder();
1431     }
1432     /**
1433      *
1434      *
1435      * <pre>
1436      * The preprocessed example that AutoML actually makes prediction on.
1437      * Empty if AutoML does not preprocess the input example.
1438      * For AutoML Natural Language (Classification, Entity Extraction, and
1439      * Sentiment Analysis), if the input is a document, the recognized text is
1440      * returned in the
1441      * [document_text][google.cloud.automl.v1.Document.document_text]
1442      * property.
1443      * </pre>
1444      *
1445      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1446      */
getPreprocessedInputOrBuilder()1447     public com.google.cloud.automl.v1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() {
1448       if (preprocessedInputBuilder_ != null) {
1449         return preprocessedInputBuilder_.getMessageOrBuilder();
1450       } else {
1451         return preprocessedInput_ == null
1452             ? com.google.cloud.automl.v1.ExamplePayload.getDefaultInstance()
1453             : preprocessedInput_;
1454       }
1455     }
1456     /**
1457      *
1458      *
1459      * <pre>
1460      * The preprocessed example that AutoML actually makes prediction on.
1461      * Empty if AutoML does not preprocess the input example.
1462      * For AutoML Natural Language (Classification, Entity Extraction, and
1463      * Sentiment Analysis), if the input is a document, the recognized text is
1464      * returned in the
1465      * [document_text][google.cloud.automl.v1.Document.document_text]
1466      * property.
1467      * </pre>
1468      *
1469      * <code>.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;</code>
1470      */
1471     private com.google.protobuf.SingleFieldBuilderV3<
1472             com.google.cloud.automl.v1.ExamplePayload,
1473             com.google.cloud.automl.v1.ExamplePayload.Builder,
1474             com.google.cloud.automl.v1.ExamplePayloadOrBuilder>
getPreprocessedInputFieldBuilder()1475         getPreprocessedInputFieldBuilder() {
1476       if (preprocessedInputBuilder_ == null) {
1477         preprocessedInputBuilder_ =
1478             new com.google.protobuf.SingleFieldBuilderV3<
1479                 com.google.cloud.automl.v1.ExamplePayload,
1480                 com.google.cloud.automl.v1.ExamplePayload.Builder,
1481                 com.google.cloud.automl.v1.ExamplePayloadOrBuilder>(
1482                 getPreprocessedInput(), getParentForChildren(), isClean());
1483         preprocessedInput_ = null;
1484       }
1485       return preprocessedInputBuilder_;
1486     }
1487 
1488     private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;
1489 
internalGetMetadata()1490     private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
1491       if (metadata_ == null) {
1492         return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
1493       }
1494       return metadata_;
1495     }
1496 
1497     private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableMetadata()1498         internalGetMutableMetadata() {
1499       if (metadata_ == null) {
1500         metadata_ =
1501             com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
1502       }
1503       if (!metadata_.isMutable()) {
1504         metadata_ = metadata_.copy();
1505       }
1506       bitField0_ |= 0x00000004;
1507       onChanged();
1508       return metadata_;
1509     }
1510 
getMetadataCount()1511     public int getMetadataCount() {
1512       return internalGetMetadata().getMap().size();
1513     }
1514     /**
1515      *
1516      *
1517      * <pre>
1518      * Additional domain-specific prediction response metadata.
1519      * AutoML Vision Object Detection
1520      * `max_bounding_box_count`
1521      * : (int64) The maximum number of bounding boxes to return per image.
1522      * AutoML Natural Language Sentiment Analysis
1523      * `sentiment_score`
1524      * : (float, deprecated) A value between -1 and 1,
1525      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1526      *   one and the higher the score, the more positive the sentiment in the
1527      *   document is. Yet these values are relative to the training data, so
1528      *   e.g. if all data was positive then -1 is also positive (though
1529      *   the least).
1530      *   `sentiment_score` is not the same as "score" and "magnitude"
1531      *   from Sentiment Analysis in the Natural Language API.
1532      * </pre>
1533      *
1534      * <code>map&lt;string, string&gt; metadata = 2;</code>
1535      */
1536     @java.lang.Override
containsMetadata(java.lang.String key)1537     public boolean containsMetadata(java.lang.String key) {
1538       if (key == null) {
1539         throw new NullPointerException("map key");
1540       }
1541       return internalGetMetadata().getMap().containsKey(key);
1542     }
1543     /** Use {@link #getMetadataMap()} instead. */
1544     @java.lang.Override
1545     @java.lang.Deprecated
getMetadata()1546     public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
1547       return getMetadataMap();
1548     }
1549     /**
1550      *
1551      *
1552      * <pre>
1553      * Additional domain-specific prediction response metadata.
1554      * AutoML Vision Object Detection
1555      * `max_bounding_box_count`
1556      * : (int64) The maximum number of bounding boxes to return per image.
1557      * AutoML Natural Language Sentiment Analysis
1558      * `sentiment_score`
1559      * : (float, deprecated) A value between -1 and 1,
1560      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1561      *   one and the higher the score, the more positive the sentiment in the
1562      *   document is. Yet these values are relative to the training data, so
1563      *   e.g. if all data was positive then -1 is also positive (though
1564      *   the least).
1565      *   `sentiment_score` is not the same as "score" and "magnitude"
1566      *   from Sentiment Analysis in the Natural Language API.
1567      * </pre>
1568      *
1569      * <code>map&lt;string, string&gt; metadata = 2;</code>
1570      */
1571     @java.lang.Override
getMetadataMap()1572     public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
1573       return internalGetMetadata().getMap();
1574     }
1575     /**
1576      *
1577      *
1578      * <pre>
1579      * Additional domain-specific prediction response metadata.
1580      * AutoML Vision Object Detection
1581      * `max_bounding_box_count`
1582      * : (int64) The maximum number of bounding boxes to return per image.
1583      * AutoML Natural Language Sentiment Analysis
1584      * `sentiment_score`
1585      * : (float, deprecated) A value between -1 and 1,
1586      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1587      *   one and the higher the score, the more positive the sentiment in the
1588      *   document is. Yet these values are relative to the training data, so
1589      *   e.g. if all data was positive then -1 is also positive (though
1590      *   the least).
1591      *   `sentiment_score` is not the same as "score" and "magnitude"
1592      *   from Sentiment Analysis in the Natural Language API.
1593      * </pre>
1594      *
1595      * <code>map&lt;string, string&gt; metadata = 2;</code>
1596      */
1597     @java.lang.Override
getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue)1598     public /* nullable */ java.lang.String getMetadataOrDefault(
1599         java.lang.String key,
1600         /* nullable */
1601         java.lang.String defaultValue) {
1602       if (key == null) {
1603         throw new NullPointerException("map key");
1604       }
1605       java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
1606       return map.containsKey(key) ? map.get(key) : defaultValue;
1607     }
1608     /**
1609      *
1610      *
1611      * <pre>
1612      * Additional domain-specific prediction response metadata.
1613      * AutoML Vision Object Detection
1614      * `max_bounding_box_count`
1615      * : (int64) The maximum number of bounding boxes to return per image.
1616      * AutoML Natural Language Sentiment Analysis
1617      * `sentiment_score`
1618      * : (float, deprecated) A value between -1 and 1,
1619      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1620      *   one and the higher the score, the more positive the sentiment in the
1621      *   document is. Yet these values are relative to the training data, so
1622      *   e.g. if all data was positive then -1 is also positive (though
1623      *   the least).
1624      *   `sentiment_score` is not the same as "score" and "magnitude"
1625      *   from Sentiment Analysis in the Natural Language API.
1626      * </pre>
1627      *
1628      * <code>map&lt;string, string&gt; metadata = 2;</code>
1629      */
1630     @java.lang.Override
getMetadataOrThrow(java.lang.String key)1631     public java.lang.String getMetadataOrThrow(java.lang.String key) {
1632       if (key == null) {
1633         throw new NullPointerException("map key");
1634       }
1635       java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
1636       if (!map.containsKey(key)) {
1637         throw new java.lang.IllegalArgumentException();
1638       }
1639       return map.get(key);
1640     }
1641 
clearMetadata()1642     public Builder clearMetadata() {
1643       bitField0_ = (bitField0_ & ~0x00000004);
1644       internalGetMutableMetadata().getMutableMap().clear();
1645       return this;
1646     }
1647     /**
1648      *
1649      *
1650      * <pre>
1651      * Additional domain-specific prediction response metadata.
1652      * AutoML Vision Object Detection
1653      * `max_bounding_box_count`
1654      * : (int64) The maximum number of bounding boxes to return per image.
1655      * AutoML Natural Language Sentiment Analysis
1656      * `sentiment_score`
1657      * : (float, deprecated) A value between -1 and 1,
1658      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1659      *   one and the higher the score, the more positive the sentiment in the
1660      *   document is. Yet these values are relative to the training data, so
1661      *   e.g. if all data was positive then -1 is also positive (though
1662      *   the least).
1663      *   `sentiment_score` is not the same as "score" and "magnitude"
1664      *   from Sentiment Analysis in the Natural Language API.
1665      * </pre>
1666      *
1667      * <code>map&lt;string, string&gt; metadata = 2;</code>
1668      */
removeMetadata(java.lang.String key)1669     public Builder removeMetadata(java.lang.String key) {
1670       if (key == null) {
1671         throw new NullPointerException("map key");
1672       }
1673       internalGetMutableMetadata().getMutableMap().remove(key);
1674       return this;
1675     }
1676     /** Use alternate mutation accessors instead. */
1677     @java.lang.Deprecated
getMutableMetadata()1678     public java.util.Map<java.lang.String, java.lang.String> getMutableMetadata() {
1679       bitField0_ |= 0x00000004;
1680       return internalGetMutableMetadata().getMutableMap();
1681     }
1682     /**
1683      *
1684      *
1685      * <pre>
1686      * Additional domain-specific prediction response metadata.
1687      * AutoML Vision Object Detection
1688      * `max_bounding_box_count`
1689      * : (int64) The maximum number of bounding boxes to return per image.
1690      * AutoML Natural Language Sentiment Analysis
1691      * `sentiment_score`
1692      * : (float, deprecated) A value between -1 and 1,
1693      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1694      *   one and the higher the score, the more positive the sentiment in the
1695      *   document is. Yet these values are relative to the training data, so
1696      *   e.g. if all data was positive then -1 is also positive (though
1697      *   the least).
1698      *   `sentiment_score` is not the same as "score" and "magnitude"
1699      *   from Sentiment Analysis in the Natural Language API.
1700      * </pre>
1701      *
1702      * <code>map&lt;string, string&gt; metadata = 2;</code>
1703      */
putMetadata(java.lang.String key, java.lang.String value)1704     public Builder putMetadata(java.lang.String key, java.lang.String value) {
1705       if (key == null) {
1706         throw new NullPointerException("map key");
1707       }
1708       if (value == null) {
1709         throw new NullPointerException("map value");
1710       }
1711       internalGetMutableMetadata().getMutableMap().put(key, value);
1712       bitField0_ |= 0x00000004;
1713       return this;
1714     }
1715     /**
1716      *
1717      *
1718      * <pre>
1719      * Additional domain-specific prediction response metadata.
1720      * AutoML Vision Object Detection
1721      * `max_bounding_box_count`
1722      * : (int64) The maximum number of bounding boxes to return per image.
1723      * AutoML Natural Language Sentiment Analysis
1724      * `sentiment_score`
1725      * : (float, deprecated) A value between -1 and 1,
1726      *   -1 maps to least positive sentiment, while 1 maps to the most positive
1727      *   one and the higher the score, the more positive the sentiment in the
1728      *   document is. Yet these values are relative to the training data, so
1729      *   e.g. if all data was positive then -1 is also positive (though
1730      *   the least).
1731      *   `sentiment_score` is not the same as "score" and "magnitude"
1732      *   from Sentiment Analysis in the Natural Language API.
1733      * </pre>
1734      *
1735      * <code>map&lt;string, string&gt; metadata = 2;</code>
1736      */
putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values)1737     public Builder putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values) {
1738       internalGetMutableMetadata().getMutableMap().putAll(values);
1739       bitField0_ |= 0x00000004;
1740       return this;
1741     }
1742 
1743     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1744     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1745       return super.setUnknownFields(unknownFields);
1746     }
1747 
1748     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1749     public final Builder mergeUnknownFields(
1750         final com.google.protobuf.UnknownFieldSet unknownFields) {
1751       return super.mergeUnknownFields(unknownFields);
1752     }
1753 
1754     // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.PredictResponse)
1755   }
1756 
1757   // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.PredictResponse)
1758   private static final com.google.cloud.automl.v1.PredictResponse DEFAULT_INSTANCE;
1759 
1760   static {
1761     DEFAULT_INSTANCE = new com.google.cloud.automl.v1.PredictResponse();
1762   }
1763 
getDefaultInstance()1764   public static com.google.cloud.automl.v1.PredictResponse getDefaultInstance() {
1765     return DEFAULT_INSTANCE;
1766   }
1767 
1768   private static final com.google.protobuf.Parser<PredictResponse> PARSER =
1769       new com.google.protobuf.AbstractParser<PredictResponse>() {
1770         @java.lang.Override
1771         public PredictResponse parsePartialFrom(
1772             com.google.protobuf.CodedInputStream input,
1773             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1774             throws com.google.protobuf.InvalidProtocolBufferException {
1775           Builder builder = newBuilder();
1776           try {
1777             builder.mergeFrom(input, extensionRegistry);
1778           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1779             throw e.setUnfinishedMessage(builder.buildPartial());
1780           } catch (com.google.protobuf.UninitializedMessageException e) {
1781             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1782           } catch (java.io.IOException e) {
1783             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1784                 .setUnfinishedMessage(builder.buildPartial());
1785           }
1786           return builder.buildPartial();
1787         }
1788       };
1789 
parser()1790   public static com.google.protobuf.Parser<PredictResponse> parser() {
1791     return PARSER;
1792   }
1793 
1794   @java.lang.Override
getParserForType()1795   public com.google.protobuf.Parser<PredictResponse> getParserForType() {
1796     return PARSER;
1797   }
1798 
1799   @java.lang.Override
getDefaultInstanceForType()1800   public com.google.cloud.automl.v1.PredictResponse getDefaultInstanceForType() {
1801     return DEFAULT_INSTANCE;
1802   }
1803 }
1804