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