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