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