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