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