1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/vision/v1/image_annotator.proto 18 19 package com.google.cloud.vision.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Set of detected entity features. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.vision.v1.EntityAnnotation} 29 */ 30 public final class EntityAnnotation extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.EntityAnnotation) 33 EntityAnnotationOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use EntityAnnotation.newBuilder() to construct. EntityAnnotation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private EntityAnnotation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 EntityAnnotation()40 private EntityAnnotation() { 41 mid_ = ""; 42 locale_ = ""; 43 description_ = ""; 44 locations_ = java.util.Collections.emptyList(); 45 properties_ = java.util.Collections.emptyList(); 46 } 47 48 @java.lang.Override 49 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)50 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 51 return new EntityAnnotation(); 52 } 53 54 @java.lang.Override getUnknownFields()55 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 56 return this.unknownFields; 57 } 58 getDescriptor()59 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 60 return com.google.cloud.vision.v1.ImageAnnotatorProto 61 .internal_static_google_cloud_vision_v1_EntityAnnotation_descriptor; 62 } 63 64 @java.lang.Override 65 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()66 internalGetFieldAccessorTable() { 67 return com.google.cloud.vision.v1.ImageAnnotatorProto 68 .internal_static_google_cloud_vision_v1_EntityAnnotation_fieldAccessorTable 69 .ensureFieldAccessorsInitialized( 70 com.google.cloud.vision.v1.EntityAnnotation.class, 71 com.google.cloud.vision.v1.EntityAnnotation.Builder.class); 72 } 73 74 public static final int MID_FIELD_NUMBER = 1; 75 76 @SuppressWarnings("serial") 77 private volatile java.lang.Object mid_ = ""; 78 /** 79 * 80 * 81 * <pre> 82 * Opaque entity ID. Some IDs may be available in 83 * [Google Knowledge Graph Search 84 * API](https://developers.google.com/knowledge-graph/). 85 * </pre> 86 * 87 * <code>string mid = 1;</code> 88 * 89 * @return The mid. 90 */ 91 @java.lang.Override getMid()92 public java.lang.String getMid() { 93 java.lang.Object ref = mid_; 94 if (ref instanceof java.lang.String) { 95 return (java.lang.String) ref; 96 } else { 97 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 98 java.lang.String s = bs.toStringUtf8(); 99 mid_ = s; 100 return s; 101 } 102 } 103 /** 104 * 105 * 106 * <pre> 107 * Opaque entity ID. Some IDs may be available in 108 * [Google Knowledge Graph Search 109 * API](https://developers.google.com/knowledge-graph/). 110 * </pre> 111 * 112 * <code>string mid = 1;</code> 113 * 114 * @return The bytes for mid. 115 */ 116 @java.lang.Override getMidBytes()117 public com.google.protobuf.ByteString getMidBytes() { 118 java.lang.Object ref = mid_; 119 if (ref instanceof java.lang.String) { 120 com.google.protobuf.ByteString b = 121 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 122 mid_ = b; 123 return b; 124 } else { 125 return (com.google.protobuf.ByteString) ref; 126 } 127 } 128 129 public static final int LOCALE_FIELD_NUMBER = 2; 130 131 @SuppressWarnings("serial") 132 private volatile java.lang.Object locale_ = ""; 133 /** 134 * 135 * 136 * <pre> 137 * The language code for the locale in which the entity textual 138 * `description` is expressed. 139 * </pre> 140 * 141 * <code>string locale = 2;</code> 142 * 143 * @return The locale. 144 */ 145 @java.lang.Override getLocale()146 public java.lang.String getLocale() { 147 java.lang.Object ref = locale_; 148 if (ref instanceof java.lang.String) { 149 return (java.lang.String) ref; 150 } else { 151 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 152 java.lang.String s = bs.toStringUtf8(); 153 locale_ = s; 154 return s; 155 } 156 } 157 /** 158 * 159 * 160 * <pre> 161 * The language code for the locale in which the entity textual 162 * `description` is expressed. 163 * </pre> 164 * 165 * <code>string locale = 2;</code> 166 * 167 * @return The bytes for locale. 168 */ 169 @java.lang.Override getLocaleBytes()170 public com.google.protobuf.ByteString getLocaleBytes() { 171 java.lang.Object ref = locale_; 172 if (ref instanceof java.lang.String) { 173 com.google.protobuf.ByteString b = 174 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 175 locale_ = b; 176 return b; 177 } else { 178 return (com.google.protobuf.ByteString) ref; 179 } 180 } 181 182 public static final int DESCRIPTION_FIELD_NUMBER = 3; 183 184 @SuppressWarnings("serial") 185 private volatile java.lang.Object description_ = ""; 186 /** 187 * 188 * 189 * <pre> 190 * Entity textual description, expressed in its `locale` language. 191 * </pre> 192 * 193 * <code>string description = 3;</code> 194 * 195 * @return The description. 196 */ 197 @java.lang.Override getDescription()198 public java.lang.String getDescription() { 199 java.lang.Object ref = description_; 200 if (ref instanceof java.lang.String) { 201 return (java.lang.String) ref; 202 } else { 203 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 204 java.lang.String s = bs.toStringUtf8(); 205 description_ = s; 206 return s; 207 } 208 } 209 /** 210 * 211 * 212 * <pre> 213 * Entity textual description, expressed in its `locale` language. 214 * </pre> 215 * 216 * <code>string description = 3;</code> 217 * 218 * @return The bytes for description. 219 */ 220 @java.lang.Override getDescriptionBytes()221 public com.google.protobuf.ByteString getDescriptionBytes() { 222 java.lang.Object ref = description_; 223 if (ref instanceof java.lang.String) { 224 com.google.protobuf.ByteString b = 225 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 226 description_ = b; 227 return b; 228 } else { 229 return (com.google.protobuf.ByteString) ref; 230 } 231 } 232 233 public static final int SCORE_FIELD_NUMBER = 4; 234 private float score_ = 0F; 235 /** 236 * 237 * 238 * <pre> 239 * Overall score of the result. Range [0, 1]. 240 * </pre> 241 * 242 * <code>float score = 4;</code> 243 * 244 * @return The score. 245 */ 246 @java.lang.Override getScore()247 public float getScore() { 248 return score_; 249 } 250 251 public static final int CONFIDENCE_FIELD_NUMBER = 5; 252 private float confidence_ = 0F; 253 /** 254 * 255 * 256 * <pre> 257 * **Deprecated. Use `score` instead.** 258 * The accuracy of the entity detection in an image. 259 * For example, for an image in which the "Eiffel Tower" entity is detected, 260 * this field represents the confidence that there is a tower in the query 261 * image. Range [0, 1]. 262 * </pre> 263 * 264 * <code>float confidence = 5 [deprecated = true];</code> 265 * 266 * @deprecated google.cloud.vision.v1.EntityAnnotation.confidence is deprecated. See 267 * google/cloud/vision/v1/image_annotator.proto;l=506 268 * @return The confidence. 269 */ 270 @java.lang.Override 271 @java.lang.Deprecated getConfidence()272 public float getConfidence() { 273 return confidence_; 274 } 275 276 public static final int TOPICALITY_FIELD_NUMBER = 6; 277 private float topicality_ = 0F; 278 /** 279 * 280 * 281 * <pre> 282 * The relevancy of the ICA (Image Content Annotation) label to the 283 * image. For example, the relevancy of "tower" is likely higher to an image 284 * containing the detected "Eiffel Tower" than to an image containing a 285 * detected distant towering building, even though the confidence that 286 * there is a tower in each image may be the same. Range [0, 1]. 287 * </pre> 288 * 289 * <code>float topicality = 6;</code> 290 * 291 * @return The topicality. 292 */ 293 @java.lang.Override getTopicality()294 public float getTopicality() { 295 return topicality_; 296 } 297 298 public static final int BOUNDING_POLY_FIELD_NUMBER = 7; 299 private com.google.cloud.vision.v1.BoundingPoly boundingPoly_; 300 /** 301 * 302 * 303 * <pre> 304 * Image region to which this entity belongs. Not produced 305 * for `LABEL_DETECTION` features. 306 * </pre> 307 * 308 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 309 * 310 * @return Whether the boundingPoly field is set. 311 */ 312 @java.lang.Override hasBoundingPoly()313 public boolean hasBoundingPoly() { 314 return boundingPoly_ != null; 315 } 316 /** 317 * 318 * 319 * <pre> 320 * Image region to which this entity belongs. Not produced 321 * for `LABEL_DETECTION` features. 322 * </pre> 323 * 324 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 325 * 326 * @return The boundingPoly. 327 */ 328 @java.lang.Override getBoundingPoly()329 public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { 330 return boundingPoly_ == null 331 ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() 332 : boundingPoly_; 333 } 334 /** 335 * 336 * 337 * <pre> 338 * Image region to which this entity belongs. Not produced 339 * for `LABEL_DETECTION` features. 340 * </pre> 341 * 342 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 343 */ 344 @java.lang.Override getBoundingPolyOrBuilder()345 public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 346 return boundingPoly_ == null 347 ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() 348 : boundingPoly_; 349 } 350 351 public static final int LOCATIONS_FIELD_NUMBER = 8; 352 353 @SuppressWarnings("serial") 354 private java.util.List<com.google.cloud.vision.v1.LocationInfo> locations_; 355 /** 356 * 357 * 358 * <pre> 359 * The location information for the detected entity. Multiple 360 * `LocationInfo` elements can be present because one location may 361 * indicate the location of the scene in the image, and another location 362 * may indicate the location of the place where the image was taken. 363 * Location information is usually present for landmarks. 364 * </pre> 365 * 366 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 367 */ 368 @java.lang.Override getLocationsList()369 public java.util.List<com.google.cloud.vision.v1.LocationInfo> getLocationsList() { 370 return locations_; 371 } 372 /** 373 * 374 * 375 * <pre> 376 * The location information for the detected entity. Multiple 377 * `LocationInfo` elements can be present because one location may 378 * indicate the location of the scene in the image, and another location 379 * may indicate the location of the place where the image was taken. 380 * Location information is usually present for landmarks. 381 * </pre> 382 * 383 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 384 */ 385 @java.lang.Override 386 public java.util.List<? extends com.google.cloud.vision.v1.LocationInfoOrBuilder> getLocationsOrBuilderList()387 getLocationsOrBuilderList() { 388 return locations_; 389 } 390 /** 391 * 392 * 393 * <pre> 394 * The location information for the detected entity. Multiple 395 * `LocationInfo` elements can be present because one location may 396 * indicate the location of the scene in the image, and another location 397 * may indicate the location of the place where the image was taken. 398 * Location information is usually present for landmarks. 399 * </pre> 400 * 401 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 402 */ 403 @java.lang.Override getLocationsCount()404 public int getLocationsCount() { 405 return locations_.size(); 406 } 407 /** 408 * 409 * 410 * <pre> 411 * The location information for the detected entity. Multiple 412 * `LocationInfo` elements can be present because one location may 413 * indicate the location of the scene in the image, and another location 414 * may indicate the location of the place where the image was taken. 415 * Location information is usually present for landmarks. 416 * </pre> 417 * 418 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 419 */ 420 @java.lang.Override getLocations(int index)421 public com.google.cloud.vision.v1.LocationInfo getLocations(int index) { 422 return locations_.get(index); 423 } 424 /** 425 * 426 * 427 * <pre> 428 * The location information for the detected entity. Multiple 429 * `LocationInfo` elements can be present because one location may 430 * indicate the location of the scene in the image, and another location 431 * may indicate the location of the place where the image was taken. 432 * Location information is usually present for landmarks. 433 * </pre> 434 * 435 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 436 */ 437 @java.lang.Override getLocationsOrBuilder(int index)438 public com.google.cloud.vision.v1.LocationInfoOrBuilder getLocationsOrBuilder(int index) { 439 return locations_.get(index); 440 } 441 442 public static final int PROPERTIES_FIELD_NUMBER = 9; 443 444 @SuppressWarnings("serial") 445 private java.util.List<com.google.cloud.vision.v1.Property> properties_; 446 /** 447 * 448 * 449 * <pre> 450 * Some entities may have optional user-supplied `Property` (name/value) 451 * fields, such a score or string that qualifies the entity. 452 * </pre> 453 * 454 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 455 */ 456 @java.lang.Override getPropertiesList()457 public java.util.List<com.google.cloud.vision.v1.Property> getPropertiesList() { 458 return properties_; 459 } 460 /** 461 * 462 * 463 * <pre> 464 * Some entities may have optional user-supplied `Property` (name/value) 465 * fields, such a score or string that qualifies the entity. 466 * </pre> 467 * 468 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 469 */ 470 @java.lang.Override 471 public java.util.List<? extends com.google.cloud.vision.v1.PropertyOrBuilder> getPropertiesOrBuilderList()472 getPropertiesOrBuilderList() { 473 return properties_; 474 } 475 /** 476 * 477 * 478 * <pre> 479 * Some entities may have optional user-supplied `Property` (name/value) 480 * fields, such a score or string that qualifies the entity. 481 * </pre> 482 * 483 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 484 */ 485 @java.lang.Override getPropertiesCount()486 public int getPropertiesCount() { 487 return properties_.size(); 488 } 489 /** 490 * 491 * 492 * <pre> 493 * Some entities may have optional user-supplied `Property` (name/value) 494 * fields, such a score or string that qualifies the entity. 495 * </pre> 496 * 497 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 498 */ 499 @java.lang.Override getProperties(int index)500 public com.google.cloud.vision.v1.Property getProperties(int index) { 501 return properties_.get(index); 502 } 503 /** 504 * 505 * 506 * <pre> 507 * Some entities may have optional user-supplied `Property` (name/value) 508 * fields, such a score or string that qualifies the entity. 509 * </pre> 510 * 511 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 512 */ 513 @java.lang.Override getPropertiesOrBuilder(int index)514 public com.google.cloud.vision.v1.PropertyOrBuilder getPropertiesOrBuilder(int index) { 515 return properties_.get(index); 516 } 517 518 private byte memoizedIsInitialized = -1; 519 520 @java.lang.Override isInitialized()521 public final boolean isInitialized() { 522 byte isInitialized = memoizedIsInitialized; 523 if (isInitialized == 1) return true; 524 if (isInitialized == 0) return false; 525 526 memoizedIsInitialized = 1; 527 return true; 528 } 529 530 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)531 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 532 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) { 533 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); 534 } 535 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locale_)) { 536 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, locale_); 537 } 538 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 539 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); 540 } 541 if (java.lang.Float.floatToRawIntBits(score_) != 0) { 542 output.writeFloat(4, score_); 543 } 544 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 545 output.writeFloat(5, confidence_); 546 } 547 if (java.lang.Float.floatToRawIntBits(topicality_) != 0) { 548 output.writeFloat(6, topicality_); 549 } 550 if (boundingPoly_ != null) { 551 output.writeMessage(7, getBoundingPoly()); 552 } 553 for (int i = 0; i < locations_.size(); i++) { 554 output.writeMessage(8, locations_.get(i)); 555 } 556 for (int i = 0; i < properties_.size(); i++) { 557 output.writeMessage(9, properties_.get(i)); 558 } 559 getUnknownFields().writeTo(output); 560 } 561 562 @java.lang.Override getSerializedSize()563 public int getSerializedSize() { 564 int size = memoizedSize; 565 if (size != -1) return size; 566 567 size = 0; 568 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mid_)) { 569 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); 570 } 571 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locale_)) { 572 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, locale_); 573 } 574 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 575 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); 576 } 577 if (java.lang.Float.floatToRawIntBits(score_) != 0) { 578 size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, score_); 579 } 580 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 581 size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_); 582 } 583 if (java.lang.Float.floatToRawIntBits(topicality_) != 0) { 584 size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, topicality_); 585 } 586 if (boundingPoly_ != null) { 587 size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getBoundingPoly()); 588 } 589 for (int i = 0; i < locations_.size(); i++) { 590 size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, locations_.get(i)); 591 } 592 for (int i = 0; i < properties_.size(); i++) { 593 size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, properties_.get(i)); 594 } 595 size += getUnknownFields().getSerializedSize(); 596 memoizedSize = size; 597 return size; 598 } 599 600 @java.lang.Override equals(final java.lang.Object obj)601 public boolean equals(final java.lang.Object obj) { 602 if (obj == this) { 603 return true; 604 } 605 if (!(obj instanceof com.google.cloud.vision.v1.EntityAnnotation)) { 606 return super.equals(obj); 607 } 608 com.google.cloud.vision.v1.EntityAnnotation other = 609 (com.google.cloud.vision.v1.EntityAnnotation) obj; 610 611 if (!getMid().equals(other.getMid())) return false; 612 if (!getLocale().equals(other.getLocale())) return false; 613 if (!getDescription().equals(other.getDescription())) return false; 614 if (java.lang.Float.floatToIntBits(getScore()) 615 != java.lang.Float.floatToIntBits(other.getScore())) return false; 616 if (java.lang.Float.floatToIntBits(getConfidence()) 617 != java.lang.Float.floatToIntBits(other.getConfidence())) return false; 618 if (java.lang.Float.floatToIntBits(getTopicality()) 619 != java.lang.Float.floatToIntBits(other.getTopicality())) return false; 620 if (hasBoundingPoly() != other.hasBoundingPoly()) return false; 621 if (hasBoundingPoly()) { 622 if (!getBoundingPoly().equals(other.getBoundingPoly())) return false; 623 } 624 if (!getLocationsList().equals(other.getLocationsList())) return false; 625 if (!getPropertiesList().equals(other.getPropertiesList())) return false; 626 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 627 return true; 628 } 629 630 @java.lang.Override hashCode()631 public int hashCode() { 632 if (memoizedHashCode != 0) { 633 return memoizedHashCode; 634 } 635 int hash = 41; 636 hash = (19 * hash) + getDescriptor().hashCode(); 637 hash = (37 * hash) + MID_FIELD_NUMBER; 638 hash = (53 * hash) + getMid().hashCode(); 639 hash = (37 * hash) + LOCALE_FIELD_NUMBER; 640 hash = (53 * hash) + getLocale().hashCode(); 641 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 642 hash = (53 * hash) + getDescription().hashCode(); 643 hash = (37 * hash) + SCORE_FIELD_NUMBER; 644 hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); 645 hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; 646 hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); 647 hash = (37 * hash) + TOPICALITY_FIELD_NUMBER; 648 hash = (53 * hash) + java.lang.Float.floatToIntBits(getTopicality()); 649 if (hasBoundingPoly()) { 650 hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; 651 hash = (53 * hash) + getBoundingPoly().hashCode(); 652 } 653 if (getLocationsCount() > 0) { 654 hash = (37 * hash) + LOCATIONS_FIELD_NUMBER; 655 hash = (53 * hash) + getLocationsList().hashCode(); 656 } 657 if (getPropertiesCount() > 0) { 658 hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; 659 hash = (53 * hash) + getPropertiesList().hashCode(); 660 } 661 hash = (29 * hash) + getUnknownFields().hashCode(); 662 memoizedHashCode = hash; 663 return hash; 664 } 665 parseFrom(java.nio.ByteBuffer data)666 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom(java.nio.ByteBuffer data) 667 throws com.google.protobuf.InvalidProtocolBufferException { 668 return PARSER.parseFrom(data); 669 } 670 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)671 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 672 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 673 throws com.google.protobuf.InvalidProtocolBufferException { 674 return PARSER.parseFrom(data, extensionRegistry); 675 } 676 parseFrom( com.google.protobuf.ByteString data)677 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 678 com.google.protobuf.ByteString data) 679 throws com.google.protobuf.InvalidProtocolBufferException { 680 return PARSER.parseFrom(data); 681 } 682 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)683 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 684 com.google.protobuf.ByteString data, 685 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 686 throws com.google.protobuf.InvalidProtocolBufferException { 687 return PARSER.parseFrom(data, extensionRegistry); 688 } 689 parseFrom(byte[] data)690 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom(byte[] data) 691 throws com.google.protobuf.InvalidProtocolBufferException { 692 return PARSER.parseFrom(data); 693 } 694 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)695 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 696 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 697 throws com.google.protobuf.InvalidProtocolBufferException { 698 return PARSER.parseFrom(data, extensionRegistry); 699 } 700 parseFrom(java.io.InputStream input)701 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom(java.io.InputStream input) 702 throws java.io.IOException { 703 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 704 } 705 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)706 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 707 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 708 throws java.io.IOException { 709 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 710 PARSER, input, extensionRegistry); 711 } 712 parseDelimitedFrom( java.io.InputStream input)713 public static com.google.cloud.vision.v1.EntityAnnotation parseDelimitedFrom( 714 java.io.InputStream input) throws java.io.IOException { 715 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 716 } 717 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)718 public static com.google.cloud.vision.v1.EntityAnnotation parseDelimitedFrom( 719 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 720 throws java.io.IOException { 721 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 722 PARSER, input, extensionRegistry); 723 } 724 parseFrom( com.google.protobuf.CodedInputStream input)725 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 726 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 727 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 728 } 729 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)730 public static com.google.cloud.vision.v1.EntityAnnotation parseFrom( 731 com.google.protobuf.CodedInputStream input, 732 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 733 throws java.io.IOException { 734 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 735 PARSER, input, extensionRegistry); 736 } 737 738 @java.lang.Override newBuilderForType()739 public Builder newBuilderForType() { 740 return newBuilder(); 741 } 742 newBuilder()743 public static Builder newBuilder() { 744 return DEFAULT_INSTANCE.toBuilder(); 745 } 746 newBuilder(com.google.cloud.vision.v1.EntityAnnotation prototype)747 public static Builder newBuilder(com.google.cloud.vision.v1.EntityAnnotation prototype) { 748 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 749 } 750 751 @java.lang.Override toBuilder()752 public Builder toBuilder() { 753 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 754 } 755 756 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)757 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 758 Builder builder = new Builder(parent); 759 return builder; 760 } 761 /** 762 * 763 * 764 * <pre> 765 * Set of detected entity features. 766 * </pre> 767 * 768 * Protobuf type {@code google.cloud.vision.v1.EntityAnnotation} 769 */ 770 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 771 implements 772 // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.EntityAnnotation) 773 com.google.cloud.vision.v1.EntityAnnotationOrBuilder { getDescriptor()774 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 775 return com.google.cloud.vision.v1.ImageAnnotatorProto 776 .internal_static_google_cloud_vision_v1_EntityAnnotation_descriptor; 777 } 778 779 @java.lang.Override 780 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()781 internalGetFieldAccessorTable() { 782 return com.google.cloud.vision.v1.ImageAnnotatorProto 783 .internal_static_google_cloud_vision_v1_EntityAnnotation_fieldAccessorTable 784 .ensureFieldAccessorsInitialized( 785 com.google.cloud.vision.v1.EntityAnnotation.class, 786 com.google.cloud.vision.v1.EntityAnnotation.Builder.class); 787 } 788 789 // Construct using com.google.cloud.vision.v1.EntityAnnotation.newBuilder() Builder()790 private Builder() {} 791 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)792 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 793 super(parent); 794 } 795 796 @java.lang.Override clear()797 public Builder clear() { 798 super.clear(); 799 bitField0_ = 0; 800 mid_ = ""; 801 locale_ = ""; 802 description_ = ""; 803 score_ = 0F; 804 confidence_ = 0F; 805 topicality_ = 0F; 806 boundingPoly_ = null; 807 if (boundingPolyBuilder_ != null) { 808 boundingPolyBuilder_.dispose(); 809 boundingPolyBuilder_ = null; 810 } 811 if (locationsBuilder_ == null) { 812 locations_ = java.util.Collections.emptyList(); 813 } else { 814 locations_ = null; 815 locationsBuilder_.clear(); 816 } 817 bitField0_ = (bitField0_ & ~0x00000080); 818 if (propertiesBuilder_ == null) { 819 properties_ = java.util.Collections.emptyList(); 820 } else { 821 properties_ = null; 822 propertiesBuilder_.clear(); 823 } 824 bitField0_ = (bitField0_ & ~0x00000100); 825 return this; 826 } 827 828 @java.lang.Override getDescriptorForType()829 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 830 return com.google.cloud.vision.v1.ImageAnnotatorProto 831 .internal_static_google_cloud_vision_v1_EntityAnnotation_descriptor; 832 } 833 834 @java.lang.Override getDefaultInstanceForType()835 public com.google.cloud.vision.v1.EntityAnnotation getDefaultInstanceForType() { 836 return com.google.cloud.vision.v1.EntityAnnotation.getDefaultInstance(); 837 } 838 839 @java.lang.Override build()840 public com.google.cloud.vision.v1.EntityAnnotation build() { 841 com.google.cloud.vision.v1.EntityAnnotation result = buildPartial(); 842 if (!result.isInitialized()) { 843 throw newUninitializedMessageException(result); 844 } 845 return result; 846 } 847 848 @java.lang.Override buildPartial()849 public com.google.cloud.vision.v1.EntityAnnotation buildPartial() { 850 com.google.cloud.vision.v1.EntityAnnotation result = 851 new com.google.cloud.vision.v1.EntityAnnotation(this); 852 buildPartialRepeatedFields(result); 853 if (bitField0_ != 0) { 854 buildPartial0(result); 855 } 856 onBuilt(); 857 return result; 858 } 859 buildPartialRepeatedFields(com.google.cloud.vision.v1.EntityAnnotation result)860 private void buildPartialRepeatedFields(com.google.cloud.vision.v1.EntityAnnotation result) { 861 if (locationsBuilder_ == null) { 862 if (((bitField0_ & 0x00000080) != 0)) { 863 locations_ = java.util.Collections.unmodifiableList(locations_); 864 bitField0_ = (bitField0_ & ~0x00000080); 865 } 866 result.locations_ = locations_; 867 } else { 868 result.locations_ = locationsBuilder_.build(); 869 } 870 if (propertiesBuilder_ == null) { 871 if (((bitField0_ & 0x00000100) != 0)) { 872 properties_ = java.util.Collections.unmodifiableList(properties_); 873 bitField0_ = (bitField0_ & ~0x00000100); 874 } 875 result.properties_ = properties_; 876 } else { 877 result.properties_ = propertiesBuilder_.build(); 878 } 879 } 880 buildPartial0(com.google.cloud.vision.v1.EntityAnnotation result)881 private void buildPartial0(com.google.cloud.vision.v1.EntityAnnotation result) { 882 int from_bitField0_ = bitField0_; 883 if (((from_bitField0_ & 0x00000001) != 0)) { 884 result.mid_ = mid_; 885 } 886 if (((from_bitField0_ & 0x00000002) != 0)) { 887 result.locale_ = locale_; 888 } 889 if (((from_bitField0_ & 0x00000004) != 0)) { 890 result.description_ = description_; 891 } 892 if (((from_bitField0_ & 0x00000008) != 0)) { 893 result.score_ = score_; 894 } 895 if (((from_bitField0_ & 0x00000010) != 0)) { 896 result.confidence_ = confidence_; 897 } 898 if (((from_bitField0_ & 0x00000020) != 0)) { 899 result.topicality_ = topicality_; 900 } 901 if (((from_bitField0_ & 0x00000040) != 0)) { 902 result.boundingPoly_ = 903 boundingPolyBuilder_ == null ? boundingPoly_ : boundingPolyBuilder_.build(); 904 } 905 } 906 907 @java.lang.Override clone()908 public Builder clone() { 909 return super.clone(); 910 } 911 912 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)913 public Builder setField( 914 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 915 return super.setField(field, value); 916 } 917 918 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)919 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 920 return super.clearField(field); 921 } 922 923 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)924 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 925 return super.clearOneof(oneof); 926 } 927 928 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)929 public Builder setRepeatedField( 930 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 931 return super.setRepeatedField(field, index, value); 932 } 933 934 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)935 public Builder addRepeatedField( 936 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 937 return super.addRepeatedField(field, value); 938 } 939 940 @java.lang.Override mergeFrom(com.google.protobuf.Message other)941 public Builder mergeFrom(com.google.protobuf.Message other) { 942 if (other instanceof com.google.cloud.vision.v1.EntityAnnotation) { 943 return mergeFrom((com.google.cloud.vision.v1.EntityAnnotation) other); 944 } else { 945 super.mergeFrom(other); 946 return this; 947 } 948 } 949 mergeFrom(com.google.cloud.vision.v1.EntityAnnotation other)950 public Builder mergeFrom(com.google.cloud.vision.v1.EntityAnnotation other) { 951 if (other == com.google.cloud.vision.v1.EntityAnnotation.getDefaultInstance()) return this; 952 if (!other.getMid().isEmpty()) { 953 mid_ = other.mid_; 954 bitField0_ |= 0x00000001; 955 onChanged(); 956 } 957 if (!other.getLocale().isEmpty()) { 958 locale_ = other.locale_; 959 bitField0_ |= 0x00000002; 960 onChanged(); 961 } 962 if (!other.getDescription().isEmpty()) { 963 description_ = other.description_; 964 bitField0_ |= 0x00000004; 965 onChanged(); 966 } 967 if (other.getScore() != 0F) { 968 setScore(other.getScore()); 969 } 970 if (other.getConfidence() != 0F) { 971 setConfidence(other.getConfidence()); 972 } 973 if (other.getTopicality() != 0F) { 974 setTopicality(other.getTopicality()); 975 } 976 if (other.hasBoundingPoly()) { 977 mergeBoundingPoly(other.getBoundingPoly()); 978 } 979 if (locationsBuilder_ == null) { 980 if (!other.locations_.isEmpty()) { 981 if (locations_.isEmpty()) { 982 locations_ = other.locations_; 983 bitField0_ = (bitField0_ & ~0x00000080); 984 } else { 985 ensureLocationsIsMutable(); 986 locations_.addAll(other.locations_); 987 } 988 onChanged(); 989 } 990 } else { 991 if (!other.locations_.isEmpty()) { 992 if (locationsBuilder_.isEmpty()) { 993 locationsBuilder_.dispose(); 994 locationsBuilder_ = null; 995 locations_ = other.locations_; 996 bitField0_ = (bitField0_ & ~0x00000080); 997 locationsBuilder_ = 998 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 999 ? getLocationsFieldBuilder() 1000 : null; 1001 } else { 1002 locationsBuilder_.addAllMessages(other.locations_); 1003 } 1004 } 1005 } 1006 if (propertiesBuilder_ == null) { 1007 if (!other.properties_.isEmpty()) { 1008 if (properties_.isEmpty()) { 1009 properties_ = other.properties_; 1010 bitField0_ = (bitField0_ & ~0x00000100); 1011 } else { 1012 ensurePropertiesIsMutable(); 1013 properties_.addAll(other.properties_); 1014 } 1015 onChanged(); 1016 } 1017 } else { 1018 if (!other.properties_.isEmpty()) { 1019 if (propertiesBuilder_.isEmpty()) { 1020 propertiesBuilder_.dispose(); 1021 propertiesBuilder_ = null; 1022 properties_ = other.properties_; 1023 bitField0_ = (bitField0_ & ~0x00000100); 1024 propertiesBuilder_ = 1025 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1026 ? getPropertiesFieldBuilder() 1027 : null; 1028 } else { 1029 propertiesBuilder_.addAllMessages(other.properties_); 1030 } 1031 } 1032 } 1033 this.mergeUnknownFields(other.getUnknownFields()); 1034 onChanged(); 1035 return this; 1036 } 1037 1038 @java.lang.Override isInitialized()1039 public final boolean isInitialized() { 1040 return true; 1041 } 1042 1043 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1044 public Builder mergeFrom( 1045 com.google.protobuf.CodedInputStream input, 1046 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1047 throws java.io.IOException { 1048 if (extensionRegistry == null) { 1049 throw new java.lang.NullPointerException(); 1050 } 1051 try { 1052 boolean done = false; 1053 while (!done) { 1054 int tag = input.readTag(); 1055 switch (tag) { 1056 case 0: 1057 done = true; 1058 break; 1059 case 10: 1060 { 1061 mid_ = input.readStringRequireUtf8(); 1062 bitField0_ |= 0x00000001; 1063 break; 1064 } // case 10 1065 case 18: 1066 { 1067 locale_ = input.readStringRequireUtf8(); 1068 bitField0_ |= 0x00000002; 1069 break; 1070 } // case 18 1071 case 26: 1072 { 1073 description_ = input.readStringRequireUtf8(); 1074 bitField0_ |= 0x00000004; 1075 break; 1076 } // case 26 1077 case 37: 1078 { 1079 score_ = input.readFloat(); 1080 bitField0_ |= 0x00000008; 1081 break; 1082 } // case 37 1083 case 45: 1084 { 1085 confidence_ = input.readFloat(); 1086 bitField0_ |= 0x00000010; 1087 break; 1088 } // case 45 1089 case 53: 1090 { 1091 topicality_ = input.readFloat(); 1092 bitField0_ |= 0x00000020; 1093 break; 1094 } // case 53 1095 case 58: 1096 { 1097 input.readMessage(getBoundingPolyFieldBuilder().getBuilder(), extensionRegistry); 1098 bitField0_ |= 0x00000040; 1099 break; 1100 } // case 58 1101 case 66: 1102 { 1103 com.google.cloud.vision.v1.LocationInfo m = 1104 input.readMessage( 1105 com.google.cloud.vision.v1.LocationInfo.parser(), extensionRegistry); 1106 if (locationsBuilder_ == null) { 1107 ensureLocationsIsMutable(); 1108 locations_.add(m); 1109 } else { 1110 locationsBuilder_.addMessage(m); 1111 } 1112 break; 1113 } // case 66 1114 case 74: 1115 { 1116 com.google.cloud.vision.v1.Property m = 1117 input.readMessage( 1118 com.google.cloud.vision.v1.Property.parser(), extensionRegistry); 1119 if (propertiesBuilder_ == null) { 1120 ensurePropertiesIsMutable(); 1121 properties_.add(m); 1122 } else { 1123 propertiesBuilder_.addMessage(m); 1124 } 1125 break; 1126 } // case 74 1127 default: 1128 { 1129 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1130 done = true; // was an endgroup tag 1131 } 1132 break; 1133 } // default: 1134 } // switch (tag) 1135 } // while (!done) 1136 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1137 throw e.unwrapIOException(); 1138 } finally { 1139 onChanged(); 1140 } // finally 1141 return this; 1142 } 1143 1144 private int bitField0_; 1145 1146 private java.lang.Object mid_ = ""; 1147 /** 1148 * 1149 * 1150 * <pre> 1151 * Opaque entity ID. Some IDs may be available in 1152 * [Google Knowledge Graph Search 1153 * API](https://developers.google.com/knowledge-graph/). 1154 * </pre> 1155 * 1156 * <code>string mid = 1;</code> 1157 * 1158 * @return The mid. 1159 */ getMid()1160 public java.lang.String getMid() { 1161 java.lang.Object ref = mid_; 1162 if (!(ref instanceof java.lang.String)) { 1163 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1164 java.lang.String s = bs.toStringUtf8(); 1165 mid_ = s; 1166 return s; 1167 } else { 1168 return (java.lang.String) ref; 1169 } 1170 } 1171 /** 1172 * 1173 * 1174 * <pre> 1175 * Opaque entity ID. Some IDs may be available in 1176 * [Google Knowledge Graph Search 1177 * API](https://developers.google.com/knowledge-graph/). 1178 * </pre> 1179 * 1180 * <code>string mid = 1;</code> 1181 * 1182 * @return The bytes for mid. 1183 */ getMidBytes()1184 public com.google.protobuf.ByteString getMidBytes() { 1185 java.lang.Object ref = mid_; 1186 if (ref instanceof String) { 1187 com.google.protobuf.ByteString b = 1188 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1189 mid_ = b; 1190 return b; 1191 } else { 1192 return (com.google.protobuf.ByteString) ref; 1193 } 1194 } 1195 /** 1196 * 1197 * 1198 * <pre> 1199 * Opaque entity ID. Some IDs may be available in 1200 * [Google Knowledge Graph Search 1201 * API](https://developers.google.com/knowledge-graph/). 1202 * </pre> 1203 * 1204 * <code>string mid = 1;</code> 1205 * 1206 * @param value The mid to set. 1207 * @return This builder for chaining. 1208 */ setMid(java.lang.String value)1209 public Builder setMid(java.lang.String value) { 1210 if (value == null) { 1211 throw new NullPointerException(); 1212 } 1213 mid_ = value; 1214 bitField0_ |= 0x00000001; 1215 onChanged(); 1216 return this; 1217 } 1218 /** 1219 * 1220 * 1221 * <pre> 1222 * Opaque entity ID. Some IDs may be available in 1223 * [Google Knowledge Graph Search 1224 * API](https://developers.google.com/knowledge-graph/). 1225 * </pre> 1226 * 1227 * <code>string mid = 1;</code> 1228 * 1229 * @return This builder for chaining. 1230 */ clearMid()1231 public Builder clearMid() { 1232 mid_ = getDefaultInstance().getMid(); 1233 bitField0_ = (bitField0_ & ~0x00000001); 1234 onChanged(); 1235 return this; 1236 } 1237 /** 1238 * 1239 * 1240 * <pre> 1241 * Opaque entity ID. Some IDs may be available in 1242 * [Google Knowledge Graph Search 1243 * API](https://developers.google.com/knowledge-graph/). 1244 * </pre> 1245 * 1246 * <code>string mid = 1;</code> 1247 * 1248 * @param value The bytes for mid to set. 1249 * @return This builder for chaining. 1250 */ setMidBytes(com.google.protobuf.ByteString value)1251 public Builder setMidBytes(com.google.protobuf.ByteString value) { 1252 if (value == null) { 1253 throw new NullPointerException(); 1254 } 1255 checkByteStringIsUtf8(value); 1256 mid_ = value; 1257 bitField0_ |= 0x00000001; 1258 onChanged(); 1259 return this; 1260 } 1261 1262 private java.lang.Object locale_ = ""; 1263 /** 1264 * 1265 * 1266 * <pre> 1267 * The language code for the locale in which the entity textual 1268 * `description` is expressed. 1269 * </pre> 1270 * 1271 * <code>string locale = 2;</code> 1272 * 1273 * @return The locale. 1274 */ getLocale()1275 public java.lang.String getLocale() { 1276 java.lang.Object ref = locale_; 1277 if (!(ref instanceof java.lang.String)) { 1278 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1279 java.lang.String s = bs.toStringUtf8(); 1280 locale_ = s; 1281 return s; 1282 } else { 1283 return (java.lang.String) ref; 1284 } 1285 } 1286 /** 1287 * 1288 * 1289 * <pre> 1290 * The language code for the locale in which the entity textual 1291 * `description` is expressed. 1292 * </pre> 1293 * 1294 * <code>string locale = 2;</code> 1295 * 1296 * @return The bytes for locale. 1297 */ getLocaleBytes()1298 public com.google.protobuf.ByteString getLocaleBytes() { 1299 java.lang.Object ref = locale_; 1300 if (ref instanceof String) { 1301 com.google.protobuf.ByteString b = 1302 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1303 locale_ = b; 1304 return b; 1305 } else { 1306 return (com.google.protobuf.ByteString) ref; 1307 } 1308 } 1309 /** 1310 * 1311 * 1312 * <pre> 1313 * The language code for the locale in which the entity textual 1314 * `description` is expressed. 1315 * </pre> 1316 * 1317 * <code>string locale = 2;</code> 1318 * 1319 * @param value The locale to set. 1320 * @return This builder for chaining. 1321 */ setLocale(java.lang.String value)1322 public Builder setLocale(java.lang.String value) { 1323 if (value == null) { 1324 throw new NullPointerException(); 1325 } 1326 locale_ = value; 1327 bitField0_ |= 0x00000002; 1328 onChanged(); 1329 return this; 1330 } 1331 /** 1332 * 1333 * 1334 * <pre> 1335 * The language code for the locale in which the entity textual 1336 * `description` is expressed. 1337 * </pre> 1338 * 1339 * <code>string locale = 2;</code> 1340 * 1341 * @return This builder for chaining. 1342 */ clearLocale()1343 public Builder clearLocale() { 1344 locale_ = getDefaultInstance().getLocale(); 1345 bitField0_ = (bitField0_ & ~0x00000002); 1346 onChanged(); 1347 return this; 1348 } 1349 /** 1350 * 1351 * 1352 * <pre> 1353 * The language code for the locale in which the entity textual 1354 * `description` is expressed. 1355 * </pre> 1356 * 1357 * <code>string locale = 2;</code> 1358 * 1359 * @param value The bytes for locale to set. 1360 * @return This builder for chaining. 1361 */ setLocaleBytes(com.google.protobuf.ByteString value)1362 public Builder setLocaleBytes(com.google.protobuf.ByteString value) { 1363 if (value == null) { 1364 throw new NullPointerException(); 1365 } 1366 checkByteStringIsUtf8(value); 1367 locale_ = value; 1368 bitField0_ |= 0x00000002; 1369 onChanged(); 1370 return this; 1371 } 1372 1373 private java.lang.Object description_ = ""; 1374 /** 1375 * 1376 * 1377 * <pre> 1378 * Entity textual description, expressed in its `locale` language. 1379 * </pre> 1380 * 1381 * <code>string description = 3;</code> 1382 * 1383 * @return The description. 1384 */ getDescription()1385 public java.lang.String getDescription() { 1386 java.lang.Object ref = description_; 1387 if (!(ref instanceof java.lang.String)) { 1388 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1389 java.lang.String s = bs.toStringUtf8(); 1390 description_ = s; 1391 return s; 1392 } else { 1393 return (java.lang.String) ref; 1394 } 1395 } 1396 /** 1397 * 1398 * 1399 * <pre> 1400 * Entity textual description, expressed in its `locale` language. 1401 * </pre> 1402 * 1403 * <code>string description = 3;</code> 1404 * 1405 * @return The bytes for description. 1406 */ getDescriptionBytes()1407 public com.google.protobuf.ByteString getDescriptionBytes() { 1408 java.lang.Object ref = description_; 1409 if (ref instanceof String) { 1410 com.google.protobuf.ByteString b = 1411 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1412 description_ = b; 1413 return b; 1414 } else { 1415 return (com.google.protobuf.ByteString) ref; 1416 } 1417 } 1418 /** 1419 * 1420 * 1421 * <pre> 1422 * Entity textual description, expressed in its `locale` language. 1423 * </pre> 1424 * 1425 * <code>string description = 3;</code> 1426 * 1427 * @param value The description to set. 1428 * @return This builder for chaining. 1429 */ setDescription(java.lang.String value)1430 public Builder setDescription(java.lang.String value) { 1431 if (value == null) { 1432 throw new NullPointerException(); 1433 } 1434 description_ = value; 1435 bitField0_ |= 0x00000004; 1436 onChanged(); 1437 return this; 1438 } 1439 /** 1440 * 1441 * 1442 * <pre> 1443 * Entity textual description, expressed in its `locale` language. 1444 * </pre> 1445 * 1446 * <code>string description = 3;</code> 1447 * 1448 * @return This builder for chaining. 1449 */ clearDescription()1450 public Builder clearDescription() { 1451 description_ = getDefaultInstance().getDescription(); 1452 bitField0_ = (bitField0_ & ~0x00000004); 1453 onChanged(); 1454 return this; 1455 } 1456 /** 1457 * 1458 * 1459 * <pre> 1460 * Entity textual description, expressed in its `locale` language. 1461 * </pre> 1462 * 1463 * <code>string description = 3;</code> 1464 * 1465 * @param value The bytes for description to set. 1466 * @return This builder for chaining. 1467 */ setDescriptionBytes(com.google.protobuf.ByteString value)1468 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 1469 if (value == null) { 1470 throw new NullPointerException(); 1471 } 1472 checkByteStringIsUtf8(value); 1473 description_ = value; 1474 bitField0_ |= 0x00000004; 1475 onChanged(); 1476 return this; 1477 } 1478 1479 private float score_; 1480 /** 1481 * 1482 * 1483 * <pre> 1484 * Overall score of the result. Range [0, 1]. 1485 * </pre> 1486 * 1487 * <code>float score = 4;</code> 1488 * 1489 * @return The score. 1490 */ 1491 @java.lang.Override getScore()1492 public float getScore() { 1493 return score_; 1494 } 1495 /** 1496 * 1497 * 1498 * <pre> 1499 * Overall score of the result. Range [0, 1]. 1500 * </pre> 1501 * 1502 * <code>float score = 4;</code> 1503 * 1504 * @param value The score to set. 1505 * @return This builder for chaining. 1506 */ setScore(float value)1507 public Builder setScore(float value) { 1508 1509 score_ = value; 1510 bitField0_ |= 0x00000008; 1511 onChanged(); 1512 return this; 1513 } 1514 /** 1515 * 1516 * 1517 * <pre> 1518 * Overall score of the result. Range [0, 1]. 1519 * </pre> 1520 * 1521 * <code>float score = 4;</code> 1522 * 1523 * @return This builder for chaining. 1524 */ clearScore()1525 public Builder clearScore() { 1526 bitField0_ = (bitField0_ & ~0x00000008); 1527 score_ = 0F; 1528 onChanged(); 1529 return this; 1530 } 1531 1532 private float confidence_; 1533 /** 1534 * 1535 * 1536 * <pre> 1537 * **Deprecated. Use `score` instead.** 1538 * The accuracy of the entity detection in an image. 1539 * For example, for an image in which the "Eiffel Tower" entity is detected, 1540 * this field represents the confidence that there is a tower in the query 1541 * image. Range [0, 1]. 1542 * </pre> 1543 * 1544 * <code>float confidence = 5 [deprecated = true];</code> 1545 * 1546 * @deprecated google.cloud.vision.v1.EntityAnnotation.confidence is deprecated. See 1547 * google/cloud/vision/v1/image_annotator.proto;l=506 1548 * @return The confidence. 1549 */ 1550 @java.lang.Override 1551 @java.lang.Deprecated getConfidence()1552 public float getConfidence() { 1553 return confidence_; 1554 } 1555 /** 1556 * 1557 * 1558 * <pre> 1559 * **Deprecated. Use `score` instead.** 1560 * The accuracy of the entity detection in an image. 1561 * For example, for an image in which the "Eiffel Tower" entity is detected, 1562 * this field represents the confidence that there is a tower in the query 1563 * image. Range [0, 1]. 1564 * </pre> 1565 * 1566 * <code>float confidence = 5 [deprecated = true];</code> 1567 * 1568 * @deprecated google.cloud.vision.v1.EntityAnnotation.confidence is deprecated. See 1569 * google/cloud/vision/v1/image_annotator.proto;l=506 1570 * @param value The confidence to set. 1571 * @return This builder for chaining. 1572 */ 1573 @java.lang.Deprecated setConfidence(float value)1574 public Builder setConfidence(float value) { 1575 1576 confidence_ = value; 1577 bitField0_ |= 0x00000010; 1578 onChanged(); 1579 return this; 1580 } 1581 /** 1582 * 1583 * 1584 * <pre> 1585 * **Deprecated. Use `score` instead.** 1586 * The accuracy of the entity detection in an image. 1587 * For example, for an image in which the "Eiffel Tower" entity is detected, 1588 * this field represents the confidence that there is a tower in the query 1589 * image. Range [0, 1]. 1590 * </pre> 1591 * 1592 * <code>float confidence = 5 [deprecated = true];</code> 1593 * 1594 * @deprecated google.cloud.vision.v1.EntityAnnotation.confidence is deprecated. See 1595 * google/cloud/vision/v1/image_annotator.proto;l=506 1596 * @return This builder for chaining. 1597 */ 1598 @java.lang.Deprecated clearConfidence()1599 public Builder clearConfidence() { 1600 bitField0_ = (bitField0_ & ~0x00000010); 1601 confidence_ = 0F; 1602 onChanged(); 1603 return this; 1604 } 1605 1606 private float topicality_; 1607 /** 1608 * 1609 * 1610 * <pre> 1611 * The relevancy of the ICA (Image Content Annotation) label to the 1612 * image. For example, the relevancy of "tower" is likely higher to an image 1613 * containing the detected "Eiffel Tower" than to an image containing a 1614 * detected distant towering building, even though the confidence that 1615 * there is a tower in each image may be the same. Range [0, 1]. 1616 * </pre> 1617 * 1618 * <code>float topicality = 6;</code> 1619 * 1620 * @return The topicality. 1621 */ 1622 @java.lang.Override getTopicality()1623 public float getTopicality() { 1624 return topicality_; 1625 } 1626 /** 1627 * 1628 * 1629 * <pre> 1630 * The relevancy of the ICA (Image Content Annotation) label to the 1631 * image. For example, the relevancy of "tower" is likely higher to an image 1632 * containing the detected "Eiffel Tower" than to an image containing a 1633 * detected distant towering building, even though the confidence that 1634 * there is a tower in each image may be the same. Range [0, 1]. 1635 * </pre> 1636 * 1637 * <code>float topicality = 6;</code> 1638 * 1639 * @param value The topicality to set. 1640 * @return This builder for chaining. 1641 */ setTopicality(float value)1642 public Builder setTopicality(float value) { 1643 1644 topicality_ = value; 1645 bitField0_ |= 0x00000020; 1646 onChanged(); 1647 return this; 1648 } 1649 /** 1650 * 1651 * 1652 * <pre> 1653 * The relevancy of the ICA (Image Content Annotation) label to the 1654 * image. For example, the relevancy of "tower" is likely higher to an image 1655 * containing the detected "Eiffel Tower" than to an image containing a 1656 * detected distant towering building, even though the confidence that 1657 * there is a tower in each image may be the same. Range [0, 1]. 1658 * </pre> 1659 * 1660 * <code>float topicality = 6;</code> 1661 * 1662 * @return This builder for chaining. 1663 */ clearTopicality()1664 public Builder clearTopicality() { 1665 bitField0_ = (bitField0_ & ~0x00000020); 1666 topicality_ = 0F; 1667 onChanged(); 1668 return this; 1669 } 1670 1671 private com.google.cloud.vision.v1.BoundingPoly boundingPoly_; 1672 private com.google.protobuf.SingleFieldBuilderV3< 1673 com.google.cloud.vision.v1.BoundingPoly, 1674 com.google.cloud.vision.v1.BoundingPoly.Builder, 1675 com.google.cloud.vision.v1.BoundingPolyOrBuilder> 1676 boundingPolyBuilder_; 1677 /** 1678 * 1679 * 1680 * <pre> 1681 * Image region to which this entity belongs. Not produced 1682 * for `LABEL_DETECTION` features. 1683 * </pre> 1684 * 1685 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1686 * 1687 * @return Whether the boundingPoly field is set. 1688 */ hasBoundingPoly()1689 public boolean hasBoundingPoly() { 1690 return ((bitField0_ & 0x00000040) != 0); 1691 } 1692 /** 1693 * 1694 * 1695 * <pre> 1696 * Image region to which this entity belongs. Not produced 1697 * for `LABEL_DETECTION` features. 1698 * </pre> 1699 * 1700 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1701 * 1702 * @return The boundingPoly. 1703 */ getBoundingPoly()1704 public com.google.cloud.vision.v1.BoundingPoly getBoundingPoly() { 1705 if (boundingPolyBuilder_ == null) { 1706 return boundingPoly_ == null 1707 ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() 1708 : boundingPoly_; 1709 } else { 1710 return boundingPolyBuilder_.getMessage(); 1711 } 1712 } 1713 /** 1714 * 1715 * 1716 * <pre> 1717 * Image region to which this entity belongs. Not produced 1718 * for `LABEL_DETECTION` features. 1719 * </pre> 1720 * 1721 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1722 */ setBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value)1723 public Builder setBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value) { 1724 if (boundingPolyBuilder_ == null) { 1725 if (value == null) { 1726 throw new NullPointerException(); 1727 } 1728 boundingPoly_ = value; 1729 } else { 1730 boundingPolyBuilder_.setMessage(value); 1731 } 1732 bitField0_ |= 0x00000040; 1733 onChanged(); 1734 return this; 1735 } 1736 /** 1737 * 1738 * 1739 * <pre> 1740 * Image region to which this entity belongs. Not produced 1741 * for `LABEL_DETECTION` features. 1742 * </pre> 1743 * 1744 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1745 */ setBoundingPoly( com.google.cloud.vision.v1.BoundingPoly.Builder builderForValue)1746 public Builder setBoundingPoly( 1747 com.google.cloud.vision.v1.BoundingPoly.Builder builderForValue) { 1748 if (boundingPolyBuilder_ == null) { 1749 boundingPoly_ = builderForValue.build(); 1750 } else { 1751 boundingPolyBuilder_.setMessage(builderForValue.build()); 1752 } 1753 bitField0_ |= 0x00000040; 1754 onChanged(); 1755 return this; 1756 } 1757 /** 1758 * 1759 * 1760 * <pre> 1761 * Image region to which this entity belongs. Not produced 1762 * for `LABEL_DETECTION` features. 1763 * </pre> 1764 * 1765 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1766 */ mergeBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value)1767 public Builder mergeBoundingPoly(com.google.cloud.vision.v1.BoundingPoly value) { 1768 if (boundingPolyBuilder_ == null) { 1769 if (((bitField0_ & 0x00000040) != 0) 1770 && boundingPoly_ != null 1771 && boundingPoly_ != com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance()) { 1772 getBoundingPolyBuilder().mergeFrom(value); 1773 } else { 1774 boundingPoly_ = value; 1775 } 1776 } else { 1777 boundingPolyBuilder_.mergeFrom(value); 1778 } 1779 bitField0_ |= 0x00000040; 1780 onChanged(); 1781 return this; 1782 } 1783 /** 1784 * 1785 * 1786 * <pre> 1787 * Image region to which this entity belongs. Not produced 1788 * for `LABEL_DETECTION` features. 1789 * </pre> 1790 * 1791 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1792 */ clearBoundingPoly()1793 public Builder clearBoundingPoly() { 1794 bitField0_ = (bitField0_ & ~0x00000040); 1795 boundingPoly_ = null; 1796 if (boundingPolyBuilder_ != null) { 1797 boundingPolyBuilder_.dispose(); 1798 boundingPolyBuilder_ = null; 1799 } 1800 onChanged(); 1801 return this; 1802 } 1803 /** 1804 * 1805 * 1806 * <pre> 1807 * Image region to which this entity belongs. Not produced 1808 * for `LABEL_DETECTION` features. 1809 * </pre> 1810 * 1811 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1812 */ getBoundingPolyBuilder()1813 public com.google.cloud.vision.v1.BoundingPoly.Builder getBoundingPolyBuilder() { 1814 bitField0_ |= 0x00000040; 1815 onChanged(); 1816 return getBoundingPolyFieldBuilder().getBuilder(); 1817 } 1818 /** 1819 * 1820 * 1821 * <pre> 1822 * Image region to which this entity belongs. Not produced 1823 * for `LABEL_DETECTION` features. 1824 * </pre> 1825 * 1826 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1827 */ getBoundingPolyOrBuilder()1828 public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 1829 if (boundingPolyBuilder_ != null) { 1830 return boundingPolyBuilder_.getMessageOrBuilder(); 1831 } else { 1832 return boundingPoly_ == null 1833 ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() 1834 : boundingPoly_; 1835 } 1836 } 1837 /** 1838 * 1839 * 1840 * <pre> 1841 * Image region to which this entity belongs. Not produced 1842 * for `LABEL_DETECTION` features. 1843 * </pre> 1844 * 1845 * <code>.google.cloud.vision.v1.BoundingPoly bounding_poly = 7;</code> 1846 */ 1847 private com.google.protobuf.SingleFieldBuilderV3< 1848 com.google.cloud.vision.v1.BoundingPoly, 1849 com.google.cloud.vision.v1.BoundingPoly.Builder, 1850 com.google.cloud.vision.v1.BoundingPolyOrBuilder> getBoundingPolyFieldBuilder()1851 getBoundingPolyFieldBuilder() { 1852 if (boundingPolyBuilder_ == null) { 1853 boundingPolyBuilder_ = 1854 new com.google.protobuf.SingleFieldBuilderV3< 1855 com.google.cloud.vision.v1.BoundingPoly, 1856 com.google.cloud.vision.v1.BoundingPoly.Builder, 1857 com.google.cloud.vision.v1.BoundingPolyOrBuilder>( 1858 getBoundingPoly(), getParentForChildren(), isClean()); 1859 boundingPoly_ = null; 1860 } 1861 return boundingPolyBuilder_; 1862 } 1863 1864 private java.util.List<com.google.cloud.vision.v1.LocationInfo> locations_ = 1865 java.util.Collections.emptyList(); 1866 ensureLocationsIsMutable()1867 private void ensureLocationsIsMutable() { 1868 if (!((bitField0_ & 0x00000080) != 0)) { 1869 locations_ = new java.util.ArrayList<com.google.cloud.vision.v1.LocationInfo>(locations_); 1870 bitField0_ |= 0x00000080; 1871 } 1872 } 1873 1874 private com.google.protobuf.RepeatedFieldBuilderV3< 1875 com.google.cloud.vision.v1.LocationInfo, 1876 com.google.cloud.vision.v1.LocationInfo.Builder, 1877 com.google.cloud.vision.v1.LocationInfoOrBuilder> 1878 locationsBuilder_; 1879 1880 /** 1881 * 1882 * 1883 * <pre> 1884 * The location information for the detected entity. Multiple 1885 * `LocationInfo` elements can be present because one location may 1886 * indicate the location of the scene in the image, and another location 1887 * may indicate the location of the place where the image was taken. 1888 * Location information is usually present for landmarks. 1889 * </pre> 1890 * 1891 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 1892 */ getLocationsList()1893 public java.util.List<com.google.cloud.vision.v1.LocationInfo> getLocationsList() { 1894 if (locationsBuilder_ == null) { 1895 return java.util.Collections.unmodifiableList(locations_); 1896 } else { 1897 return locationsBuilder_.getMessageList(); 1898 } 1899 } 1900 /** 1901 * 1902 * 1903 * <pre> 1904 * The location information for the detected entity. Multiple 1905 * `LocationInfo` elements can be present because one location may 1906 * indicate the location of the scene in the image, and another location 1907 * may indicate the location of the place where the image was taken. 1908 * Location information is usually present for landmarks. 1909 * </pre> 1910 * 1911 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 1912 */ getLocationsCount()1913 public int getLocationsCount() { 1914 if (locationsBuilder_ == null) { 1915 return locations_.size(); 1916 } else { 1917 return locationsBuilder_.getCount(); 1918 } 1919 } 1920 /** 1921 * 1922 * 1923 * <pre> 1924 * The location information for the detected entity. Multiple 1925 * `LocationInfo` elements can be present because one location may 1926 * indicate the location of the scene in the image, and another location 1927 * may indicate the location of the place where the image was taken. 1928 * Location information is usually present for landmarks. 1929 * </pre> 1930 * 1931 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 1932 */ getLocations(int index)1933 public com.google.cloud.vision.v1.LocationInfo getLocations(int index) { 1934 if (locationsBuilder_ == null) { 1935 return locations_.get(index); 1936 } else { 1937 return locationsBuilder_.getMessage(index); 1938 } 1939 } 1940 /** 1941 * 1942 * 1943 * <pre> 1944 * The location information for the detected entity. Multiple 1945 * `LocationInfo` elements can be present because one location may 1946 * indicate the location of the scene in the image, and another location 1947 * may indicate the location of the place where the image was taken. 1948 * Location information is usually present for landmarks. 1949 * </pre> 1950 * 1951 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 1952 */ setLocations(int index, com.google.cloud.vision.v1.LocationInfo value)1953 public Builder setLocations(int index, com.google.cloud.vision.v1.LocationInfo value) { 1954 if (locationsBuilder_ == null) { 1955 if (value == null) { 1956 throw new NullPointerException(); 1957 } 1958 ensureLocationsIsMutable(); 1959 locations_.set(index, value); 1960 onChanged(); 1961 } else { 1962 locationsBuilder_.setMessage(index, value); 1963 } 1964 return this; 1965 } 1966 /** 1967 * 1968 * 1969 * <pre> 1970 * The location information for the detected entity. Multiple 1971 * `LocationInfo` elements can be present because one location may 1972 * indicate the location of the scene in the image, and another location 1973 * may indicate the location of the place where the image was taken. 1974 * Location information is usually present for landmarks. 1975 * </pre> 1976 * 1977 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 1978 */ setLocations( int index, com.google.cloud.vision.v1.LocationInfo.Builder builderForValue)1979 public Builder setLocations( 1980 int index, com.google.cloud.vision.v1.LocationInfo.Builder builderForValue) { 1981 if (locationsBuilder_ == null) { 1982 ensureLocationsIsMutable(); 1983 locations_.set(index, builderForValue.build()); 1984 onChanged(); 1985 } else { 1986 locationsBuilder_.setMessage(index, builderForValue.build()); 1987 } 1988 return this; 1989 } 1990 /** 1991 * 1992 * 1993 * <pre> 1994 * The location information for the detected entity. Multiple 1995 * `LocationInfo` elements can be present because one location may 1996 * indicate the location of the scene in the image, and another location 1997 * may indicate the location of the place where the image was taken. 1998 * Location information is usually present for landmarks. 1999 * </pre> 2000 * 2001 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2002 */ addLocations(com.google.cloud.vision.v1.LocationInfo value)2003 public Builder addLocations(com.google.cloud.vision.v1.LocationInfo value) { 2004 if (locationsBuilder_ == null) { 2005 if (value == null) { 2006 throw new NullPointerException(); 2007 } 2008 ensureLocationsIsMutable(); 2009 locations_.add(value); 2010 onChanged(); 2011 } else { 2012 locationsBuilder_.addMessage(value); 2013 } 2014 return this; 2015 } 2016 /** 2017 * 2018 * 2019 * <pre> 2020 * The location information for the detected entity. Multiple 2021 * `LocationInfo` elements can be present because one location may 2022 * indicate the location of the scene in the image, and another location 2023 * may indicate the location of the place where the image was taken. 2024 * Location information is usually present for landmarks. 2025 * </pre> 2026 * 2027 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2028 */ addLocations(int index, com.google.cloud.vision.v1.LocationInfo value)2029 public Builder addLocations(int index, com.google.cloud.vision.v1.LocationInfo value) { 2030 if (locationsBuilder_ == null) { 2031 if (value == null) { 2032 throw new NullPointerException(); 2033 } 2034 ensureLocationsIsMutable(); 2035 locations_.add(index, value); 2036 onChanged(); 2037 } else { 2038 locationsBuilder_.addMessage(index, value); 2039 } 2040 return this; 2041 } 2042 /** 2043 * 2044 * 2045 * <pre> 2046 * The location information for the detected entity. Multiple 2047 * `LocationInfo` elements can be present because one location may 2048 * indicate the location of the scene in the image, and another location 2049 * may indicate the location of the place where the image was taken. 2050 * Location information is usually present for landmarks. 2051 * </pre> 2052 * 2053 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2054 */ addLocations(com.google.cloud.vision.v1.LocationInfo.Builder builderForValue)2055 public Builder addLocations(com.google.cloud.vision.v1.LocationInfo.Builder builderForValue) { 2056 if (locationsBuilder_ == null) { 2057 ensureLocationsIsMutable(); 2058 locations_.add(builderForValue.build()); 2059 onChanged(); 2060 } else { 2061 locationsBuilder_.addMessage(builderForValue.build()); 2062 } 2063 return this; 2064 } 2065 /** 2066 * 2067 * 2068 * <pre> 2069 * The location information for the detected entity. Multiple 2070 * `LocationInfo` elements can be present because one location may 2071 * indicate the location of the scene in the image, and another location 2072 * may indicate the location of the place where the image was taken. 2073 * Location information is usually present for landmarks. 2074 * </pre> 2075 * 2076 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2077 */ addLocations( int index, com.google.cloud.vision.v1.LocationInfo.Builder builderForValue)2078 public Builder addLocations( 2079 int index, com.google.cloud.vision.v1.LocationInfo.Builder builderForValue) { 2080 if (locationsBuilder_ == null) { 2081 ensureLocationsIsMutable(); 2082 locations_.add(index, builderForValue.build()); 2083 onChanged(); 2084 } else { 2085 locationsBuilder_.addMessage(index, builderForValue.build()); 2086 } 2087 return this; 2088 } 2089 /** 2090 * 2091 * 2092 * <pre> 2093 * The location information for the detected entity. Multiple 2094 * `LocationInfo` elements can be present because one location may 2095 * indicate the location of the scene in the image, and another location 2096 * may indicate the location of the place where the image was taken. 2097 * Location information is usually present for landmarks. 2098 * </pre> 2099 * 2100 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2101 */ addAllLocations( java.lang.Iterable<? extends com.google.cloud.vision.v1.LocationInfo> values)2102 public Builder addAllLocations( 2103 java.lang.Iterable<? extends com.google.cloud.vision.v1.LocationInfo> values) { 2104 if (locationsBuilder_ == null) { 2105 ensureLocationsIsMutable(); 2106 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, locations_); 2107 onChanged(); 2108 } else { 2109 locationsBuilder_.addAllMessages(values); 2110 } 2111 return this; 2112 } 2113 /** 2114 * 2115 * 2116 * <pre> 2117 * The location information for the detected entity. Multiple 2118 * `LocationInfo` elements can be present because one location may 2119 * indicate the location of the scene in the image, and another location 2120 * may indicate the location of the place where the image was taken. 2121 * Location information is usually present for landmarks. 2122 * </pre> 2123 * 2124 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2125 */ clearLocations()2126 public Builder clearLocations() { 2127 if (locationsBuilder_ == null) { 2128 locations_ = java.util.Collections.emptyList(); 2129 bitField0_ = (bitField0_ & ~0x00000080); 2130 onChanged(); 2131 } else { 2132 locationsBuilder_.clear(); 2133 } 2134 return this; 2135 } 2136 /** 2137 * 2138 * 2139 * <pre> 2140 * The location information for the detected entity. Multiple 2141 * `LocationInfo` elements can be present because one location may 2142 * indicate the location of the scene in the image, and another location 2143 * may indicate the location of the place where the image was taken. 2144 * Location information is usually present for landmarks. 2145 * </pre> 2146 * 2147 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2148 */ removeLocations(int index)2149 public Builder removeLocations(int index) { 2150 if (locationsBuilder_ == null) { 2151 ensureLocationsIsMutable(); 2152 locations_.remove(index); 2153 onChanged(); 2154 } else { 2155 locationsBuilder_.remove(index); 2156 } 2157 return this; 2158 } 2159 /** 2160 * 2161 * 2162 * <pre> 2163 * The location information for the detected entity. Multiple 2164 * `LocationInfo` elements can be present because one location may 2165 * indicate the location of the scene in the image, and another location 2166 * may indicate the location of the place where the image was taken. 2167 * Location information is usually present for landmarks. 2168 * </pre> 2169 * 2170 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2171 */ getLocationsBuilder(int index)2172 public com.google.cloud.vision.v1.LocationInfo.Builder getLocationsBuilder(int index) { 2173 return getLocationsFieldBuilder().getBuilder(index); 2174 } 2175 /** 2176 * 2177 * 2178 * <pre> 2179 * The location information for the detected entity. Multiple 2180 * `LocationInfo` elements can be present because one location may 2181 * indicate the location of the scene in the image, and another location 2182 * may indicate the location of the place where the image was taken. 2183 * Location information is usually present for landmarks. 2184 * </pre> 2185 * 2186 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2187 */ getLocationsOrBuilder(int index)2188 public com.google.cloud.vision.v1.LocationInfoOrBuilder getLocationsOrBuilder(int index) { 2189 if (locationsBuilder_ == null) { 2190 return locations_.get(index); 2191 } else { 2192 return locationsBuilder_.getMessageOrBuilder(index); 2193 } 2194 } 2195 /** 2196 * 2197 * 2198 * <pre> 2199 * The location information for the detected entity. Multiple 2200 * `LocationInfo` elements can be present because one location may 2201 * indicate the location of the scene in the image, and another location 2202 * may indicate the location of the place where the image was taken. 2203 * Location information is usually present for landmarks. 2204 * </pre> 2205 * 2206 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2207 */ 2208 public java.util.List<? extends com.google.cloud.vision.v1.LocationInfoOrBuilder> getLocationsOrBuilderList()2209 getLocationsOrBuilderList() { 2210 if (locationsBuilder_ != null) { 2211 return locationsBuilder_.getMessageOrBuilderList(); 2212 } else { 2213 return java.util.Collections.unmodifiableList(locations_); 2214 } 2215 } 2216 /** 2217 * 2218 * 2219 * <pre> 2220 * The location information for the detected entity. Multiple 2221 * `LocationInfo` elements can be present because one location may 2222 * indicate the location of the scene in the image, and another location 2223 * may indicate the location of the place where the image was taken. 2224 * Location information is usually present for landmarks. 2225 * </pre> 2226 * 2227 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2228 */ addLocationsBuilder()2229 public com.google.cloud.vision.v1.LocationInfo.Builder addLocationsBuilder() { 2230 return getLocationsFieldBuilder() 2231 .addBuilder(com.google.cloud.vision.v1.LocationInfo.getDefaultInstance()); 2232 } 2233 /** 2234 * 2235 * 2236 * <pre> 2237 * The location information for the detected entity. Multiple 2238 * `LocationInfo` elements can be present because one location may 2239 * indicate the location of the scene in the image, and another location 2240 * may indicate the location of the place where the image was taken. 2241 * Location information is usually present for landmarks. 2242 * </pre> 2243 * 2244 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2245 */ addLocationsBuilder(int index)2246 public com.google.cloud.vision.v1.LocationInfo.Builder addLocationsBuilder(int index) { 2247 return getLocationsFieldBuilder() 2248 .addBuilder(index, com.google.cloud.vision.v1.LocationInfo.getDefaultInstance()); 2249 } 2250 /** 2251 * 2252 * 2253 * <pre> 2254 * The location information for the detected entity. Multiple 2255 * `LocationInfo` elements can be present because one location may 2256 * indicate the location of the scene in the image, and another location 2257 * may indicate the location of the place where the image was taken. 2258 * Location information is usually present for landmarks. 2259 * </pre> 2260 * 2261 * <code>repeated .google.cloud.vision.v1.LocationInfo locations = 8;</code> 2262 */ 2263 public java.util.List<com.google.cloud.vision.v1.LocationInfo.Builder> getLocationsBuilderList()2264 getLocationsBuilderList() { 2265 return getLocationsFieldBuilder().getBuilderList(); 2266 } 2267 2268 private com.google.protobuf.RepeatedFieldBuilderV3< 2269 com.google.cloud.vision.v1.LocationInfo, 2270 com.google.cloud.vision.v1.LocationInfo.Builder, 2271 com.google.cloud.vision.v1.LocationInfoOrBuilder> getLocationsFieldBuilder()2272 getLocationsFieldBuilder() { 2273 if (locationsBuilder_ == null) { 2274 locationsBuilder_ = 2275 new com.google.protobuf.RepeatedFieldBuilderV3< 2276 com.google.cloud.vision.v1.LocationInfo, 2277 com.google.cloud.vision.v1.LocationInfo.Builder, 2278 com.google.cloud.vision.v1.LocationInfoOrBuilder>( 2279 locations_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); 2280 locations_ = null; 2281 } 2282 return locationsBuilder_; 2283 } 2284 2285 private java.util.List<com.google.cloud.vision.v1.Property> properties_ = 2286 java.util.Collections.emptyList(); 2287 ensurePropertiesIsMutable()2288 private void ensurePropertiesIsMutable() { 2289 if (!((bitField0_ & 0x00000100) != 0)) { 2290 properties_ = new java.util.ArrayList<com.google.cloud.vision.v1.Property>(properties_); 2291 bitField0_ |= 0x00000100; 2292 } 2293 } 2294 2295 private com.google.protobuf.RepeatedFieldBuilderV3< 2296 com.google.cloud.vision.v1.Property, 2297 com.google.cloud.vision.v1.Property.Builder, 2298 com.google.cloud.vision.v1.PropertyOrBuilder> 2299 propertiesBuilder_; 2300 2301 /** 2302 * 2303 * 2304 * <pre> 2305 * Some entities may have optional user-supplied `Property` (name/value) 2306 * fields, such a score or string that qualifies the entity. 2307 * </pre> 2308 * 2309 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2310 */ getPropertiesList()2311 public java.util.List<com.google.cloud.vision.v1.Property> getPropertiesList() { 2312 if (propertiesBuilder_ == null) { 2313 return java.util.Collections.unmodifiableList(properties_); 2314 } else { 2315 return propertiesBuilder_.getMessageList(); 2316 } 2317 } 2318 /** 2319 * 2320 * 2321 * <pre> 2322 * Some entities may have optional user-supplied `Property` (name/value) 2323 * fields, such a score or string that qualifies the entity. 2324 * </pre> 2325 * 2326 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2327 */ getPropertiesCount()2328 public int getPropertiesCount() { 2329 if (propertiesBuilder_ == null) { 2330 return properties_.size(); 2331 } else { 2332 return propertiesBuilder_.getCount(); 2333 } 2334 } 2335 /** 2336 * 2337 * 2338 * <pre> 2339 * Some entities may have optional user-supplied `Property` (name/value) 2340 * fields, such a score or string that qualifies the entity. 2341 * </pre> 2342 * 2343 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2344 */ getProperties(int index)2345 public com.google.cloud.vision.v1.Property getProperties(int index) { 2346 if (propertiesBuilder_ == null) { 2347 return properties_.get(index); 2348 } else { 2349 return propertiesBuilder_.getMessage(index); 2350 } 2351 } 2352 /** 2353 * 2354 * 2355 * <pre> 2356 * Some entities may have optional user-supplied `Property` (name/value) 2357 * fields, such a score or string that qualifies the entity. 2358 * </pre> 2359 * 2360 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2361 */ setProperties(int index, com.google.cloud.vision.v1.Property value)2362 public Builder setProperties(int index, com.google.cloud.vision.v1.Property value) { 2363 if (propertiesBuilder_ == null) { 2364 if (value == null) { 2365 throw new NullPointerException(); 2366 } 2367 ensurePropertiesIsMutable(); 2368 properties_.set(index, value); 2369 onChanged(); 2370 } else { 2371 propertiesBuilder_.setMessage(index, value); 2372 } 2373 return this; 2374 } 2375 /** 2376 * 2377 * 2378 * <pre> 2379 * Some entities may have optional user-supplied `Property` (name/value) 2380 * fields, such a score or string that qualifies the entity. 2381 * </pre> 2382 * 2383 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2384 */ setProperties( int index, com.google.cloud.vision.v1.Property.Builder builderForValue)2385 public Builder setProperties( 2386 int index, com.google.cloud.vision.v1.Property.Builder builderForValue) { 2387 if (propertiesBuilder_ == null) { 2388 ensurePropertiesIsMutable(); 2389 properties_.set(index, builderForValue.build()); 2390 onChanged(); 2391 } else { 2392 propertiesBuilder_.setMessage(index, builderForValue.build()); 2393 } 2394 return this; 2395 } 2396 /** 2397 * 2398 * 2399 * <pre> 2400 * Some entities may have optional user-supplied `Property` (name/value) 2401 * fields, such a score or string that qualifies the entity. 2402 * </pre> 2403 * 2404 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2405 */ addProperties(com.google.cloud.vision.v1.Property value)2406 public Builder addProperties(com.google.cloud.vision.v1.Property value) { 2407 if (propertiesBuilder_ == null) { 2408 if (value == null) { 2409 throw new NullPointerException(); 2410 } 2411 ensurePropertiesIsMutable(); 2412 properties_.add(value); 2413 onChanged(); 2414 } else { 2415 propertiesBuilder_.addMessage(value); 2416 } 2417 return this; 2418 } 2419 /** 2420 * 2421 * 2422 * <pre> 2423 * Some entities may have optional user-supplied `Property` (name/value) 2424 * fields, such a score or string that qualifies the entity. 2425 * </pre> 2426 * 2427 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2428 */ addProperties(int index, com.google.cloud.vision.v1.Property value)2429 public Builder addProperties(int index, com.google.cloud.vision.v1.Property value) { 2430 if (propertiesBuilder_ == null) { 2431 if (value == null) { 2432 throw new NullPointerException(); 2433 } 2434 ensurePropertiesIsMutable(); 2435 properties_.add(index, value); 2436 onChanged(); 2437 } else { 2438 propertiesBuilder_.addMessage(index, value); 2439 } 2440 return this; 2441 } 2442 /** 2443 * 2444 * 2445 * <pre> 2446 * Some entities may have optional user-supplied `Property` (name/value) 2447 * fields, such a score or string that qualifies the entity. 2448 * </pre> 2449 * 2450 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2451 */ addProperties(com.google.cloud.vision.v1.Property.Builder builderForValue)2452 public Builder addProperties(com.google.cloud.vision.v1.Property.Builder builderForValue) { 2453 if (propertiesBuilder_ == null) { 2454 ensurePropertiesIsMutable(); 2455 properties_.add(builderForValue.build()); 2456 onChanged(); 2457 } else { 2458 propertiesBuilder_.addMessage(builderForValue.build()); 2459 } 2460 return this; 2461 } 2462 /** 2463 * 2464 * 2465 * <pre> 2466 * Some entities may have optional user-supplied `Property` (name/value) 2467 * fields, such a score or string that qualifies the entity. 2468 * </pre> 2469 * 2470 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2471 */ addProperties( int index, com.google.cloud.vision.v1.Property.Builder builderForValue)2472 public Builder addProperties( 2473 int index, com.google.cloud.vision.v1.Property.Builder builderForValue) { 2474 if (propertiesBuilder_ == null) { 2475 ensurePropertiesIsMutable(); 2476 properties_.add(index, builderForValue.build()); 2477 onChanged(); 2478 } else { 2479 propertiesBuilder_.addMessage(index, builderForValue.build()); 2480 } 2481 return this; 2482 } 2483 /** 2484 * 2485 * 2486 * <pre> 2487 * Some entities may have optional user-supplied `Property` (name/value) 2488 * fields, such a score or string that qualifies the entity. 2489 * </pre> 2490 * 2491 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2492 */ addAllProperties( java.lang.Iterable<? extends com.google.cloud.vision.v1.Property> values)2493 public Builder addAllProperties( 2494 java.lang.Iterable<? extends com.google.cloud.vision.v1.Property> values) { 2495 if (propertiesBuilder_ == null) { 2496 ensurePropertiesIsMutable(); 2497 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); 2498 onChanged(); 2499 } else { 2500 propertiesBuilder_.addAllMessages(values); 2501 } 2502 return this; 2503 } 2504 /** 2505 * 2506 * 2507 * <pre> 2508 * Some entities may have optional user-supplied `Property` (name/value) 2509 * fields, such a score or string that qualifies the entity. 2510 * </pre> 2511 * 2512 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2513 */ clearProperties()2514 public Builder clearProperties() { 2515 if (propertiesBuilder_ == null) { 2516 properties_ = java.util.Collections.emptyList(); 2517 bitField0_ = (bitField0_ & ~0x00000100); 2518 onChanged(); 2519 } else { 2520 propertiesBuilder_.clear(); 2521 } 2522 return this; 2523 } 2524 /** 2525 * 2526 * 2527 * <pre> 2528 * Some entities may have optional user-supplied `Property` (name/value) 2529 * fields, such a score or string that qualifies the entity. 2530 * </pre> 2531 * 2532 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2533 */ removeProperties(int index)2534 public Builder removeProperties(int index) { 2535 if (propertiesBuilder_ == null) { 2536 ensurePropertiesIsMutable(); 2537 properties_.remove(index); 2538 onChanged(); 2539 } else { 2540 propertiesBuilder_.remove(index); 2541 } 2542 return this; 2543 } 2544 /** 2545 * 2546 * 2547 * <pre> 2548 * Some entities may have optional user-supplied `Property` (name/value) 2549 * fields, such a score or string that qualifies the entity. 2550 * </pre> 2551 * 2552 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2553 */ getPropertiesBuilder(int index)2554 public com.google.cloud.vision.v1.Property.Builder getPropertiesBuilder(int index) { 2555 return getPropertiesFieldBuilder().getBuilder(index); 2556 } 2557 /** 2558 * 2559 * 2560 * <pre> 2561 * Some entities may have optional user-supplied `Property` (name/value) 2562 * fields, such a score or string that qualifies the entity. 2563 * </pre> 2564 * 2565 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2566 */ getPropertiesOrBuilder(int index)2567 public com.google.cloud.vision.v1.PropertyOrBuilder getPropertiesOrBuilder(int index) { 2568 if (propertiesBuilder_ == null) { 2569 return properties_.get(index); 2570 } else { 2571 return propertiesBuilder_.getMessageOrBuilder(index); 2572 } 2573 } 2574 /** 2575 * 2576 * 2577 * <pre> 2578 * Some entities may have optional user-supplied `Property` (name/value) 2579 * fields, such a score or string that qualifies the entity. 2580 * </pre> 2581 * 2582 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2583 */ 2584 public java.util.List<? extends com.google.cloud.vision.v1.PropertyOrBuilder> getPropertiesOrBuilderList()2585 getPropertiesOrBuilderList() { 2586 if (propertiesBuilder_ != null) { 2587 return propertiesBuilder_.getMessageOrBuilderList(); 2588 } else { 2589 return java.util.Collections.unmodifiableList(properties_); 2590 } 2591 } 2592 /** 2593 * 2594 * 2595 * <pre> 2596 * Some entities may have optional user-supplied `Property` (name/value) 2597 * fields, such a score or string that qualifies the entity. 2598 * </pre> 2599 * 2600 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2601 */ addPropertiesBuilder()2602 public com.google.cloud.vision.v1.Property.Builder addPropertiesBuilder() { 2603 return getPropertiesFieldBuilder() 2604 .addBuilder(com.google.cloud.vision.v1.Property.getDefaultInstance()); 2605 } 2606 /** 2607 * 2608 * 2609 * <pre> 2610 * Some entities may have optional user-supplied `Property` (name/value) 2611 * fields, such a score or string that qualifies the entity. 2612 * </pre> 2613 * 2614 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2615 */ addPropertiesBuilder(int index)2616 public com.google.cloud.vision.v1.Property.Builder addPropertiesBuilder(int index) { 2617 return getPropertiesFieldBuilder() 2618 .addBuilder(index, com.google.cloud.vision.v1.Property.getDefaultInstance()); 2619 } 2620 /** 2621 * 2622 * 2623 * <pre> 2624 * Some entities may have optional user-supplied `Property` (name/value) 2625 * fields, such a score or string that qualifies the entity. 2626 * </pre> 2627 * 2628 * <code>repeated .google.cloud.vision.v1.Property properties = 9;</code> 2629 */ getPropertiesBuilderList()2630 public java.util.List<com.google.cloud.vision.v1.Property.Builder> getPropertiesBuilderList() { 2631 return getPropertiesFieldBuilder().getBuilderList(); 2632 } 2633 2634 private com.google.protobuf.RepeatedFieldBuilderV3< 2635 com.google.cloud.vision.v1.Property, 2636 com.google.cloud.vision.v1.Property.Builder, 2637 com.google.cloud.vision.v1.PropertyOrBuilder> getPropertiesFieldBuilder()2638 getPropertiesFieldBuilder() { 2639 if (propertiesBuilder_ == null) { 2640 propertiesBuilder_ = 2641 new com.google.protobuf.RepeatedFieldBuilderV3< 2642 com.google.cloud.vision.v1.Property, 2643 com.google.cloud.vision.v1.Property.Builder, 2644 com.google.cloud.vision.v1.PropertyOrBuilder>( 2645 properties_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); 2646 properties_ = null; 2647 } 2648 return propertiesBuilder_; 2649 } 2650 2651 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2652 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2653 return super.setUnknownFields(unknownFields); 2654 } 2655 2656 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2657 public final Builder mergeUnknownFields( 2658 final com.google.protobuf.UnknownFieldSet unknownFields) { 2659 return super.mergeUnknownFields(unknownFields); 2660 } 2661 2662 // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.EntityAnnotation) 2663 } 2664 2665 // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.EntityAnnotation) 2666 private static final com.google.cloud.vision.v1.EntityAnnotation DEFAULT_INSTANCE; 2667 2668 static { 2669 DEFAULT_INSTANCE = new com.google.cloud.vision.v1.EntityAnnotation(); 2670 } 2671 getDefaultInstance()2672 public static com.google.cloud.vision.v1.EntityAnnotation getDefaultInstance() { 2673 return DEFAULT_INSTANCE; 2674 } 2675 2676 private static final com.google.protobuf.Parser<EntityAnnotation> PARSER = 2677 new com.google.protobuf.AbstractParser<EntityAnnotation>() { 2678 @java.lang.Override 2679 public EntityAnnotation parsePartialFrom( 2680 com.google.protobuf.CodedInputStream input, 2681 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2682 throws com.google.protobuf.InvalidProtocolBufferException { 2683 Builder builder = newBuilder(); 2684 try { 2685 builder.mergeFrom(input, extensionRegistry); 2686 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2687 throw e.setUnfinishedMessage(builder.buildPartial()); 2688 } catch (com.google.protobuf.UninitializedMessageException e) { 2689 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2690 } catch (java.io.IOException e) { 2691 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2692 .setUnfinishedMessage(builder.buildPartial()); 2693 } 2694 return builder.buildPartial(); 2695 } 2696 }; 2697 parser()2698 public static com.google.protobuf.Parser<EntityAnnotation> parser() { 2699 return PARSER; 2700 } 2701 2702 @java.lang.Override getParserForType()2703 public com.google.protobuf.Parser<EntityAnnotation> getParserForType() { 2704 return PARSER; 2705 } 2706 2707 @java.lang.Override getDefaultInstanceForType()2708 public com.google.cloud.vision.v1.EntityAnnotation getDefaultInstanceForType() { 2709 return DEFAULT_INSTANCE; 2710 } 2711 } 2712