• 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/vision/v1/image_annotator.proto
18 
19 package com.google.cloud.vision.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Parameters for text detections. This is used to control TEXT_DETECTION and
26  * DOCUMENT_TEXT_DETECTION features.
27  * </pre>
28  *
29  * Protobuf type {@code google.cloud.vision.v1.TextDetectionParams}
30  */
31 public final class TextDetectionParams extends com.google.protobuf.GeneratedMessageV3
32     implements
33     // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.TextDetectionParams)
34     TextDetectionParamsOrBuilder {
35   private static final long serialVersionUID = 0L;
36   // Use TextDetectionParams.newBuilder() to construct.
TextDetectionParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37   private TextDetectionParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
38     super(builder);
39   }
40 
TextDetectionParams()41   private TextDetectionParams() {
42     advancedOcrOptions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new TextDetectionParams();
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.vision.v1.ImageAnnotatorProto
58         .internal_static_google_cloud_vision_v1_TextDetectionParams_descriptor;
59   }
60 
61   @java.lang.Override
62   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()63       internalGetFieldAccessorTable() {
64     return com.google.cloud.vision.v1.ImageAnnotatorProto
65         .internal_static_google_cloud_vision_v1_TextDetectionParams_fieldAccessorTable
66         .ensureFieldAccessorsInitialized(
67             com.google.cloud.vision.v1.TextDetectionParams.class,
68             com.google.cloud.vision.v1.TextDetectionParams.Builder.class);
69   }
70 
71   public static final int ENABLE_TEXT_DETECTION_CONFIDENCE_SCORE_FIELD_NUMBER = 9;
72   private boolean enableTextDetectionConfidenceScore_ = false;
73   /**
74    *
75    *
76    * <pre>
77    * By default, Cloud Vision API only includes confidence score for
78    * DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
79    * score for TEXT_DETECTION as well.
80    * </pre>
81    *
82    * <code>bool enable_text_detection_confidence_score = 9;</code>
83    *
84    * @return The enableTextDetectionConfidenceScore.
85    */
86   @java.lang.Override
getEnableTextDetectionConfidenceScore()87   public boolean getEnableTextDetectionConfidenceScore() {
88     return enableTextDetectionConfidenceScore_;
89   }
90 
91   public static final int ADVANCED_OCR_OPTIONS_FIELD_NUMBER = 11;
92 
93   @SuppressWarnings("serial")
94   private com.google.protobuf.LazyStringList advancedOcrOptions_;
95   /**
96    *
97    *
98    * <pre>
99    * A list of advanced OCR options to fine-tune OCR behavior.
100    * </pre>
101    *
102    * <code>repeated string advanced_ocr_options = 11;</code>
103    *
104    * @return A list containing the advancedOcrOptions.
105    */
getAdvancedOcrOptionsList()106   public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList() {
107     return advancedOcrOptions_;
108   }
109   /**
110    *
111    *
112    * <pre>
113    * A list of advanced OCR options to fine-tune OCR behavior.
114    * </pre>
115    *
116    * <code>repeated string advanced_ocr_options = 11;</code>
117    *
118    * @return The count of advancedOcrOptions.
119    */
getAdvancedOcrOptionsCount()120   public int getAdvancedOcrOptionsCount() {
121     return advancedOcrOptions_.size();
122   }
123   /**
124    *
125    *
126    * <pre>
127    * A list of advanced OCR options to fine-tune OCR behavior.
128    * </pre>
129    *
130    * <code>repeated string advanced_ocr_options = 11;</code>
131    *
132    * @param index The index of the element to return.
133    * @return The advancedOcrOptions at the given index.
134    */
getAdvancedOcrOptions(int index)135   public java.lang.String getAdvancedOcrOptions(int index) {
136     return advancedOcrOptions_.get(index);
137   }
138   /**
139    *
140    *
141    * <pre>
142    * A list of advanced OCR options to fine-tune OCR behavior.
143    * </pre>
144    *
145    * <code>repeated string advanced_ocr_options = 11;</code>
146    *
147    * @param index The index of the value to return.
148    * @return The bytes of the advancedOcrOptions at the given index.
149    */
getAdvancedOcrOptionsBytes(int index)150   public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index) {
151     return advancedOcrOptions_.getByteString(index);
152   }
153 
154   private byte memoizedIsInitialized = -1;
155 
156   @java.lang.Override
isInitialized()157   public final boolean isInitialized() {
158     byte isInitialized = memoizedIsInitialized;
159     if (isInitialized == 1) return true;
160     if (isInitialized == 0) return false;
161 
162     memoizedIsInitialized = 1;
163     return true;
164   }
165 
166   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)167   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
168     if (enableTextDetectionConfidenceScore_ != false) {
169       output.writeBool(9, enableTextDetectionConfidenceScore_);
170     }
171     for (int i = 0; i < advancedOcrOptions_.size(); i++) {
172       com.google.protobuf.GeneratedMessageV3.writeString(output, 11, advancedOcrOptions_.getRaw(i));
173     }
174     getUnknownFields().writeTo(output);
175   }
176 
177   @java.lang.Override
getSerializedSize()178   public int getSerializedSize() {
179     int size = memoizedSize;
180     if (size != -1) return size;
181 
182     size = 0;
183     if (enableTextDetectionConfidenceScore_ != false) {
184       size +=
185           com.google.protobuf.CodedOutputStream.computeBoolSize(
186               9, enableTextDetectionConfidenceScore_);
187     }
188     {
189       int dataSize = 0;
190       for (int i = 0; i < advancedOcrOptions_.size(); i++) {
191         dataSize += computeStringSizeNoTag(advancedOcrOptions_.getRaw(i));
192       }
193       size += dataSize;
194       size += 1 * getAdvancedOcrOptionsList().size();
195     }
196     size += getUnknownFields().getSerializedSize();
197     memoizedSize = size;
198     return size;
199   }
200 
201   @java.lang.Override
equals(final java.lang.Object obj)202   public boolean equals(final java.lang.Object obj) {
203     if (obj == this) {
204       return true;
205     }
206     if (!(obj instanceof com.google.cloud.vision.v1.TextDetectionParams)) {
207       return super.equals(obj);
208     }
209     com.google.cloud.vision.v1.TextDetectionParams other =
210         (com.google.cloud.vision.v1.TextDetectionParams) obj;
211 
212     if (getEnableTextDetectionConfidenceScore() != other.getEnableTextDetectionConfidenceScore())
213       return false;
214     if (!getAdvancedOcrOptionsList().equals(other.getAdvancedOcrOptionsList())) return false;
215     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
216     return true;
217   }
218 
219   @java.lang.Override
hashCode()220   public int hashCode() {
221     if (memoizedHashCode != 0) {
222       return memoizedHashCode;
223     }
224     int hash = 41;
225     hash = (19 * hash) + getDescriptor().hashCode();
226     hash = (37 * hash) + ENABLE_TEXT_DETECTION_CONFIDENCE_SCORE_FIELD_NUMBER;
227     hash =
228         (53 * hash)
229             + com.google.protobuf.Internal.hashBoolean(getEnableTextDetectionConfidenceScore());
230     if (getAdvancedOcrOptionsCount() > 0) {
231       hash = (37 * hash) + ADVANCED_OCR_OPTIONS_FIELD_NUMBER;
232       hash = (53 * hash) + getAdvancedOcrOptionsList().hashCode();
233     }
234     hash = (29 * hash) + getUnknownFields().hashCode();
235     memoizedHashCode = hash;
236     return hash;
237   }
238 
parseFrom(java.nio.ByteBuffer data)239   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(java.nio.ByteBuffer data)
240       throws com.google.protobuf.InvalidProtocolBufferException {
241     return PARSER.parseFrom(data);
242   }
243 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)244   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
245       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
246       throws com.google.protobuf.InvalidProtocolBufferException {
247     return PARSER.parseFrom(data, extensionRegistry);
248   }
249 
parseFrom( com.google.protobuf.ByteString data)250   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
251       com.google.protobuf.ByteString data)
252       throws com.google.protobuf.InvalidProtocolBufferException {
253     return PARSER.parseFrom(data);
254   }
255 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)256   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
257       com.google.protobuf.ByteString data,
258       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
259       throws com.google.protobuf.InvalidProtocolBufferException {
260     return PARSER.parseFrom(data, extensionRegistry);
261   }
262 
parseFrom(byte[] data)263   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(byte[] data)
264       throws com.google.protobuf.InvalidProtocolBufferException {
265     return PARSER.parseFrom(data);
266   }
267 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)268   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
269       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
270       throws com.google.protobuf.InvalidProtocolBufferException {
271     return PARSER.parseFrom(data, extensionRegistry);
272   }
273 
parseFrom(java.io.InputStream input)274   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(java.io.InputStream input)
275       throws java.io.IOException {
276     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
277   }
278 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)279   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
280       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
281       throws java.io.IOException {
282     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
283         PARSER, input, extensionRegistry);
284   }
285 
parseDelimitedFrom( java.io.InputStream input)286   public static com.google.cloud.vision.v1.TextDetectionParams parseDelimitedFrom(
287       java.io.InputStream input) throws java.io.IOException {
288     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
289   }
290 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)291   public static com.google.cloud.vision.v1.TextDetectionParams parseDelimitedFrom(
292       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
293       throws java.io.IOException {
294     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
295         PARSER, input, extensionRegistry);
296   }
297 
parseFrom( com.google.protobuf.CodedInputStream input)298   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
299       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
300     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
301   }
302 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)303   public static com.google.cloud.vision.v1.TextDetectionParams parseFrom(
304       com.google.protobuf.CodedInputStream input,
305       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306       throws java.io.IOException {
307     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
308         PARSER, input, extensionRegistry);
309   }
310 
311   @java.lang.Override
newBuilderForType()312   public Builder newBuilderForType() {
313     return newBuilder();
314   }
315 
newBuilder()316   public static Builder newBuilder() {
317     return DEFAULT_INSTANCE.toBuilder();
318   }
319 
newBuilder(com.google.cloud.vision.v1.TextDetectionParams prototype)320   public static Builder newBuilder(com.google.cloud.vision.v1.TextDetectionParams prototype) {
321     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
322   }
323 
324   @java.lang.Override
toBuilder()325   public Builder toBuilder() {
326     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
327   }
328 
329   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)330   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
331     Builder builder = new Builder(parent);
332     return builder;
333   }
334   /**
335    *
336    *
337    * <pre>
338    * Parameters for text detections. This is used to control TEXT_DETECTION and
339    * DOCUMENT_TEXT_DETECTION features.
340    * </pre>
341    *
342    * Protobuf type {@code google.cloud.vision.v1.TextDetectionParams}
343    */
344   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
345       implements
346       // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.TextDetectionParams)
347       com.google.cloud.vision.v1.TextDetectionParamsOrBuilder {
getDescriptor()348     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
349       return com.google.cloud.vision.v1.ImageAnnotatorProto
350           .internal_static_google_cloud_vision_v1_TextDetectionParams_descriptor;
351     }
352 
353     @java.lang.Override
354     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()355         internalGetFieldAccessorTable() {
356       return com.google.cloud.vision.v1.ImageAnnotatorProto
357           .internal_static_google_cloud_vision_v1_TextDetectionParams_fieldAccessorTable
358           .ensureFieldAccessorsInitialized(
359               com.google.cloud.vision.v1.TextDetectionParams.class,
360               com.google.cloud.vision.v1.TextDetectionParams.Builder.class);
361     }
362 
363     // Construct using com.google.cloud.vision.v1.TextDetectionParams.newBuilder()
Builder()364     private Builder() {}
365 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)366     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
367       super(parent);
368     }
369 
370     @java.lang.Override
clear()371     public Builder clear() {
372       super.clear();
373       bitField0_ = 0;
374       enableTextDetectionConfidenceScore_ = false;
375       advancedOcrOptions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
376       bitField0_ = (bitField0_ & ~0x00000002);
377       return this;
378     }
379 
380     @java.lang.Override
getDescriptorForType()381     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
382       return com.google.cloud.vision.v1.ImageAnnotatorProto
383           .internal_static_google_cloud_vision_v1_TextDetectionParams_descriptor;
384     }
385 
386     @java.lang.Override
getDefaultInstanceForType()387     public com.google.cloud.vision.v1.TextDetectionParams getDefaultInstanceForType() {
388       return com.google.cloud.vision.v1.TextDetectionParams.getDefaultInstance();
389     }
390 
391     @java.lang.Override
build()392     public com.google.cloud.vision.v1.TextDetectionParams build() {
393       com.google.cloud.vision.v1.TextDetectionParams result = buildPartial();
394       if (!result.isInitialized()) {
395         throw newUninitializedMessageException(result);
396       }
397       return result;
398     }
399 
400     @java.lang.Override
buildPartial()401     public com.google.cloud.vision.v1.TextDetectionParams buildPartial() {
402       com.google.cloud.vision.v1.TextDetectionParams result =
403           new com.google.cloud.vision.v1.TextDetectionParams(this);
404       buildPartialRepeatedFields(result);
405       if (bitField0_ != 0) {
406         buildPartial0(result);
407       }
408       onBuilt();
409       return result;
410     }
411 
buildPartialRepeatedFields(com.google.cloud.vision.v1.TextDetectionParams result)412     private void buildPartialRepeatedFields(com.google.cloud.vision.v1.TextDetectionParams result) {
413       if (((bitField0_ & 0x00000002) != 0)) {
414         advancedOcrOptions_ = advancedOcrOptions_.getUnmodifiableView();
415         bitField0_ = (bitField0_ & ~0x00000002);
416       }
417       result.advancedOcrOptions_ = advancedOcrOptions_;
418     }
419 
buildPartial0(com.google.cloud.vision.v1.TextDetectionParams result)420     private void buildPartial0(com.google.cloud.vision.v1.TextDetectionParams result) {
421       int from_bitField0_ = bitField0_;
422       if (((from_bitField0_ & 0x00000001) != 0)) {
423         result.enableTextDetectionConfidenceScore_ = enableTextDetectionConfidenceScore_;
424       }
425     }
426 
427     @java.lang.Override
clone()428     public Builder clone() {
429       return super.clone();
430     }
431 
432     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)433     public Builder setField(
434         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
435       return super.setField(field, value);
436     }
437 
438     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)439     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
440       return super.clearField(field);
441     }
442 
443     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)444     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
445       return super.clearOneof(oneof);
446     }
447 
448     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)449     public Builder setRepeatedField(
450         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
451       return super.setRepeatedField(field, index, value);
452     }
453 
454     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)455     public Builder addRepeatedField(
456         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
457       return super.addRepeatedField(field, value);
458     }
459 
460     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)461     public Builder mergeFrom(com.google.protobuf.Message other) {
462       if (other instanceof com.google.cloud.vision.v1.TextDetectionParams) {
463         return mergeFrom((com.google.cloud.vision.v1.TextDetectionParams) other);
464       } else {
465         super.mergeFrom(other);
466         return this;
467       }
468     }
469 
mergeFrom(com.google.cloud.vision.v1.TextDetectionParams other)470     public Builder mergeFrom(com.google.cloud.vision.v1.TextDetectionParams other) {
471       if (other == com.google.cloud.vision.v1.TextDetectionParams.getDefaultInstance()) return this;
472       if (other.getEnableTextDetectionConfidenceScore() != false) {
473         setEnableTextDetectionConfidenceScore(other.getEnableTextDetectionConfidenceScore());
474       }
475       if (!other.advancedOcrOptions_.isEmpty()) {
476         if (advancedOcrOptions_.isEmpty()) {
477           advancedOcrOptions_ = other.advancedOcrOptions_;
478           bitField0_ = (bitField0_ & ~0x00000002);
479         } else {
480           ensureAdvancedOcrOptionsIsMutable();
481           advancedOcrOptions_.addAll(other.advancedOcrOptions_);
482         }
483         onChanged();
484       }
485       this.mergeUnknownFields(other.getUnknownFields());
486       onChanged();
487       return this;
488     }
489 
490     @java.lang.Override
isInitialized()491     public final boolean isInitialized() {
492       return true;
493     }
494 
495     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)496     public Builder mergeFrom(
497         com.google.protobuf.CodedInputStream input,
498         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
499         throws java.io.IOException {
500       if (extensionRegistry == null) {
501         throw new java.lang.NullPointerException();
502       }
503       try {
504         boolean done = false;
505         while (!done) {
506           int tag = input.readTag();
507           switch (tag) {
508             case 0:
509               done = true;
510               break;
511             case 72:
512               {
513                 enableTextDetectionConfidenceScore_ = input.readBool();
514                 bitField0_ |= 0x00000001;
515                 break;
516               } // case 72
517             case 90:
518               {
519                 java.lang.String s = input.readStringRequireUtf8();
520                 ensureAdvancedOcrOptionsIsMutable();
521                 advancedOcrOptions_.add(s);
522                 break;
523               } // case 90
524             default:
525               {
526                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
527                   done = true; // was an endgroup tag
528                 }
529                 break;
530               } // default:
531           } // switch (tag)
532         } // while (!done)
533       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
534         throw e.unwrapIOException();
535       } finally {
536         onChanged();
537       } // finally
538       return this;
539     }
540 
541     private int bitField0_;
542 
543     private boolean enableTextDetectionConfidenceScore_;
544     /**
545      *
546      *
547      * <pre>
548      * By default, Cloud Vision API only includes confidence score for
549      * DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
550      * score for TEXT_DETECTION as well.
551      * </pre>
552      *
553      * <code>bool enable_text_detection_confidence_score = 9;</code>
554      *
555      * @return The enableTextDetectionConfidenceScore.
556      */
557     @java.lang.Override
getEnableTextDetectionConfidenceScore()558     public boolean getEnableTextDetectionConfidenceScore() {
559       return enableTextDetectionConfidenceScore_;
560     }
561     /**
562      *
563      *
564      * <pre>
565      * By default, Cloud Vision API only includes confidence score for
566      * DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
567      * score for TEXT_DETECTION as well.
568      * </pre>
569      *
570      * <code>bool enable_text_detection_confidence_score = 9;</code>
571      *
572      * @param value The enableTextDetectionConfidenceScore to set.
573      * @return This builder for chaining.
574      */
setEnableTextDetectionConfidenceScore(boolean value)575     public Builder setEnableTextDetectionConfidenceScore(boolean value) {
576 
577       enableTextDetectionConfidenceScore_ = value;
578       bitField0_ |= 0x00000001;
579       onChanged();
580       return this;
581     }
582     /**
583      *
584      *
585      * <pre>
586      * By default, Cloud Vision API only includes confidence score for
587      * DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
588      * score for TEXT_DETECTION as well.
589      * </pre>
590      *
591      * <code>bool enable_text_detection_confidence_score = 9;</code>
592      *
593      * @return This builder for chaining.
594      */
clearEnableTextDetectionConfidenceScore()595     public Builder clearEnableTextDetectionConfidenceScore() {
596       bitField0_ = (bitField0_ & ~0x00000001);
597       enableTextDetectionConfidenceScore_ = false;
598       onChanged();
599       return this;
600     }
601 
602     private com.google.protobuf.LazyStringList advancedOcrOptions_ =
603         com.google.protobuf.LazyStringArrayList.EMPTY;
604 
ensureAdvancedOcrOptionsIsMutable()605     private void ensureAdvancedOcrOptionsIsMutable() {
606       if (!((bitField0_ & 0x00000002) != 0)) {
607         advancedOcrOptions_ = new com.google.protobuf.LazyStringArrayList(advancedOcrOptions_);
608         bitField0_ |= 0x00000002;
609       }
610     }
611     /**
612      *
613      *
614      * <pre>
615      * A list of advanced OCR options to fine-tune OCR behavior.
616      * </pre>
617      *
618      * <code>repeated string advanced_ocr_options = 11;</code>
619      *
620      * @return A list containing the advancedOcrOptions.
621      */
getAdvancedOcrOptionsList()622     public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList() {
623       return advancedOcrOptions_.getUnmodifiableView();
624     }
625     /**
626      *
627      *
628      * <pre>
629      * A list of advanced OCR options to fine-tune OCR behavior.
630      * </pre>
631      *
632      * <code>repeated string advanced_ocr_options = 11;</code>
633      *
634      * @return The count of advancedOcrOptions.
635      */
getAdvancedOcrOptionsCount()636     public int getAdvancedOcrOptionsCount() {
637       return advancedOcrOptions_.size();
638     }
639     /**
640      *
641      *
642      * <pre>
643      * A list of advanced OCR options to fine-tune OCR behavior.
644      * </pre>
645      *
646      * <code>repeated string advanced_ocr_options = 11;</code>
647      *
648      * @param index The index of the element to return.
649      * @return The advancedOcrOptions at the given index.
650      */
getAdvancedOcrOptions(int index)651     public java.lang.String getAdvancedOcrOptions(int index) {
652       return advancedOcrOptions_.get(index);
653     }
654     /**
655      *
656      *
657      * <pre>
658      * A list of advanced OCR options to fine-tune OCR behavior.
659      * </pre>
660      *
661      * <code>repeated string advanced_ocr_options = 11;</code>
662      *
663      * @param index The index of the value to return.
664      * @return The bytes of the advancedOcrOptions at the given index.
665      */
getAdvancedOcrOptionsBytes(int index)666     public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index) {
667       return advancedOcrOptions_.getByteString(index);
668     }
669     /**
670      *
671      *
672      * <pre>
673      * A list of advanced OCR options to fine-tune OCR behavior.
674      * </pre>
675      *
676      * <code>repeated string advanced_ocr_options = 11;</code>
677      *
678      * @param index The index to set the value at.
679      * @param value The advancedOcrOptions to set.
680      * @return This builder for chaining.
681      */
setAdvancedOcrOptions(int index, java.lang.String value)682     public Builder setAdvancedOcrOptions(int index, java.lang.String value) {
683       if (value == null) {
684         throw new NullPointerException();
685       }
686       ensureAdvancedOcrOptionsIsMutable();
687       advancedOcrOptions_.set(index, value);
688       onChanged();
689       return this;
690     }
691     /**
692      *
693      *
694      * <pre>
695      * A list of advanced OCR options to fine-tune OCR behavior.
696      * </pre>
697      *
698      * <code>repeated string advanced_ocr_options = 11;</code>
699      *
700      * @param value The advancedOcrOptions to add.
701      * @return This builder for chaining.
702      */
addAdvancedOcrOptions(java.lang.String value)703     public Builder addAdvancedOcrOptions(java.lang.String value) {
704       if (value == null) {
705         throw new NullPointerException();
706       }
707       ensureAdvancedOcrOptionsIsMutable();
708       advancedOcrOptions_.add(value);
709       onChanged();
710       return this;
711     }
712     /**
713      *
714      *
715      * <pre>
716      * A list of advanced OCR options to fine-tune OCR behavior.
717      * </pre>
718      *
719      * <code>repeated string advanced_ocr_options = 11;</code>
720      *
721      * @param values The advancedOcrOptions to add.
722      * @return This builder for chaining.
723      */
addAllAdvancedOcrOptions(java.lang.Iterable<java.lang.String> values)724     public Builder addAllAdvancedOcrOptions(java.lang.Iterable<java.lang.String> values) {
725       ensureAdvancedOcrOptionsIsMutable();
726       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, advancedOcrOptions_);
727       onChanged();
728       return this;
729     }
730     /**
731      *
732      *
733      * <pre>
734      * A list of advanced OCR options to fine-tune OCR behavior.
735      * </pre>
736      *
737      * <code>repeated string advanced_ocr_options = 11;</code>
738      *
739      * @return This builder for chaining.
740      */
clearAdvancedOcrOptions()741     public Builder clearAdvancedOcrOptions() {
742       advancedOcrOptions_ = com.google.protobuf.LazyStringArrayList.EMPTY;
743       bitField0_ = (bitField0_ & ~0x00000002);
744       onChanged();
745       return this;
746     }
747     /**
748      *
749      *
750      * <pre>
751      * A list of advanced OCR options to fine-tune OCR behavior.
752      * </pre>
753      *
754      * <code>repeated string advanced_ocr_options = 11;</code>
755      *
756      * @param value The bytes of the advancedOcrOptions to add.
757      * @return This builder for chaining.
758      */
addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value)759     public Builder addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value) {
760       if (value == null) {
761         throw new NullPointerException();
762       }
763       checkByteStringIsUtf8(value);
764       ensureAdvancedOcrOptionsIsMutable();
765       advancedOcrOptions_.add(value);
766       onChanged();
767       return this;
768     }
769 
770     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)771     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
772       return super.setUnknownFields(unknownFields);
773     }
774 
775     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)776     public final Builder mergeUnknownFields(
777         final com.google.protobuf.UnknownFieldSet unknownFields) {
778       return super.mergeUnknownFields(unknownFields);
779     }
780 
781     // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.TextDetectionParams)
782   }
783 
784   // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.TextDetectionParams)
785   private static final com.google.cloud.vision.v1.TextDetectionParams DEFAULT_INSTANCE;
786 
787   static {
788     DEFAULT_INSTANCE = new com.google.cloud.vision.v1.TextDetectionParams();
789   }
790 
getDefaultInstance()791   public static com.google.cloud.vision.v1.TextDetectionParams getDefaultInstance() {
792     return DEFAULT_INSTANCE;
793   }
794 
795   private static final com.google.protobuf.Parser<TextDetectionParams> PARSER =
796       new com.google.protobuf.AbstractParser<TextDetectionParams>() {
797         @java.lang.Override
798         public TextDetectionParams parsePartialFrom(
799             com.google.protobuf.CodedInputStream input,
800             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
801             throws com.google.protobuf.InvalidProtocolBufferException {
802           Builder builder = newBuilder();
803           try {
804             builder.mergeFrom(input, extensionRegistry);
805           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
806             throw e.setUnfinishedMessage(builder.buildPartial());
807           } catch (com.google.protobuf.UninitializedMessageException e) {
808             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
809           } catch (java.io.IOException e) {
810             throw new com.google.protobuf.InvalidProtocolBufferException(e)
811                 .setUnfinishedMessage(builder.buildPartial());
812           }
813           return builder.buildPartial();
814         }
815       };
816 
parser()817   public static com.google.protobuf.Parser<TextDetectionParams> parser() {
818     return PARSER;
819   }
820 
821   @java.lang.Override
getParserForType()822   public com.google.protobuf.Parser<TextDetectionParams> getParserForType() {
823     return PARSER;
824   }
825 
826   @java.lang.Override
getDefaultInstanceForType()827   public com.google.cloud.vision.v1.TextDetectionParams getDefaultInstanceForType() {
828     return DEFAULT_INSTANCE;
829   }
830 }
831