• 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/v1p3beta1/text_annotation.proto
18 
19 package com.google.cloud.vision.v1p3beta1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * A single symbol representation.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.vision.v1p3beta1.Symbol}
29  */
30 public final class Symbol extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.Symbol)
33     SymbolOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use Symbol.newBuilder() to construct.
Symbol(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private Symbol(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
Symbol()40   private Symbol() {
41     text_ = "";
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new Symbol();
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.vision.v1p3beta1.TextAnnotationProto
57         .internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor;
58   }
59 
60   @java.lang.Override
61   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()62       internalGetFieldAccessorTable() {
63     return com.google.cloud.vision.v1p3beta1.TextAnnotationProto
64         .internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable
65         .ensureFieldAccessorsInitialized(
66             com.google.cloud.vision.v1p3beta1.Symbol.class,
67             com.google.cloud.vision.v1p3beta1.Symbol.Builder.class);
68   }
69 
70   public static final int PROPERTY_FIELD_NUMBER = 1;
71   private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_;
72   /**
73    *
74    *
75    * <pre>
76    * Additional information detected for the symbol.
77    * </pre>
78    *
79    * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
80    *
81    * @return Whether the property field is set.
82    */
83   @java.lang.Override
hasProperty()84   public boolean hasProperty() {
85     return property_ != null;
86   }
87   /**
88    *
89    *
90    * <pre>
91    * Additional information detected for the symbol.
92    * </pre>
93    *
94    * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
95    *
96    * @return The property.
97    */
98   @java.lang.Override
getProperty()99   public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() {
100     return property_ == null
101         ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance()
102         : property_;
103   }
104   /**
105    *
106    *
107    * <pre>
108    * Additional information detected for the symbol.
109    * </pre>
110    *
111    * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
112    */
113   @java.lang.Override
114   public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder
getPropertyOrBuilder()115       getPropertyOrBuilder() {
116     return property_ == null
117         ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance()
118         : property_;
119   }
120 
121   public static final int BOUNDING_BOX_FIELD_NUMBER = 2;
122   private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_;
123   /**
124    *
125    *
126    * <pre>
127    * The bounding box for the symbol.
128    * The vertices are in the order of top-left, top-right, bottom-right,
129    * bottom-left. When a rotation of the bounding box is detected the rotation
130    * is represented as around the top-left corner as defined when the text is
131    * read in the 'natural' orientation.
132    * For example:
133    *   * when the text is horizontal it might look like:
134    *      0----1
135    *      |    |
136    *      3----2
137    *   * when it's rotated 180 degrees around the top-left corner it becomes:
138    *      2----3
139    *      |    |
140    *      1----0
141    *   and the vertice order will still be (0, 1, 2, 3).
142    * </pre>
143    *
144    * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
145    *
146    * @return Whether the boundingBox field is set.
147    */
148   @java.lang.Override
hasBoundingBox()149   public boolean hasBoundingBox() {
150     return boundingBox_ != null;
151   }
152   /**
153    *
154    *
155    * <pre>
156    * The bounding box for the symbol.
157    * The vertices are in the order of top-left, top-right, bottom-right,
158    * bottom-left. When a rotation of the bounding box is detected the rotation
159    * is represented as around the top-left corner as defined when the text is
160    * read in the 'natural' orientation.
161    * For example:
162    *   * when the text is horizontal it might look like:
163    *      0----1
164    *      |    |
165    *      3----2
166    *   * when it's rotated 180 degrees around the top-left corner it becomes:
167    *      2----3
168    *      |    |
169    *      1----0
170    *   and the vertice order will still be (0, 1, 2, 3).
171    * </pre>
172    *
173    * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
174    *
175    * @return The boundingBox.
176    */
177   @java.lang.Override
getBoundingBox()178   public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() {
179     return boundingBox_ == null
180         ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()
181         : boundingBox_;
182   }
183   /**
184    *
185    *
186    * <pre>
187    * The bounding box for the symbol.
188    * The vertices are in the order of top-left, top-right, bottom-right,
189    * bottom-left. When a rotation of the bounding box is detected the rotation
190    * is represented as around the top-left corner as defined when the text is
191    * read in the 'natural' orientation.
192    * For example:
193    *   * when the text is horizontal it might look like:
194    *      0----1
195    *      |    |
196    *      3----2
197    *   * when it's rotated 180 degrees around the top-left corner it becomes:
198    *      2----3
199    *      |    |
200    *      1----0
201    *   and the vertice order will still be (0, 1, 2, 3).
202    * </pre>
203    *
204    * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
205    */
206   @java.lang.Override
getBoundingBoxOrBuilder()207   public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() {
208     return boundingBox_ == null
209         ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()
210         : boundingBox_;
211   }
212 
213   public static final int TEXT_FIELD_NUMBER = 3;
214 
215   @SuppressWarnings("serial")
216   private volatile java.lang.Object text_ = "";
217   /**
218    *
219    *
220    * <pre>
221    * The actual UTF-8 representation of the symbol.
222    * </pre>
223    *
224    * <code>string text = 3;</code>
225    *
226    * @return The text.
227    */
228   @java.lang.Override
getText()229   public java.lang.String getText() {
230     java.lang.Object ref = text_;
231     if (ref instanceof java.lang.String) {
232       return (java.lang.String) ref;
233     } else {
234       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
235       java.lang.String s = bs.toStringUtf8();
236       text_ = s;
237       return s;
238     }
239   }
240   /**
241    *
242    *
243    * <pre>
244    * The actual UTF-8 representation of the symbol.
245    * </pre>
246    *
247    * <code>string text = 3;</code>
248    *
249    * @return The bytes for text.
250    */
251   @java.lang.Override
getTextBytes()252   public com.google.protobuf.ByteString getTextBytes() {
253     java.lang.Object ref = text_;
254     if (ref instanceof java.lang.String) {
255       com.google.protobuf.ByteString b =
256           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
257       text_ = b;
258       return b;
259     } else {
260       return (com.google.protobuf.ByteString) ref;
261     }
262   }
263 
264   public static final int CONFIDENCE_FIELD_NUMBER = 4;
265   private float confidence_ = 0F;
266   /**
267    *
268    *
269    * <pre>
270    * Confidence of the OCR results for the symbol. Range [0, 1].
271    * </pre>
272    *
273    * <code>float confidence = 4;</code>
274    *
275    * @return The confidence.
276    */
277   @java.lang.Override
getConfidence()278   public float getConfidence() {
279     return confidence_;
280   }
281 
282   private byte memoizedIsInitialized = -1;
283 
284   @java.lang.Override
isInitialized()285   public final boolean isInitialized() {
286     byte isInitialized = memoizedIsInitialized;
287     if (isInitialized == 1) return true;
288     if (isInitialized == 0) return false;
289 
290     memoizedIsInitialized = 1;
291     return true;
292   }
293 
294   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)295   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
296     if (property_ != null) {
297       output.writeMessage(1, getProperty());
298     }
299     if (boundingBox_ != null) {
300       output.writeMessage(2, getBoundingBox());
301     }
302     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
303       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, text_);
304     }
305     if (java.lang.Float.floatToRawIntBits(confidence_) != 0) {
306       output.writeFloat(4, confidence_);
307     }
308     getUnknownFields().writeTo(output);
309   }
310 
311   @java.lang.Override
getSerializedSize()312   public int getSerializedSize() {
313     int size = memoizedSize;
314     if (size != -1) return size;
315 
316     size = 0;
317     if (property_ != null) {
318       size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProperty());
319     }
320     if (boundingBox_ != null) {
321       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBoundingBox());
322     }
323     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
324       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, text_);
325     }
326     if (java.lang.Float.floatToRawIntBits(confidence_) != 0) {
327       size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, confidence_);
328     }
329     size += getUnknownFields().getSerializedSize();
330     memoizedSize = size;
331     return size;
332   }
333 
334   @java.lang.Override
equals(final java.lang.Object obj)335   public boolean equals(final java.lang.Object obj) {
336     if (obj == this) {
337       return true;
338     }
339     if (!(obj instanceof com.google.cloud.vision.v1p3beta1.Symbol)) {
340       return super.equals(obj);
341     }
342     com.google.cloud.vision.v1p3beta1.Symbol other = (com.google.cloud.vision.v1p3beta1.Symbol) obj;
343 
344     if (hasProperty() != other.hasProperty()) return false;
345     if (hasProperty()) {
346       if (!getProperty().equals(other.getProperty())) return false;
347     }
348     if (hasBoundingBox() != other.hasBoundingBox()) return false;
349     if (hasBoundingBox()) {
350       if (!getBoundingBox().equals(other.getBoundingBox())) return false;
351     }
352     if (!getText().equals(other.getText())) return false;
353     if (java.lang.Float.floatToIntBits(getConfidence())
354         != java.lang.Float.floatToIntBits(other.getConfidence())) return false;
355     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
356     return true;
357   }
358 
359   @java.lang.Override
hashCode()360   public int hashCode() {
361     if (memoizedHashCode != 0) {
362       return memoizedHashCode;
363     }
364     int hash = 41;
365     hash = (19 * hash) + getDescriptor().hashCode();
366     if (hasProperty()) {
367       hash = (37 * hash) + PROPERTY_FIELD_NUMBER;
368       hash = (53 * hash) + getProperty().hashCode();
369     }
370     if (hasBoundingBox()) {
371       hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER;
372       hash = (53 * hash) + getBoundingBox().hashCode();
373     }
374     hash = (37 * hash) + TEXT_FIELD_NUMBER;
375     hash = (53 * hash) + getText().hashCode();
376     hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER;
377     hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence());
378     hash = (29 * hash) + getUnknownFields().hashCode();
379     memoizedHashCode = hash;
380     return hash;
381   }
382 
parseFrom(java.nio.ByteBuffer data)383   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(java.nio.ByteBuffer data)
384       throws com.google.protobuf.InvalidProtocolBufferException {
385     return PARSER.parseFrom(data);
386   }
387 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)388   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
389       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
390       throws com.google.protobuf.InvalidProtocolBufferException {
391     return PARSER.parseFrom(data, extensionRegistry);
392   }
393 
parseFrom( com.google.protobuf.ByteString data)394   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
395       com.google.protobuf.ByteString data)
396       throws com.google.protobuf.InvalidProtocolBufferException {
397     return PARSER.parseFrom(data);
398   }
399 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)400   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
401       com.google.protobuf.ByteString data,
402       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
403       throws com.google.protobuf.InvalidProtocolBufferException {
404     return PARSER.parseFrom(data, extensionRegistry);
405   }
406 
parseFrom(byte[] data)407   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(byte[] data)
408       throws com.google.protobuf.InvalidProtocolBufferException {
409     return PARSER.parseFrom(data);
410   }
411 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)412   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
413       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
414       throws com.google.protobuf.InvalidProtocolBufferException {
415     return PARSER.parseFrom(data, extensionRegistry);
416   }
417 
parseFrom(java.io.InputStream input)418   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(java.io.InputStream input)
419       throws java.io.IOException {
420     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
421   }
422 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)423   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
424       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
425       throws java.io.IOException {
426     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
427         PARSER, input, extensionRegistry);
428   }
429 
parseDelimitedFrom( java.io.InputStream input)430   public static com.google.cloud.vision.v1p3beta1.Symbol parseDelimitedFrom(
431       java.io.InputStream input) throws java.io.IOException {
432     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
433   }
434 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)435   public static com.google.cloud.vision.v1p3beta1.Symbol parseDelimitedFrom(
436       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
437       throws java.io.IOException {
438     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
439         PARSER, input, extensionRegistry);
440   }
441 
parseFrom( com.google.protobuf.CodedInputStream input)442   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
443       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
444     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
445   }
446 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)447   public static com.google.cloud.vision.v1p3beta1.Symbol parseFrom(
448       com.google.protobuf.CodedInputStream input,
449       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
450       throws java.io.IOException {
451     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
452         PARSER, input, extensionRegistry);
453   }
454 
455   @java.lang.Override
newBuilderForType()456   public Builder newBuilderForType() {
457     return newBuilder();
458   }
459 
newBuilder()460   public static Builder newBuilder() {
461     return DEFAULT_INSTANCE.toBuilder();
462   }
463 
newBuilder(com.google.cloud.vision.v1p3beta1.Symbol prototype)464   public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.Symbol prototype) {
465     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
466   }
467 
468   @java.lang.Override
toBuilder()469   public Builder toBuilder() {
470     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
471   }
472 
473   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)474   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
475     Builder builder = new Builder(parent);
476     return builder;
477   }
478   /**
479    *
480    *
481    * <pre>
482    * A single symbol representation.
483    * </pre>
484    *
485    * Protobuf type {@code google.cloud.vision.v1p3beta1.Symbol}
486    */
487   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
488       implements
489       // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.Symbol)
490       com.google.cloud.vision.v1p3beta1.SymbolOrBuilder {
getDescriptor()491     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
492       return com.google.cloud.vision.v1p3beta1.TextAnnotationProto
493           .internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor;
494     }
495 
496     @java.lang.Override
497     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()498         internalGetFieldAccessorTable() {
499       return com.google.cloud.vision.v1p3beta1.TextAnnotationProto
500           .internal_static_google_cloud_vision_v1p3beta1_Symbol_fieldAccessorTable
501           .ensureFieldAccessorsInitialized(
502               com.google.cloud.vision.v1p3beta1.Symbol.class,
503               com.google.cloud.vision.v1p3beta1.Symbol.Builder.class);
504     }
505 
506     // Construct using com.google.cloud.vision.v1p3beta1.Symbol.newBuilder()
Builder()507     private Builder() {}
508 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)509     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
510       super(parent);
511     }
512 
513     @java.lang.Override
clear()514     public Builder clear() {
515       super.clear();
516       bitField0_ = 0;
517       property_ = null;
518       if (propertyBuilder_ != null) {
519         propertyBuilder_.dispose();
520         propertyBuilder_ = null;
521       }
522       boundingBox_ = null;
523       if (boundingBoxBuilder_ != null) {
524         boundingBoxBuilder_.dispose();
525         boundingBoxBuilder_ = null;
526       }
527       text_ = "";
528       confidence_ = 0F;
529       return this;
530     }
531 
532     @java.lang.Override
getDescriptorForType()533     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
534       return com.google.cloud.vision.v1p3beta1.TextAnnotationProto
535           .internal_static_google_cloud_vision_v1p3beta1_Symbol_descriptor;
536     }
537 
538     @java.lang.Override
getDefaultInstanceForType()539     public com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstanceForType() {
540       return com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance();
541     }
542 
543     @java.lang.Override
build()544     public com.google.cloud.vision.v1p3beta1.Symbol build() {
545       com.google.cloud.vision.v1p3beta1.Symbol result = buildPartial();
546       if (!result.isInitialized()) {
547         throw newUninitializedMessageException(result);
548       }
549       return result;
550     }
551 
552     @java.lang.Override
buildPartial()553     public com.google.cloud.vision.v1p3beta1.Symbol buildPartial() {
554       com.google.cloud.vision.v1p3beta1.Symbol result =
555           new com.google.cloud.vision.v1p3beta1.Symbol(this);
556       if (bitField0_ != 0) {
557         buildPartial0(result);
558       }
559       onBuilt();
560       return result;
561     }
562 
buildPartial0(com.google.cloud.vision.v1p3beta1.Symbol result)563     private void buildPartial0(com.google.cloud.vision.v1p3beta1.Symbol result) {
564       int from_bitField0_ = bitField0_;
565       if (((from_bitField0_ & 0x00000001) != 0)) {
566         result.property_ = propertyBuilder_ == null ? property_ : propertyBuilder_.build();
567       }
568       if (((from_bitField0_ & 0x00000002) != 0)) {
569         result.boundingBox_ =
570             boundingBoxBuilder_ == null ? boundingBox_ : boundingBoxBuilder_.build();
571       }
572       if (((from_bitField0_ & 0x00000004) != 0)) {
573         result.text_ = text_;
574       }
575       if (((from_bitField0_ & 0x00000008) != 0)) {
576         result.confidence_ = confidence_;
577       }
578     }
579 
580     @java.lang.Override
clone()581     public Builder clone() {
582       return super.clone();
583     }
584 
585     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)586     public Builder setField(
587         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
588       return super.setField(field, value);
589     }
590 
591     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)592     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
593       return super.clearField(field);
594     }
595 
596     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)597     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
598       return super.clearOneof(oneof);
599     }
600 
601     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)602     public Builder setRepeatedField(
603         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
604       return super.setRepeatedField(field, index, value);
605     }
606 
607     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)608     public Builder addRepeatedField(
609         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
610       return super.addRepeatedField(field, value);
611     }
612 
613     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)614     public Builder mergeFrom(com.google.protobuf.Message other) {
615       if (other instanceof com.google.cloud.vision.v1p3beta1.Symbol) {
616         return mergeFrom((com.google.cloud.vision.v1p3beta1.Symbol) other);
617       } else {
618         super.mergeFrom(other);
619         return this;
620       }
621     }
622 
mergeFrom(com.google.cloud.vision.v1p3beta1.Symbol other)623     public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.Symbol other) {
624       if (other == com.google.cloud.vision.v1p3beta1.Symbol.getDefaultInstance()) return this;
625       if (other.hasProperty()) {
626         mergeProperty(other.getProperty());
627       }
628       if (other.hasBoundingBox()) {
629         mergeBoundingBox(other.getBoundingBox());
630       }
631       if (!other.getText().isEmpty()) {
632         text_ = other.text_;
633         bitField0_ |= 0x00000004;
634         onChanged();
635       }
636       if (other.getConfidence() != 0F) {
637         setConfidence(other.getConfidence());
638       }
639       this.mergeUnknownFields(other.getUnknownFields());
640       onChanged();
641       return this;
642     }
643 
644     @java.lang.Override
isInitialized()645     public final boolean isInitialized() {
646       return true;
647     }
648 
649     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)650     public Builder mergeFrom(
651         com.google.protobuf.CodedInputStream input,
652         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
653         throws java.io.IOException {
654       if (extensionRegistry == null) {
655         throw new java.lang.NullPointerException();
656       }
657       try {
658         boolean done = false;
659         while (!done) {
660           int tag = input.readTag();
661           switch (tag) {
662             case 0:
663               done = true;
664               break;
665             case 10:
666               {
667                 input.readMessage(getPropertyFieldBuilder().getBuilder(), extensionRegistry);
668                 bitField0_ |= 0x00000001;
669                 break;
670               } // case 10
671             case 18:
672               {
673                 input.readMessage(getBoundingBoxFieldBuilder().getBuilder(), extensionRegistry);
674                 bitField0_ |= 0x00000002;
675                 break;
676               } // case 18
677             case 26:
678               {
679                 text_ = input.readStringRequireUtf8();
680                 bitField0_ |= 0x00000004;
681                 break;
682               } // case 26
683             case 37:
684               {
685                 confidence_ = input.readFloat();
686                 bitField0_ |= 0x00000008;
687                 break;
688               } // case 37
689             default:
690               {
691                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
692                   done = true; // was an endgroup tag
693                 }
694                 break;
695               } // default:
696           } // switch (tag)
697         } // while (!done)
698       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
699         throw e.unwrapIOException();
700       } finally {
701         onChanged();
702       } // finally
703       return this;
704     }
705 
706     private int bitField0_;
707 
708     private com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property_;
709     private com.google.protobuf.SingleFieldBuilderV3<
710             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty,
711             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder,
712             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>
713         propertyBuilder_;
714     /**
715      *
716      *
717      * <pre>
718      * Additional information detected for the symbol.
719      * </pre>
720      *
721      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
722      *
723      * @return Whether the property field is set.
724      */
hasProperty()725     public boolean hasProperty() {
726       return ((bitField0_ & 0x00000001) != 0);
727     }
728     /**
729      *
730      *
731      * <pre>
732      * Additional information detected for the symbol.
733      * </pre>
734      *
735      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
736      *
737      * @return The property.
738      */
getProperty()739     public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty getProperty() {
740       if (propertyBuilder_ == null) {
741         return property_ == null
742             ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance()
743             : property_;
744       } else {
745         return propertyBuilder_.getMessage();
746       }
747     }
748     /**
749      *
750      *
751      * <pre>
752      * Additional information detected for the symbol.
753      * </pre>
754      *
755      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
756      */
setProperty( com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value)757     public Builder setProperty(
758         com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) {
759       if (propertyBuilder_ == null) {
760         if (value == null) {
761           throw new NullPointerException();
762         }
763         property_ = value;
764       } else {
765         propertyBuilder_.setMessage(value);
766       }
767       bitField0_ |= 0x00000001;
768       onChanged();
769       return this;
770     }
771     /**
772      *
773      *
774      * <pre>
775      * Additional information detected for the symbol.
776      * </pre>
777      *
778      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
779      */
setProperty( com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue)780     public Builder setProperty(
781         com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder builderForValue) {
782       if (propertyBuilder_ == null) {
783         property_ = builderForValue.build();
784       } else {
785         propertyBuilder_.setMessage(builderForValue.build());
786       }
787       bitField0_ |= 0x00000001;
788       onChanged();
789       return this;
790     }
791     /**
792      *
793      *
794      * <pre>
795      * Additional information detected for the symbol.
796      * </pre>
797      *
798      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
799      */
mergeProperty( com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value)800     public Builder mergeProperty(
801         com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty value) {
802       if (propertyBuilder_ == null) {
803         if (((bitField0_ & 0x00000001) != 0)
804             && property_ != null
805             && property_
806                 != com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty
807                     .getDefaultInstance()) {
808           getPropertyBuilder().mergeFrom(value);
809         } else {
810           property_ = value;
811         }
812       } else {
813         propertyBuilder_.mergeFrom(value);
814       }
815       bitField0_ |= 0x00000001;
816       onChanged();
817       return this;
818     }
819     /**
820      *
821      *
822      * <pre>
823      * Additional information detected for the symbol.
824      * </pre>
825      *
826      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
827      */
clearProperty()828     public Builder clearProperty() {
829       bitField0_ = (bitField0_ & ~0x00000001);
830       property_ = null;
831       if (propertyBuilder_ != null) {
832         propertyBuilder_.dispose();
833         propertyBuilder_ = null;
834       }
835       onChanged();
836       return this;
837     }
838     /**
839      *
840      *
841      * <pre>
842      * Additional information detected for the symbol.
843      * </pre>
844      *
845      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
846      */
847     public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder
getPropertyBuilder()848         getPropertyBuilder() {
849       bitField0_ |= 0x00000001;
850       onChanged();
851       return getPropertyFieldBuilder().getBuilder();
852     }
853     /**
854      *
855      *
856      * <pre>
857      * Additional information detected for the symbol.
858      * </pre>
859      *
860      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
861      */
862     public com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder
getPropertyOrBuilder()863         getPropertyOrBuilder() {
864       if (propertyBuilder_ != null) {
865         return propertyBuilder_.getMessageOrBuilder();
866       } else {
867         return property_ == null
868             ? com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.getDefaultInstance()
869             : property_;
870       }
871     }
872     /**
873      *
874      *
875      * <pre>
876      * Additional information detected for the symbol.
877      * </pre>
878      *
879      * <code>.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty property = 1;</code>
880      */
881     private com.google.protobuf.SingleFieldBuilderV3<
882             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty,
883             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder,
884             com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>
getPropertyFieldBuilder()885         getPropertyFieldBuilder() {
886       if (propertyBuilder_ == null) {
887         propertyBuilder_ =
888             new com.google.protobuf.SingleFieldBuilderV3<
889                 com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty,
890                 com.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.Builder,
891                 com.google.cloud.vision.v1p3beta1.TextAnnotation.TextPropertyOrBuilder>(
892                 getProperty(), getParentForChildren(), isClean());
893         property_ = null;
894       }
895       return propertyBuilder_;
896     }
897 
898     private com.google.cloud.vision.v1p3beta1.BoundingPoly boundingBox_;
899     private com.google.protobuf.SingleFieldBuilderV3<
900             com.google.cloud.vision.v1p3beta1.BoundingPoly,
901             com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
902             com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
903         boundingBoxBuilder_;
904     /**
905      *
906      *
907      * <pre>
908      * The bounding box for the symbol.
909      * The vertices are in the order of top-left, top-right, bottom-right,
910      * bottom-left. When a rotation of the bounding box is detected the rotation
911      * is represented as around the top-left corner as defined when the text is
912      * read in the 'natural' orientation.
913      * For example:
914      *   * when the text is horizontal it might look like:
915      *      0----1
916      *      |    |
917      *      3----2
918      *   * when it's rotated 180 degrees around the top-left corner it becomes:
919      *      2----3
920      *      |    |
921      *      1----0
922      *   and the vertice order will still be (0, 1, 2, 3).
923      * </pre>
924      *
925      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
926      *
927      * @return Whether the boundingBox field is set.
928      */
hasBoundingBox()929     public boolean hasBoundingBox() {
930       return ((bitField0_ & 0x00000002) != 0);
931     }
932     /**
933      *
934      *
935      * <pre>
936      * The bounding box for the symbol.
937      * The vertices are in the order of top-left, top-right, bottom-right,
938      * bottom-left. When a rotation of the bounding box is detected the rotation
939      * is represented as around the top-left corner as defined when the text is
940      * read in the 'natural' orientation.
941      * For example:
942      *   * when the text is horizontal it might look like:
943      *      0----1
944      *      |    |
945      *      3----2
946      *   * when it's rotated 180 degrees around the top-left corner it becomes:
947      *      2----3
948      *      |    |
949      *      1----0
950      *   and the vertice order will still be (0, 1, 2, 3).
951      * </pre>
952      *
953      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
954      *
955      * @return The boundingBox.
956      */
getBoundingBox()957     public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingBox() {
958       if (boundingBoxBuilder_ == null) {
959         return boundingBox_ == null
960             ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()
961             : boundingBox_;
962       } else {
963         return boundingBoxBuilder_.getMessage();
964       }
965     }
966     /**
967      *
968      *
969      * <pre>
970      * The bounding box for the symbol.
971      * The vertices are in the order of top-left, top-right, bottom-right,
972      * bottom-left. When a rotation of the bounding box is detected the rotation
973      * is represented as around the top-left corner as defined when the text is
974      * read in the 'natural' orientation.
975      * For example:
976      *   * when the text is horizontal it might look like:
977      *      0----1
978      *      |    |
979      *      3----2
980      *   * when it's rotated 180 degrees around the top-left corner it becomes:
981      *      2----3
982      *      |    |
983      *      1----0
984      *   and the vertice order will still be (0, 1, 2, 3).
985      * </pre>
986      *
987      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
988      */
setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value)989     public Builder setBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) {
990       if (boundingBoxBuilder_ == null) {
991         if (value == null) {
992           throw new NullPointerException();
993         }
994         boundingBox_ = value;
995       } else {
996         boundingBoxBuilder_.setMessage(value);
997       }
998       bitField0_ |= 0x00000002;
999       onChanged();
1000       return this;
1001     }
1002     /**
1003      *
1004      *
1005      * <pre>
1006      * The bounding box for the symbol.
1007      * The vertices are in the order of top-left, top-right, bottom-right,
1008      * bottom-left. When a rotation of the bounding box is detected the rotation
1009      * is represented as around the top-left corner as defined when the text is
1010      * read in the 'natural' orientation.
1011      * For example:
1012      *   * when the text is horizontal it might look like:
1013      *      0----1
1014      *      |    |
1015      *      3----2
1016      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1017      *      2----3
1018      *      |    |
1019      *      1----0
1020      *   and the vertice order will still be (0, 1, 2, 3).
1021      * </pre>
1022      *
1023      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1024      */
setBoundingBox( com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue)1025     public Builder setBoundingBox(
1026         com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) {
1027       if (boundingBoxBuilder_ == null) {
1028         boundingBox_ = builderForValue.build();
1029       } else {
1030         boundingBoxBuilder_.setMessage(builderForValue.build());
1031       }
1032       bitField0_ |= 0x00000002;
1033       onChanged();
1034       return this;
1035     }
1036     /**
1037      *
1038      *
1039      * <pre>
1040      * The bounding box for the symbol.
1041      * The vertices are in the order of top-left, top-right, bottom-right,
1042      * bottom-left. When a rotation of the bounding box is detected the rotation
1043      * is represented as around the top-left corner as defined when the text is
1044      * read in the 'natural' orientation.
1045      * For example:
1046      *   * when the text is horizontal it might look like:
1047      *      0----1
1048      *      |    |
1049      *      3----2
1050      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1051      *      2----3
1052      *      |    |
1053      *      1----0
1054      *   and the vertice order will still be (0, 1, 2, 3).
1055      * </pre>
1056      *
1057      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1058      */
mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value)1059     public Builder mergeBoundingBox(com.google.cloud.vision.v1p3beta1.BoundingPoly value) {
1060       if (boundingBoxBuilder_ == null) {
1061         if (((bitField0_ & 0x00000002) != 0)
1062             && boundingBox_ != null
1063             && boundingBox_
1064                 != com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()) {
1065           getBoundingBoxBuilder().mergeFrom(value);
1066         } else {
1067           boundingBox_ = value;
1068         }
1069       } else {
1070         boundingBoxBuilder_.mergeFrom(value);
1071       }
1072       bitField0_ |= 0x00000002;
1073       onChanged();
1074       return this;
1075     }
1076     /**
1077      *
1078      *
1079      * <pre>
1080      * The bounding box for the symbol.
1081      * The vertices are in the order of top-left, top-right, bottom-right,
1082      * bottom-left. When a rotation of the bounding box is detected the rotation
1083      * is represented as around the top-left corner as defined when the text is
1084      * read in the 'natural' orientation.
1085      * For example:
1086      *   * when the text is horizontal it might look like:
1087      *      0----1
1088      *      |    |
1089      *      3----2
1090      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1091      *      2----3
1092      *      |    |
1093      *      1----0
1094      *   and the vertice order will still be (0, 1, 2, 3).
1095      * </pre>
1096      *
1097      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1098      */
clearBoundingBox()1099     public Builder clearBoundingBox() {
1100       bitField0_ = (bitField0_ & ~0x00000002);
1101       boundingBox_ = null;
1102       if (boundingBoxBuilder_ != null) {
1103         boundingBoxBuilder_.dispose();
1104         boundingBoxBuilder_ = null;
1105       }
1106       onChanged();
1107       return this;
1108     }
1109     /**
1110      *
1111      *
1112      * <pre>
1113      * The bounding box for the symbol.
1114      * The vertices are in the order of top-left, top-right, bottom-right,
1115      * bottom-left. When a rotation of the bounding box is detected the rotation
1116      * is represented as around the top-left corner as defined when the text is
1117      * read in the 'natural' orientation.
1118      * For example:
1119      *   * when the text is horizontal it might look like:
1120      *      0----1
1121      *      |    |
1122      *      3----2
1123      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1124      *      2----3
1125      *      |    |
1126      *      1----0
1127      *   and the vertice order will still be (0, 1, 2, 3).
1128      * </pre>
1129      *
1130      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1131      */
getBoundingBoxBuilder()1132     public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingBoxBuilder() {
1133       bitField0_ |= 0x00000002;
1134       onChanged();
1135       return getBoundingBoxFieldBuilder().getBuilder();
1136     }
1137     /**
1138      *
1139      *
1140      * <pre>
1141      * The bounding box for the symbol.
1142      * The vertices are in the order of top-left, top-right, bottom-right,
1143      * bottom-left. When a rotation of the bounding box is detected the rotation
1144      * is represented as around the top-left corner as defined when the text is
1145      * read in the 'natural' orientation.
1146      * For example:
1147      *   * when the text is horizontal it might look like:
1148      *      0----1
1149      *      |    |
1150      *      3----2
1151      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1152      *      2----3
1153      *      |    |
1154      *      1----0
1155      *   and the vertice order will still be (0, 1, 2, 3).
1156      * </pre>
1157      *
1158      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1159      */
getBoundingBoxOrBuilder()1160     public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() {
1161       if (boundingBoxBuilder_ != null) {
1162         return boundingBoxBuilder_.getMessageOrBuilder();
1163       } else {
1164         return boundingBox_ == null
1165             ? com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance()
1166             : boundingBox_;
1167       }
1168     }
1169     /**
1170      *
1171      *
1172      * <pre>
1173      * The bounding box for the symbol.
1174      * The vertices are in the order of top-left, top-right, bottom-right,
1175      * bottom-left. When a rotation of the bounding box is detected the rotation
1176      * is represented as around the top-left corner as defined when the text is
1177      * read in the 'natural' orientation.
1178      * For example:
1179      *   * when the text is horizontal it might look like:
1180      *      0----1
1181      *      |    |
1182      *      3----2
1183      *   * when it's rotated 180 degrees around the top-left corner it becomes:
1184      *      2----3
1185      *      |    |
1186      *      1----0
1187      *   and the vertice order will still be (0, 1, 2, 3).
1188      * </pre>
1189      *
1190      * <code>.google.cloud.vision.v1p3beta1.BoundingPoly bounding_box = 2;</code>
1191      */
1192     private com.google.protobuf.SingleFieldBuilderV3<
1193             com.google.cloud.vision.v1p3beta1.BoundingPoly,
1194             com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
1195             com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
getBoundingBoxFieldBuilder()1196         getBoundingBoxFieldBuilder() {
1197       if (boundingBoxBuilder_ == null) {
1198         boundingBoxBuilder_ =
1199             new com.google.protobuf.SingleFieldBuilderV3<
1200                 com.google.cloud.vision.v1p3beta1.BoundingPoly,
1201                 com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
1202                 com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>(
1203                 getBoundingBox(), getParentForChildren(), isClean());
1204         boundingBox_ = null;
1205       }
1206       return boundingBoxBuilder_;
1207     }
1208 
1209     private java.lang.Object text_ = "";
1210     /**
1211      *
1212      *
1213      * <pre>
1214      * The actual UTF-8 representation of the symbol.
1215      * </pre>
1216      *
1217      * <code>string text = 3;</code>
1218      *
1219      * @return The text.
1220      */
getText()1221     public java.lang.String getText() {
1222       java.lang.Object ref = text_;
1223       if (!(ref instanceof java.lang.String)) {
1224         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1225         java.lang.String s = bs.toStringUtf8();
1226         text_ = s;
1227         return s;
1228       } else {
1229         return (java.lang.String) ref;
1230       }
1231     }
1232     /**
1233      *
1234      *
1235      * <pre>
1236      * The actual UTF-8 representation of the symbol.
1237      * </pre>
1238      *
1239      * <code>string text = 3;</code>
1240      *
1241      * @return The bytes for text.
1242      */
getTextBytes()1243     public com.google.protobuf.ByteString getTextBytes() {
1244       java.lang.Object ref = text_;
1245       if (ref instanceof String) {
1246         com.google.protobuf.ByteString b =
1247             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1248         text_ = b;
1249         return b;
1250       } else {
1251         return (com.google.protobuf.ByteString) ref;
1252       }
1253     }
1254     /**
1255      *
1256      *
1257      * <pre>
1258      * The actual UTF-8 representation of the symbol.
1259      * </pre>
1260      *
1261      * <code>string text = 3;</code>
1262      *
1263      * @param value The text to set.
1264      * @return This builder for chaining.
1265      */
setText(java.lang.String value)1266     public Builder setText(java.lang.String value) {
1267       if (value == null) {
1268         throw new NullPointerException();
1269       }
1270       text_ = value;
1271       bitField0_ |= 0x00000004;
1272       onChanged();
1273       return this;
1274     }
1275     /**
1276      *
1277      *
1278      * <pre>
1279      * The actual UTF-8 representation of the symbol.
1280      * </pre>
1281      *
1282      * <code>string text = 3;</code>
1283      *
1284      * @return This builder for chaining.
1285      */
clearText()1286     public Builder clearText() {
1287       text_ = getDefaultInstance().getText();
1288       bitField0_ = (bitField0_ & ~0x00000004);
1289       onChanged();
1290       return this;
1291     }
1292     /**
1293      *
1294      *
1295      * <pre>
1296      * The actual UTF-8 representation of the symbol.
1297      * </pre>
1298      *
1299      * <code>string text = 3;</code>
1300      *
1301      * @param value The bytes for text to set.
1302      * @return This builder for chaining.
1303      */
setTextBytes(com.google.protobuf.ByteString value)1304     public Builder setTextBytes(com.google.protobuf.ByteString value) {
1305       if (value == null) {
1306         throw new NullPointerException();
1307       }
1308       checkByteStringIsUtf8(value);
1309       text_ = value;
1310       bitField0_ |= 0x00000004;
1311       onChanged();
1312       return this;
1313     }
1314 
1315     private float confidence_;
1316     /**
1317      *
1318      *
1319      * <pre>
1320      * Confidence of the OCR results for the symbol. Range [0, 1].
1321      * </pre>
1322      *
1323      * <code>float confidence = 4;</code>
1324      *
1325      * @return The confidence.
1326      */
1327     @java.lang.Override
getConfidence()1328     public float getConfidence() {
1329       return confidence_;
1330     }
1331     /**
1332      *
1333      *
1334      * <pre>
1335      * Confidence of the OCR results for the symbol. Range [0, 1].
1336      * </pre>
1337      *
1338      * <code>float confidence = 4;</code>
1339      *
1340      * @param value The confidence to set.
1341      * @return This builder for chaining.
1342      */
setConfidence(float value)1343     public Builder setConfidence(float value) {
1344 
1345       confidence_ = value;
1346       bitField0_ |= 0x00000008;
1347       onChanged();
1348       return this;
1349     }
1350     /**
1351      *
1352      *
1353      * <pre>
1354      * Confidence of the OCR results for the symbol. Range [0, 1].
1355      * </pre>
1356      *
1357      * <code>float confidence = 4;</code>
1358      *
1359      * @return This builder for chaining.
1360      */
clearConfidence()1361     public Builder clearConfidence() {
1362       bitField0_ = (bitField0_ & ~0x00000008);
1363       confidence_ = 0F;
1364       onChanged();
1365       return this;
1366     }
1367 
1368     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1369     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1370       return super.setUnknownFields(unknownFields);
1371     }
1372 
1373     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1374     public final Builder mergeUnknownFields(
1375         final com.google.protobuf.UnknownFieldSet unknownFields) {
1376       return super.mergeUnknownFields(unknownFields);
1377     }
1378 
1379     // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.Symbol)
1380   }
1381 
1382   // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Symbol)
1383   private static final com.google.cloud.vision.v1p3beta1.Symbol DEFAULT_INSTANCE;
1384 
1385   static {
1386     DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.Symbol();
1387   }
1388 
getDefaultInstance()1389   public static com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstance() {
1390     return DEFAULT_INSTANCE;
1391   }
1392 
1393   private static final com.google.protobuf.Parser<Symbol> PARSER =
1394       new com.google.protobuf.AbstractParser<Symbol>() {
1395         @java.lang.Override
1396         public Symbol parsePartialFrom(
1397             com.google.protobuf.CodedInputStream input,
1398             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1399             throws com.google.protobuf.InvalidProtocolBufferException {
1400           Builder builder = newBuilder();
1401           try {
1402             builder.mergeFrom(input, extensionRegistry);
1403           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1404             throw e.setUnfinishedMessage(builder.buildPartial());
1405           } catch (com.google.protobuf.UninitializedMessageException e) {
1406             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1407           } catch (java.io.IOException e) {
1408             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1409                 .setUnfinishedMessage(builder.buildPartial());
1410           }
1411           return builder.buildPartial();
1412         }
1413       };
1414 
parser()1415   public static com.google.protobuf.Parser<Symbol> parser() {
1416     return PARSER;
1417   }
1418 
1419   @java.lang.Override
getParserForType()1420   public com.google.protobuf.Parser<Symbol> getParserForType() {
1421     return PARSER;
1422   }
1423 
1424   @java.lang.Override
getDefaultInstanceForType()1425   public com.google.cloud.vision.v1p3beta1.Symbol getDefaultInstanceForType() {
1426     return DEFAULT_INSTANCE;
1427   }
1428 }
1429