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/v1p4beta1/product_search_service.proto 18 19 package com.google.cloud.vision.v1p4beta1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A Product contains ReferenceImages. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.vision.v1p4beta1.Product} 29 */ 30 public final class Product extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchServiceProto 61 .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; 62 } 63 64 @java.lang.Override 65 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()66 internalGetFieldAccessorTable() { 67 return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto 68 .internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable 69 .ensureFieldAccessorsInitialized( 70 com.google.cloud.vision.v1p4beta1.Product.class, 71 com.google.cloud.vision.v1p4beta1.Product.Builder.class); 72 } 73 74 public interface KeyValueOrBuilder 75 extends 76 // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.ProductSearchServiceProto 170 .internal_static_google_cloud_vision_v1p4beta1_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.v1p4beta1.ProductSearchServiceProto 177 .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable 178 .ensureFieldAccessorsInitialized( 179 com.google.cloud.vision.v1p4beta1.Product.KeyValue.class, 180 com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue)) { 335 return super.equals(obj); 336 } 337 com.google.cloud.vision.v1p4beta1.Product.KeyValue other = 338 (com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue prototype)443 public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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.v1p4beta1.Product.KeyValue) 471 com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder { getDescriptor()472 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 473 return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto 474 .internal_static_google_cloud_vision_v1p4beta1_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.v1p4beta1.ProductSearchServiceProto 481 .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_fieldAccessorTable 482 .ensureFieldAccessorsInitialized( 483 com.google.cloud.vision.v1p4beta1.Product.KeyValue.class, 484 com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder.class); 485 } 486 487 // Construct using com.google.cloud.vision.v1p4beta1.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.v1p4beta1.ProductSearchServiceProto 506 .internal_static_google_cloud_vision_v1p4beta1_Product_KeyValue_descriptor; 507 } 508 509 @java.lang.Override getDefaultInstanceForType()510 public com.google.cloud.vision.v1p4beta1.Product.KeyValue getDefaultInstanceForType() { 511 return com.google.cloud.vision.v1p4beta1.Product.KeyValue.getDefaultInstance(); 512 } 513 514 @java.lang.Override build()515 public com.google.cloud.vision.v1p4beta1.Product.KeyValue build() { 516 com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue buildPartial() { 525 com.google.cloud.vision.v1p4beta1.Product.KeyValue result = 526 new com.google.cloud.vision.v1p4beta1.Product.KeyValue(this); 527 if (bitField0_ != 0) { 528 buildPartial0(result); 529 } 530 onBuilt(); 531 return result; 532 } 533 buildPartial0(com.google.cloud.vision.v1p4beta1.Product.KeyValue result)534 private void buildPartial0(com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue) { 582 return mergeFrom((com.google.cloud.vision.v1p4beta1.Product.KeyValue) other); 583 } else { 584 super.mergeFrom(other); 585 return this; 586 } 587 } 588 mergeFrom(com.google.cloud.vision.v1p4beta1.Product.KeyValue other)589 public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Product.KeyValue other) { 590 if (other == com.google.cloud.vision.v1p4beta1.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.v1p4beta1.Product.KeyValue) 894 } 895 896 // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product.KeyValue) 897 private static final com.google.cloud.vision.v1p4beta1.Product.KeyValue DEFAULT_INSTANCE; 898 899 static { 900 DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Product.KeyValue(); 901 } 902 getDefaultInstance()903 public static com.google.cloud.vision.v1p4beta1.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.v1p4beta1.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. 1117 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 1118 * legacy categories "homegoods", "apparel", and "toys" are still supported, 1119 * but these should 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. 1143 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 1144 * legacy categories "homegoods", "apparel", and "toys" are still supported, 1145 * but these should 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.v1p4beta1.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 * 500 product_labels. 1180 * Notice that the total number of distinct product_labels over all products 1181 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 1182 * will refuse to work for that ProductSet. 1183 * </pre> 1184 * 1185 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 1186 */ 1187 @java.lang.Override getProductLabelsList()1188 public java.util.List<com.google.cloud.vision.v1p4beta1.Product.KeyValue> getProductLabelsList() { 1189 return productLabels_; 1190 } 1191 /** 1192 * 1193 * 1194 * <pre> 1195 * Key-value pairs that can be attached to a product. At query time, 1196 * constraints can be specified based on the product_labels. 1197 * Note that integer values can be provided as strings, e.g. "1199". Only 1198 * strings with integer values can match a range-based restriction which is 1199 * to be supported soon. 1200 * Multiple values can be assigned to the same key. One product may have up to 1201 * 500 product_labels. 1202 * Notice that the total number of distinct product_labels over all products 1203 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 1204 * will refuse to work for that ProductSet. 1205 * </pre> 1206 * 1207 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 1208 */ 1209 @java.lang.Override 1210 public java.util.List<? extends com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder> getProductLabelsOrBuilderList()1211 getProductLabelsOrBuilderList() { 1212 return productLabels_; 1213 } 1214 /** 1215 * 1216 * 1217 * <pre> 1218 * Key-value pairs that can be attached to a product. At query time, 1219 * constraints can be specified based on the product_labels. 1220 * Note that integer values can be provided as strings, e.g. "1199". Only 1221 * strings with integer values can match a range-based restriction which is 1222 * to be supported soon. 1223 * Multiple values can be assigned to the same key. One product may have up to 1224 * 500 product_labels. 1225 * Notice that the total number of distinct product_labels over all products 1226 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 1227 * will refuse to work for that ProductSet. 1228 * </pre> 1229 * 1230 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 1231 */ 1232 @java.lang.Override getProductLabelsCount()1233 public int getProductLabelsCount() { 1234 return productLabels_.size(); 1235 } 1236 /** 1237 * 1238 * 1239 * <pre> 1240 * Key-value pairs that can be attached to a product. At query time, 1241 * constraints can be specified based on the product_labels. 1242 * Note that integer values can be provided as strings, e.g. "1199". Only 1243 * strings with integer values can match a range-based restriction which is 1244 * to be supported soon. 1245 * Multiple values can be assigned to the same key. One product may have up to 1246 * 500 product_labels. 1247 * Notice that the total number of distinct product_labels over all products 1248 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 1249 * will refuse to work for that ProductSet. 1250 * </pre> 1251 * 1252 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 1253 */ 1254 @java.lang.Override getProductLabels(int index)1255 public com.google.cloud.vision.v1p4beta1.Product.KeyValue getProductLabels(int index) { 1256 return productLabels_.get(index); 1257 } 1258 /** 1259 * 1260 * 1261 * <pre> 1262 * Key-value pairs that can be attached to a product. At query time, 1263 * constraints can be specified based on the product_labels. 1264 * Note that integer values can be provided as strings, e.g. "1199". Only 1265 * strings with integer values can match a range-based restriction which is 1266 * to be supported soon. 1267 * Multiple values can be assigned to the same key. One product may have up to 1268 * 500 product_labels. 1269 * Notice that the total number of distinct product_labels over all products 1270 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 1271 * will refuse to work for that ProductSet. 1272 * </pre> 1273 * 1274 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 1275 */ 1276 @java.lang.Override getProductLabelsOrBuilder( int index)1277 public com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( 1278 int index) { 1279 return productLabels_.get(index); 1280 } 1281 1282 private byte memoizedIsInitialized = -1; 1283 1284 @java.lang.Override isInitialized()1285 public final boolean isInitialized() { 1286 byte isInitialized = memoizedIsInitialized; 1287 if (isInitialized == 1) return true; 1288 if (isInitialized == 0) return false; 1289 1290 memoizedIsInitialized = 1; 1291 return true; 1292 } 1293 1294 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1295 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1296 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1297 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 1298 } 1299 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 1300 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); 1301 } 1302 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 1303 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); 1304 } 1305 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productCategory_)) { 1306 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, productCategory_); 1307 } 1308 for (int i = 0; i < productLabels_.size(); i++) { 1309 output.writeMessage(5, productLabels_.get(i)); 1310 } 1311 getUnknownFields().writeTo(output); 1312 } 1313 1314 @java.lang.Override getSerializedSize()1315 public int getSerializedSize() { 1316 int size = memoizedSize; 1317 if (size != -1) return size; 1318 1319 size = 0; 1320 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1321 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 1322 } 1323 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 1324 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); 1325 } 1326 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 1327 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); 1328 } 1329 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(productCategory_)) { 1330 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, productCategory_); 1331 } 1332 for (int i = 0; i < productLabels_.size(); i++) { 1333 size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, productLabels_.get(i)); 1334 } 1335 size += getUnknownFields().getSerializedSize(); 1336 memoizedSize = size; 1337 return size; 1338 } 1339 1340 @java.lang.Override equals(final java.lang.Object obj)1341 public boolean equals(final java.lang.Object obj) { 1342 if (obj == this) { 1343 return true; 1344 } 1345 if (!(obj instanceof com.google.cloud.vision.v1p4beta1.Product)) { 1346 return super.equals(obj); 1347 } 1348 com.google.cloud.vision.v1p4beta1.Product other = 1349 (com.google.cloud.vision.v1p4beta1.Product) obj; 1350 1351 if (!getName().equals(other.getName())) return false; 1352 if (!getDisplayName().equals(other.getDisplayName())) return false; 1353 if (!getDescription().equals(other.getDescription())) return false; 1354 if (!getProductCategory().equals(other.getProductCategory())) return false; 1355 if (!getProductLabelsList().equals(other.getProductLabelsList())) return false; 1356 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1357 return true; 1358 } 1359 1360 @java.lang.Override hashCode()1361 public int hashCode() { 1362 if (memoizedHashCode != 0) { 1363 return memoizedHashCode; 1364 } 1365 int hash = 41; 1366 hash = (19 * hash) + getDescriptor().hashCode(); 1367 hash = (37 * hash) + NAME_FIELD_NUMBER; 1368 hash = (53 * hash) + getName().hashCode(); 1369 hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; 1370 hash = (53 * hash) + getDisplayName().hashCode(); 1371 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 1372 hash = (53 * hash) + getDescription().hashCode(); 1373 hash = (37 * hash) + PRODUCT_CATEGORY_FIELD_NUMBER; 1374 hash = (53 * hash) + getProductCategory().hashCode(); 1375 if (getProductLabelsCount() > 0) { 1376 hash = (37 * hash) + PRODUCT_LABELS_FIELD_NUMBER; 1377 hash = (53 * hash) + getProductLabelsList().hashCode(); 1378 } 1379 hash = (29 * hash) + getUnknownFields().hashCode(); 1380 memoizedHashCode = hash; 1381 return hash; 1382 } 1383 parseFrom(java.nio.ByteBuffer data)1384 public static com.google.cloud.vision.v1p4beta1.Product parseFrom(java.nio.ByteBuffer data) 1385 throws com.google.protobuf.InvalidProtocolBufferException { 1386 return PARSER.parseFrom(data); 1387 } 1388 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1389 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1390 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1391 throws com.google.protobuf.InvalidProtocolBufferException { 1392 return PARSER.parseFrom(data, extensionRegistry); 1393 } 1394 parseFrom( com.google.protobuf.ByteString data)1395 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1396 com.google.protobuf.ByteString data) 1397 throws com.google.protobuf.InvalidProtocolBufferException { 1398 return PARSER.parseFrom(data); 1399 } 1400 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1401 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1402 com.google.protobuf.ByteString data, 1403 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1404 throws com.google.protobuf.InvalidProtocolBufferException { 1405 return PARSER.parseFrom(data, extensionRegistry); 1406 } 1407 parseFrom(byte[] data)1408 public static com.google.cloud.vision.v1p4beta1.Product parseFrom(byte[] data) 1409 throws com.google.protobuf.InvalidProtocolBufferException { 1410 return PARSER.parseFrom(data); 1411 } 1412 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1413 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1414 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1415 throws com.google.protobuf.InvalidProtocolBufferException { 1416 return PARSER.parseFrom(data, extensionRegistry); 1417 } 1418 parseFrom(java.io.InputStream input)1419 public static com.google.cloud.vision.v1p4beta1.Product parseFrom(java.io.InputStream input) 1420 throws java.io.IOException { 1421 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1422 } 1423 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1424 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1425 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1426 throws java.io.IOException { 1427 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1428 PARSER, input, extensionRegistry); 1429 } 1430 parseDelimitedFrom( java.io.InputStream input)1431 public static com.google.cloud.vision.v1p4beta1.Product parseDelimitedFrom( 1432 java.io.InputStream input) throws java.io.IOException { 1433 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1434 } 1435 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1436 public static com.google.cloud.vision.v1p4beta1.Product parseDelimitedFrom( 1437 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1438 throws java.io.IOException { 1439 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1440 PARSER, input, extensionRegistry); 1441 } 1442 parseFrom( com.google.protobuf.CodedInputStream input)1443 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1444 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1445 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1446 } 1447 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1448 public static com.google.cloud.vision.v1p4beta1.Product parseFrom( 1449 com.google.protobuf.CodedInputStream input, 1450 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1451 throws java.io.IOException { 1452 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1453 PARSER, input, extensionRegistry); 1454 } 1455 1456 @java.lang.Override newBuilderForType()1457 public Builder newBuilderForType() { 1458 return newBuilder(); 1459 } 1460 newBuilder()1461 public static Builder newBuilder() { 1462 return DEFAULT_INSTANCE.toBuilder(); 1463 } 1464 newBuilder(com.google.cloud.vision.v1p4beta1.Product prototype)1465 public static Builder newBuilder(com.google.cloud.vision.v1p4beta1.Product prototype) { 1466 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1467 } 1468 1469 @java.lang.Override toBuilder()1470 public Builder toBuilder() { 1471 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1472 } 1473 1474 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1475 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1476 Builder builder = new Builder(parent); 1477 return builder; 1478 } 1479 /** 1480 * 1481 * 1482 * <pre> 1483 * A Product contains ReferenceImages. 1484 * </pre> 1485 * 1486 * Protobuf type {@code google.cloud.vision.v1p4beta1.Product} 1487 */ 1488 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1489 implements 1490 // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p4beta1.Product) 1491 com.google.cloud.vision.v1p4beta1.ProductOrBuilder { getDescriptor()1492 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1493 return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto 1494 .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; 1495 } 1496 1497 @java.lang.Override 1498 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1499 internalGetFieldAccessorTable() { 1500 return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto 1501 .internal_static_google_cloud_vision_v1p4beta1_Product_fieldAccessorTable 1502 .ensureFieldAccessorsInitialized( 1503 com.google.cloud.vision.v1p4beta1.Product.class, 1504 com.google.cloud.vision.v1p4beta1.Product.Builder.class); 1505 } 1506 1507 // Construct using com.google.cloud.vision.v1p4beta1.Product.newBuilder() Builder()1508 private Builder() {} 1509 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1510 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1511 super(parent); 1512 } 1513 1514 @java.lang.Override clear()1515 public Builder clear() { 1516 super.clear(); 1517 bitField0_ = 0; 1518 name_ = ""; 1519 displayName_ = ""; 1520 description_ = ""; 1521 productCategory_ = ""; 1522 if (productLabelsBuilder_ == null) { 1523 productLabels_ = java.util.Collections.emptyList(); 1524 } else { 1525 productLabels_ = null; 1526 productLabelsBuilder_.clear(); 1527 } 1528 bitField0_ = (bitField0_ & ~0x00000010); 1529 return this; 1530 } 1531 1532 @java.lang.Override getDescriptorForType()1533 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1534 return com.google.cloud.vision.v1p4beta1.ProductSearchServiceProto 1535 .internal_static_google_cloud_vision_v1p4beta1_Product_descriptor; 1536 } 1537 1538 @java.lang.Override getDefaultInstanceForType()1539 public com.google.cloud.vision.v1p4beta1.Product getDefaultInstanceForType() { 1540 return com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance(); 1541 } 1542 1543 @java.lang.Override build()1544 public com.google.cloud.vision.v1p4beta1.Product build() { 1545 com.google.cloud.vision.v1p4beta1.Product result = buildPartial(); 1546 if (!result.isInitialized()) { 1547 throw newUninitializedMessageException(result); 1548 } 1549 return result; 1550 } 1551 1552 @java.lang.Override buildPartial()1553 public com.google.cloud.vision.v1p4beta1.Product buildPartial() { 1554 com.google.cloud.vision.v1p4beta1.Product result = 1555 new com.google.cloud.vision.v1p4beta1.Product(this); 1556 buildPartialRepeatedFields(result); 1557 if (bitField0_ != 0) { 1558 buildPartial0(result); 1559 } 1560 onBuilt(); 1561 return result; 1562 } 1563 buildPartialRepeatedFields(com.google.cloud.vision.v1p4beta1.Product result)1564 private void buildPartialRepeatedFields(com.google.cloud.vision.v1p4beta1.Product result) { 1565 if (productLabelsBuilder_ == null) { 1566 if (((bitField0_ & 0x00000010) != 0)) { 1567 productLabels_ = java.util.Collections.unmodifiableList(productLabels_); 1568 bitField0_ = (bitField0_ & ~0x00000010); 1569 } 1570 result.productLabels_ = productLabels_; 1571 } else { 1572 result.productLabels_ = productLabelsBuilder_.build(); 1573 } 1574 } 1575 buildPartial0(com.google.cloud.vision.v1p4beta1.Product result)1576 private void buildPartial0(com.google.cloud.vision.v1p4beta1.Product result) { 1577 int from_bitField0_ = bitField0_; 1578 if (((from_bitField0_ & 0x00000001) != 0)) { 1579 result.name_ = name_; 1580 } 1581 if (((from_bitField0_ & 0x00000002) != 0)) { 1582 result.displayName_ = displayName_; 1583 } 1584 if (((from_bitField0_ & 0x00000004) != 0)) { 1585 result.description_ = description_; 1586 } 1587 if (((from_bitField0_ & 0x00000008) != 0)) { 1588 result.productCategory_ = productCategory_; 1589 } 1590 } 1591 1592 @java.lang.Override clone()1593 public Builder clone() { 1594 return super.clone(); 1595 } 1596 1597 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1598 public Builder setField( 1599 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1600 return super.setField(field, value); 1601 } 1602 1603 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1604 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1605 return super.clearField(field); 1606 } 1607 1608 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1609 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1610 return super.clearOneof(oneof); 1611 } 1612 1613 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1614 public Builder setRepeatedField( 1615 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1616 return super.setRepeatedField(field, index, value); 1617 } 1618 1619 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1620 public Builder addRepeatedField( 1621 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1622 return super.addRepeatedField(field, value); 1623 } 1624 1625 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1626 public Builder mergeFrom(com.google.protobuf.Message other) { 1627 if (other instanceof com.google.cloud.vision.v1p4beta1.Product) { 1628 return mergeFrom((com.google.cloud.vision.v1p4beta1.Product) other); 1629 } else { 1630 super.mergeFrom(other); 1631 return this; 1632 } 1633 } 1634 mergeFrom(com.google.cloud.vision.v1p4beta1.Product other)1635 public Builder mergeFrom(com.google.cloud.vision.v1p4beta1.Product other) { 1636 if (other == com.google.cloud.vision.v1p4beta1.Product.getDefaultInstance()) return this; 1637 if (!other.getName().isEmpty()) { 1638 name_ = other.name_; 1639 bitField0_ |= 0x00000001; 1640 onChanged(); 1641 } 1642 if (!other.getDisplayName().isEmpty()) { 1643 displayName_ = other.displayName_; 1644 bitField0_ |= 0x00000002; 1645 onChanged(); 1646 } 1647 if (!other.getDescription().isEmpty()) { 1648 description_ = other.description_; 1649 bitField0_ |= 0x00000004; 1650 onChanged(); 1651 } 1652 if (!other.getProductCategory().isEmpty()) { 1653 productCategory_ = other.productCategory_; 1654 bitField0_ |= 0x00000008; 1655 onChanged(); 1656 } 1657 if (productLabelsBuilder_ == null) { 1658 if (!other.productLabels_.isEmpty()) { 1659 if (productLabels_.isEmpty()) { 1660 productLabels_ = other.productLabels_; 1661 bitField0_ = (bitField0_ & ~0x00000010); 1662 } else { 1663 ensureProductLabelsIsMutable(); 1664 productLabels_.addAll(other.productLabels_); 1665 } 1666 onChanged(); 1667 } 1668 } else { 1669 if (!other.productLabels_.isEmpty()) { 1670 if (productLabelsBuilder_.isEmpty()) { 1671 productLabelsBuilder_.dispose(); 1672 productLabelsBuilder_ = null; 1673 productLabels_ = other.productLabels_; 1674 bitField0_ = (bitField0_ & ~0x00000010); 1675 productLabelsBuilder_ = 1676 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1677 ? getProductLabelsFieldBuilder() 1678 : null; 1679 } else { 1680 productLabelsBuilder_.addAllMessages(other.productLabels_); 1681 } 1682 } 1683 } 1684 this.mergeUnknownFields(other.getUnknownFields()); 1685 onChanged(); 1686 return this; 1687 } 1688 1689 @java.lang.Override isInitialized()1690 public final boolean isInitialized() { 1691 return true; 1692 } 1693 1694 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1695 public Builder mergeFrom( 1696 com.google.protobuf.CodedInputStream input, 1697 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1698 throws java.io.IOException { 1699 if (extensionRegistry == null) { 1700 throw new java.lang.NullPointerException(); 1701 } 1702 try { 1703 boolean done = false; 1704 while (!done) { 1705 int tag = input.readTag(); 1706 switch (tag) { 1707 case 0: 1708 done = true; 1709 break; 1710 case 10: 1711 { 1712 name_ = input.readStringRequireUtf8(); 1713 bitField0_ |= 0x00000001; 1714 break; 1715 } // case 10 1716 case 18: 1717 { 1718 displayName_ = input.readStringRequireUtf8(); 1719 bitField0_ |= 0x00000002; 1720 break; 1721 } // case 18 1722 case 26: 1723 { 1724 description_ = input.readStringRequireUtf8(); 1725 bitField0_ |= 0x00000004; 1726 break; 1727 } // case 26 1728 case 34: 1729 { 1730 productCategory_ = input.readStringRequireUtf8(); 1731 bitField0_ |= 0x00000008; 1732 break; 1733 } // case 34 1734 case 42: 1735 { 1736 com.google.cloud.vision.v1p4beta1.Product.KeyValue m = 1737 input.readMessage( 1738 com.google.cloud.vision.v1p4beta1.Product.KeyValue.parser(), 1739 extensionRegistry); 1740 if (productLabelsBuilder_ == null) { 1741 ensureProductLabelsIsMutable(); 1742 productLabels_.add(m); 1743 } else { 1744 productLabelsBuilder_.addMessage(m); 1745 } 1746 break; 1747 } // case 42 1748 default: 1749 { 1750 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1751 done = true; // was an endgroup tag 1752 } 1753 break; 1754 } // default: 1755 } // switch (tag) 1756 } // while (!done) 1757 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1758 throw e.unwrapIOException(); 1759 } finally { 1760 onChanged(); 1761 } // finally 1762 return this; 1763 } 1764 1765 private int bitField0_; 1766 1767 private java.lang.Object name_ = ""; 1768 /** 1769 * 1770 * 1771 * <pre> 1772 * The resource name of the product. 1773 * Format is: 1774 * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 1775 * This field is ignored when creating a product. 1776 * </pre> 1777 * 1778 * <code>string name = 1;</code> 1779 * 1780 * @return The name. 1781 */ getName()1782 public java.lang.String getName() { 1783 java.lang.Object ref = name_; 1784 if (!(ref instanceof java.lang.String)) { 1785 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1786 java.lang.String s = bs.toStringUtf8(); 1787 name_ = s; 1788 return s; 1789 } else { 1790 return (java.lang.String) ref; 1791 } 1792 } 1793 /** 1794 * 1795 * 1796 * <pre> 1797 * The resource name of the product. 1798 * Format is: 1799 * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 1800 * This field is ignored when creating a product. 1801 * </pre> 1802 * 1803 * <code>string name = 1;</code> 1804 * 1805 * @return The bytes for name. 1806 */ getNameBytes()1807 public com.google.protobuf.ByteString getNameBytes() { 1808 java.lang.Object ref = name_; 1809 if (ref instanceof String) { 1810 com.google.protobuf.ByteString b = 1811 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1812 name_ = b; 1813 return b; 1814 } else { 1815 return (com.google.protobuf.ByteString) ref; 1816 } 1817 } 1818 /** 1819 * 1820 * 1821 * <pre> 1822 * The resource name of the product. 1823 * Format is: 1824 * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 1825 * This field is ignored when creating a product. 1826 * </pre> 1827 * 1828 * <code>string name = 1;</code> 1829 * 1830 * @param value The name to set. 1831 * @return This builder for chaining. 1832 */ setName(java.lang.String value)1833 public Builder setName(java.lang.String value) { 1834 if (value == null) { 1835 throw new NullPointerException(); 1836 } 1837 name_ = value; 1838 bitField0_ |= 0x00000001; 1839 onChanged(); 1840 return this; 1841 } 1842 /** 1843 * 1844 * 1845 * <pre> 1846 * The resource name of the product. 1847 * Format is: 1848 * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 1849 * This field is ignored when creating a product. 1850 * </pre> 1851 * 1852 * <code>string name = 1;</code> 1853 * 1854 * @return This builder for chaining. 1855 */ clearName()1856 public Builder clearName() { 1857 name_ = getDefaultInstance().getName(); 1858 bitField0_ = (bitField0_ & ~0x00000001); 1859 onChanged(); 1860 return this; 1861 } 1862 /** 1863 * 1864 * 1865 * <pre> 1866 * The resource name of the product. 1867 * Format is: 1868 * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. 1869 * This field is ignored when creating a product. 1870 * </pre> 1871 * 1872 * <code>string name = 1;</code> 1873 * 1874 * @param value The bytes for name to set. 1875 * @return This builder for chaining. 1876 */ setNameBytes(com.google.protobuf.ByteString value)1877 public Builder setNameBytes(com.google.protobuf.ByteString value) { 1878 if (value == null) { 1879 throw new NullPointerException(); 1880 } 1881 checkByteStringIsUtf8(value); 1882 name_ = value; 1883 bitField0_ |= 0x00000001; 1884 onChanged(); 1885 return this; 1886 } 1887 1888 private java.lang.Object displayName_ = ""; 1889 /** 1890 * 1891 * 1892 * <pre> 1893 * The user-provided name for this Product. Must not be empty. Must be at most 1894 * 4096 characters long. 1895 * </pre> 1896 * 1897 * <code>string display_name = 2;</code> 1898 * 1899 * @return The displayName. 1900 */ getDisplayName()1901 public java.lang.String getDisplayName() { 1902 java.lang.Object ref = displayName_; 1903 if (!(ref instanceof java.lang.String)) { 1904 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1905 java.lang.String s = bs.toStringUtf8(); 1906 displayName_ = s; 1907 return s; 1908 } else { 1909 return (java.lang.String) ref; 1910 } 1911 } 1912 /** 1913 * 1914 * 1915 * <pre> 1916 * The user-provided name for this Product. Must not be empty. Must be at most 1917 * 4096 characters long. 1918 * </pre> 1919 * 1920 * <code>string display_name = 2;</code> 1921 * 1922 * @return The bytes for displayName. 1923 */ getDisplayNameBytes()1924 public com.google.protobuf.ByteString getDisplayNameBytes() { 1925 java.lang.Object ref = displayName_; 1926 if (ref instanceof String) { 1927 com.google.protobuf.ByteString b = 1928 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1929 displayName_ = b; 1930 return b; 1931 } else { 1932 return (com.google.protobuf.ByteString) ref; 1933 } 1934 } 1935 /** 1936 * 1937 * 1938 * <pre> 1939 * The user-provided name for this Product. Must not be empty. Must be at most 1940 * 4096 characters long. 1941 * </pre> 1942 * 1943 * <code>string display_name = 2;</code> 1944 * 1945 * @param value The displayName to set. 1946 * @return This builder for chaining. 1947 */ setDisplayName(java.lang.String value)1948 public Builder setDisplayName(java.lang.String value) { 1949 if (value == null) { 1950 throw new NullPointerException(); 1951 } 1952 displayName_ = value; 1953 bitField0_ |= 0x00000002; 1954 onChanged(); 1955 return this; 1956 } 1957 /** 1958 * 1959 * 1960 * <pre> 1961 * The user-provided name for this Product. Must not be empty. Must be at most 1962 * 4096 characters long. 1963 * </pre> 1964 * 1965 * <code>string display_name = 2;</code> 1966 * 1967 * @return This builder for chaining. 1968 */ clearDisplayName()1969 public Builder clearDisplayName() { 1970 displayName_ = getDefaultInstance().getDisplayName(); 1971 bitField0_ = (bitField0_ & ~0x00000002); 1972 onChanged(); 1973 return this; 1974 } 1975 /** 1976 * 1977 * 1978 * <pre> 1979 * The user-provided name for this Product. Must not be empty. Must be at most 1980 * 4096 characters long. 1981 * </pre> 1982 * 1983 * <code>string display_name = 2;</code> 1984 * 1985 * @param value The bytes for displayName to set. 1986 * @return This builder for chaining. 1987 */ setDisplayNameBytes(com.google.protobuf.ByteString value)1988 public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { 1989 if (value == null) { 1990 throw new NullPointerException(); 1991 } 1992 checkByteStringIsUtf8(value); 1993 displayName_ = value; 1994 bitField0_ |= 0x00000002; 1995 onChanged(); 1996 return this; 1997 } 1998 1999 private java.lang.Object description_ = ""; 2000 /** 2001 * 2002 * 2003 * <pre> 2004 * User-provided metadata to be stored with this product. Must be at most 4096 2005 * characters long. 2006 * </pre> 2007 * 2008 * <code>string description = 3;</code> 2009 * 2010 * @return The description. 2011 */ getDescription()2012 public java.lang.String getDescription() { 2013 java.lang.Object ref = description_; 2014 if (!(ref instanceof java.lang.String)) { 2015 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2016 java.lang.String s = bs.toStringUtf8(); 2017 description_ = s; 2018 return s; 2019 } else { 2020 return (java.lang.String) ref; 2021 } 2022 } 2023 /** 2024 * 2025 * 2026 * <pre> 2027 * User-provided metadata to be stored with this product. Must be at most 4096 2028 * characters long. 2029 * </pre> 2030 * 2031 * <code>string description = 3;</code> 2032 * 2033 * @return The bytes for description. 2034 */ getDescriptionBytes()2035 public com.google.protobuf.ByteString getDescriptionBytes() { 2036 java.lang.Object ref = description_; 2037 if (ref instanceof String) { 2038 com.google.protobuf.ByteString b = 2039 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2040 description_ = b; 2041 return b; 2042 } else { 2043 return (com.google.protobuf.ByteString) ref; 2044 } 2045 } 2046 /** 2047 * 2048 * 2049 * <pre> 2050 * User-provided metadata to be stored with this product. Must be at most 4096 2051 * characters long. 2052 * </pre> 2053 * 2054 * <code>string description = 3;</code> 2055 * 2056 * @param value The description to set. 2057 * @return This builder for chaining. 2058 */ setDescription(java.lang.String value)2059 public Builder setDescription(java.lang.String value) { 2060 if (value == null) { 2061 throw new NullPointerException(); 2062 } 2063 description_ = value; 2064 bitField0_ |= 0x00000004; 2065 onChanged(); 2066 return this; 2067 } 2068 /** 2069 * 2070 * 2071 * <pre> 2072 * User-provided metadata to be stored with this product. Must be at most 4096 2073 * characters long. 2074 * </pre> 2075 * 2076 * <code>string description = 3;</code> 2077 * 2078 * @return This builder for chaining. 2079 */ clearDescription()2080 public Builder clearDescription() { 2081 description_ = getDefaultInstance().getDescription(); 2082 bitField0_ = (bitField0_ & ~0x00000004); 2083 onChanged(); 2084 return this; 2085 } 2086 /** 2087 * 2088 * 2089 * <pre> 2090 * User-provided metadata to be stored with this product. Must be at most 4096 2091 * characters long. 2092 * </pre> 2093 * 2094 * <code>string description = 3;</code> 2095 * 2096 * @param value The bytes for description to set. 2097 * @return This builder for chaining. 2098 */ setDescriptionBytes(com.google.protobuf.ByteString value)2099 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 2100 if (value == null) { 2101 throw new NullPointerException(); 2102 } 2103 checkByteStringIsUtf8(value); 2104 description_ = value; 2105 bitField0_ |= 0x00000004; 2106 onChanged(); 2107 return this; 2108 } 2109 2110 private java.lang.Object productCategory_ = ""; 2111 /** 2112 * 2113 * 2114 * <pre> 2115 * Immutable. The category for the product identified by the reference image. 2116 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 2117 * legacy categories "homegoods", "apparel", and "toys" are still supported, 2118 * but these should not be used for new products. 2119 * </pre> 2120 * 2121 * <code>string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];</code> 2122 * 2123 * @return The productCategory. 2124 */ getProductCategory()2125 public java.lang.String getProductCategory() { 2126 java.lang.Object ref = productCategory_; 2127 if (!(ref instanceof java.lang.String)) { 2128 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2129 java.lang.String s = bs.toStringUtf8(); 2130 productCategory_ = s; 2131 return s; 2132 } else { 2133 return (java.lang.String) ref; 2134 } 2135 } 2136 /** 2137 * 2138 * 2139 * <pre> 2140 * Immutable. The category for the product identified by the reference image. 2141 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 2142 * legacy categories "homegoods", "apparel", and "toys" are still supported, 2143 * but these should not be used for new products. 2144 * </pre> 2145 * 2146 * <code>string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];</code> 2147 * 2148 * @return The bytes for productCategory. 2149 */ getProductCategoryBytes()2150 public com.google.protobuf.ByteString getProductCategoryBytes() { 2151 java.lang.Object ref = productCategory_; 2152 if (ref instanceof String) { 2153 com.google.protobuf.ByteString b = 2154 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2155 productCategory_ = b; 2156 return b; 2157 } else { 2158 return (com.google.protobuf.ByteString) ref; 2159 } 2160 } 2161 /** 2162 * 2163 * 2164 * <pre> 2165 * Immutable. The category for the product identified by the reference image. 2166 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 2167 * legacy categories "homegoods", "apparel", and "toys" are still supported, 2168 * but these should not be used for new products. 2169 * </pre> 2170 * 2171 * <code>string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];</code> 2172 * 2173 * @param value The productCategory to set. 2174 * @return This builder for chaining. 2175 */ setProductCategory(java.lang.String value)2176 public Builder setProductCategory(java.lang.String value) { 2177 if (value == null) { 2178 throw new NullPointerException(); 2179 } 2180 productCategory_ = value; 2181 bitField0_ |= 0x00000008; 2182 onChanged(); 2183 return this; 2184 } 2185 /** 2186 * 2187 * 2188 * <pre> 2189 * Immutable. The category for the product identified by the reference image. 2190 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 2191 * legacy categories "homegoods", "apparel", and "toys" are still supported, 2192 * but these should not be used for new products. 2193 * </pre> 2194 * 2195 * <code>string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];</code> 2196 * 2197 * @return This builder for chaining. 2198 */ clearProductCategory()2199 public Builder clearProductCategory() { 2200 productCategory_ = getDefaultInstance().getProductCategory(); 2201 bitField0_ = (bitField0_ & ~0x00000008); 2202 onChanged(); 2203 return this; 2204 } 2205 /** 2206 * 2207 * 2208 * <pre> 2209 * Immutable. The category for the product identified by the reference image. 2210 * This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The 2211 * legacy categories "homegoods", "apparel", and "toys" are still supported, 2212 * but these should not be used for new products. 2213 * </pre> 2214 * 2215 * <code>string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];</code> 2216 * 2217 * @param value The bytes for productCategory to set. 2218 * @return This builder for chaining. 2219 */ setProductCategoryBytes(com.google.protobuf.ByteString value)2220 public Builder setProductCategoryBytes(com.google.protobuf.ByteString value) { 2221 if (value == null) { 2222 throw new NullPointerException(); 2223 } 2224 checkByteStringIsUtf8(value); 2225 productCategory_ = value; 2226 bitField0_ |= 0x00000008; 2227 onChanged(); 2228 return this; 2229 } 2230 2231 private java.util.List<com.google.cloud.vision.v1p4beta1.Product.KeyValue> productLabels_ = 2232 java.util.Collections.emptyList(); 2233 ensureProductLabelsIsMutable()2234 private void ensureProductLabelsIsMutable() { 2235 if (!((bitField0_ & 0x00000010) != 0)) { 2236 productLabels_ = 2237 new java.util.ArrayList<com.google.cloud.vision.v1p4beta1.Product.KeyValue>( 2238 productLabels_); 2239 bitField0_ |= 0x00000010; 2240 } 2241 } 2242 2243 private com.google.protobuf.RepeatedFieldBuilderV3< 2244 com.google.cloud.vision.v1p4beta1.Product.KeyValue, 2245 com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, 2246 com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder> 2247 productLabelsBuilder_; 2248 2249 /** 2250 * 2251 * 2252 * <pre> 2253 * Key-value pairs that can be attached to a product. At query time, 2254 * constraints can be specified based on the product_labels. 2255 * Note that integer values can be provided as strings, e.g. "1199". Only 2256 * strings with integer values can match a range-based restriction which is 2257 * to be supported soon. 2258 * Multiple values can be assigned to the same key. One product may have up to 2259 * 500 product_labels. 2260 * Notice that the total number of distinct product_labels over all products 2261 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2262 * will refuse to work for that ProductSet. 2263 * </pre> 2264 * 2265 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2266 */ 2267 public java.util.List<com.google.cloud.vision.v1p4beta1.Product.KeyValue> getProductLabelsList()2268 getProductLabelsList() { 2269 if (productLabelsBuilder_ == null) { 2270 return java.util.Collections.unmodifiableList(productLabels_); 2271 } else { 2272 return productLabelsBuilder_.getMessageList(); 2273 } 2274 } 2275 /** 2276 * 2277 * 2278 * <pre> 2279 * Key-value pairs that can be attached to a product. At query time, 2280 * constraints can be specified based on the product_labels. 2281 * Note that integer values can be provided as strings, e.g. "1199". Only 2282 * strings with integer values can match a range-based restriction which is 2283 * to be supported soon. 2284 * Multiple values can be assigned to the same key. One product may have up to 2285 * 500 product_labels. 2286 * Notice that the total number of distinct product_labels over all products 2287 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2288 * will refuse to work for that ProductSet. 2289 * </pre> 2290 * 2291 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2292 */ getProductLabelsCount()2293 public int getProductLabelsCount() { 2294 if (productLabelsBuilder_ == null) { 2295 return productLabels_.size(); 2296 } else { 2297 return productLabelsBuilder_.getCount(); 2298 } 2299 } 2300 /** 2301 * 2302 * 2303 * <pre> 2304 * Key-value pairs that can be attached to a product. At query time, 2305 * constraints can be specified based on the product_labels. 2306 * Note that integer values can be provided as strings, e.g. "1199". Only 2307 * strings with integer values can match a range-based restriction which is 2308 * to be supported soon. 2309 * Multiple values can be assigned to the same key. One product may have up to 2310 * 500 product_labels. 2311 * Notice that the total number of distinct product_labels over all products 2312 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2313 * will refuse to work for that ProductSet. 2314 * </pre> 2315 * 2316 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2317 */ getProductLabels(int index)2318 public com.google.cloud.vision.v1p4beta1.Product.KeyValue getProductLabels(int index) { 2319 if (productLabelsBuilder_ == null) { 2320 return productLabels_.get(index); 2321 } else { 2322 return productLabelsBuilder_.getMessage(index); 2323 } 2324 } 2325 /** 2326 * 2327 * 2328 * <pre> 2329 * Key-value pairs that can be attached to a product. At query time, 2330 * constraints can be specified based on the product_labels. 2331 * Note that integer values can be provided as strings, e.g. "1199". Only 2332 * strings with integer values can match a range-based restriction which is 2333 * to be supported soon. 2334 * Multiple values can be assigned to the same key. One product may have up to 2335 * 500 product_labels. 2336 * Notice that the total number of distinct product_labels over all products 2337 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2338 * will refuse to work for that ProductSet. 2339 * </pre> 2340 * 2341 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2342 */ setProductLabels( int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue value)2343 public Builder setProductLabels( 2344 int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue value) { 2345 if (productLabelsBuilder_ == null) { 2346 if (value == null) { 2347 throw new NullPointerException(); 2348 } 2349 ensureProductLabelsIsMutable(); 2350 productLabels_.set(index, value); 2351 onChanged(); 2352 } else { 2353 productLabelsBuilder_.setMessage(index, value); 2354 } 2355 return this; 2356 } 2357 /** 2358 * 2359 * 2360 * <pre> 2361 * Key-value pairs that can be attached to a product. At query time, 2362 * constraints can be specified based on the product_labels. 2363 * Note that integer values can be provided as strings, e.g. "1199". Only 2364 * strings with integer values can match a range-based restriction which is 2365 * to be supported soon. 2366 * Multiple values can be assigned to the same key. One product may have up to 2367 * 500 product_labels. 2368 * Notice that the total number of distinct product_labels over all products 2369 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2370 * will refuse to work for that ProductSet. 2371 * </pre> 2372 * 2373 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2374 */ setProductLabels( int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue)2375 public Builder setProductLabels( 2376 int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue) { 2377 if (productLabelsBuilder_ == null) { 2378 ensureProductLabelsIsMutable(); 2379 productLabels_.set(index, builderForValue.build()); 2380 onChanged(); 2381 } else { 2382 productLabelsBuilder_.setMessage(index, builderForValue.build()); 2383 } 2384 return this; 2385 } 2386 /** 2387 * 2388 * 2389 * <pre> 2390 * Key-value pairs that can be attached to a product. At query time, 2391 * constraints can be specified based on the product_labels. 2392 * Note that integer values can be provided as strings, e.g. "1199". Only 2393 * strings with integer values can match a range-based restriction which is 2394 * to be supported soon. 2395 * Multiple values can be assigned to the same key. One product may have up to 2396 * 500 product_labels. 2397 * Notice that the total number of distinct product_labels over all products 2398 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2399 * will refuse to work for that ProductSet. 2400 * </pre> 2401 * 2402 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2403 */ addProductLabels(com.google.cloud.vision.v1p4beta1.Product.KeyValue value)2404 public Builder addProductLabels(com.google.cloud.vision.v1p4beta1.Product.KeyValue value) { 2405 if (productLabelsBuilder_ == null) { 2406 if (value == null) { 2407 throw new NullPointerException(); 2408 } 2409 ensureProductLabelsIsMutable(); 2410 productLabels_.add(value); 2411 onChanged(); 2412 } else { 2413 productLabelsBuilder_.addMessage(value); 2414 } 2415 return this; 2416 } 2417 /** 2418 * 2419 * 2420 * <pre> 2421 * Key-value pairs that can be attached to a product. At query time, 2422 * constraints can be specified based on the product_labels. 2423 * Note that integer values can be provided as strings, e.g. "1199". Only 2424 * strings with integer values can match a range-based restriction which is 2425 * to be supported soon. 2426 * Multiple values can be assigned to the same key. One product may have up to 2427 * 500 product_labels. 2428 * Notice that the total number of distinct product_labels over all products 2429 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2430 * will refuse to work for that ProductSet. 2431 * </pre> 2432 * 2433 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2434 */ addProductLabels( int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue value)2435 public Builder addProductLabels( 2436 int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue value) { 2437 if (productLabelsBuilder_ == null) { 2438 if (value == null) { 2439 throw new NullPointerException(); 2440 } 2441 ensureProductLabelsIsMutable(); 2442 productLabels_.add(index, value); 2443 onChanged(); 2444 } else { 2445 productLabelsBuilder_.addMessage(index, value); 2446 } 2447 return this; 2448 } 2449 /** 2450 * 2451 * 2452 * <pre> 2453 * Key-value pairs that can be attached to a product. At query time, 2454 * constraints can be specified based on the product_labels. 2455 * Note that integer values can be provided as strings, e.g. "1199". Only 2456 * strings with integer values can match a range-based restriction which is 2457 * to be supported soon. 2458 * Multiple values can be assigned to the same key. One product may have up to 2459 * 500 product_labels. 2460 * Notice that the total number of distinct product_labels over all products 2461 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2462 * will refuse to work for that ProductSet. 2463 * </pre> 2464 * 2465 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2466 */ addProductLabels( com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue)2467 public Builder addProductLabels( 2468 com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue) { 2469 if (productLabelsBuilder_ == null) { 2470 ensureProductLabelsIsMutable(); 2471 productLabels_.add(builderForValue.build()); 2472 onChanged(); 2473 } else { 2474 productLabelsBuilder_.addMessage(builderForValue.build()); 2475 } 2476 return this; 2477 } 2478 /** 2479 * 2480 * 2481 * <pre> 2482 * Key-value pairs that can be attached to a product. At query time, 2483 * constraints can be specified based on the product_labels. 2484 * Note that integer values can be provided as strings, e.g. "1199". Only 2485 * strings with integer values can match a range-based restriction which is 2486 * to be supported soon. 2487 * Multiple values can be assigned to the same key. One product may have up to 2488 * 500 product_labels. 2489 * Notice that the total number of distinct product_labels over all products 2490 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2491 * will refuse to work for that ProductSet. 2492 * </pre> 2493 * 2494 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2495 */ addProductLabels( int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue)2496 public Builder addProductLabels( 2497 int index, com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder builderForValue) { 2498 if (productLabelsBuilder_ == null) { 2499 ensureProductLabelsIsMutable(); 2500 productLabels_.add(index, builderForValue.build()); 2501 onChanged(); 2502 } else { 2503 productLabelsBuilder_.addMessage(index, builderForValue.build()); 2504 } 2505 return this; 2506 } 2507 /** 2508 * 2509 * 2510 * <pre> 2511 * Key-value pairs that can be attached to a product. At query time, 2512 * constraints can be specified based on the product_labels. 2513 * Note that integer values can be provided as strings, e.g. "1199". Only 2514 * strings with integer values can match a range-based restriction which is 2515 * to be supported soon. 2516 * Multiple values can be assigned to the same key. One product may have up to 2517 * 500 product_labels. 2518 * Notice that the total number of distinct product_labels over all products 2519 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2520 * will refuse to work for that ProductSet. 2521 * </pre> 2522 * 2523 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2524 */ addAllProductLabels( java.lang.Iterable<? extends com.google.cloud.vision.v1p4beta1.Product.KeyValue> values)2525 public Builder addAllProductLabels( 2526 java.lang.Iterable<? extends com.google.cloud.vision.v1p4beta1.Product.KeyValue> values) { 2527 if (productLabelsBuilder_ == null) { 2528 ensureProductLabelsIsMutable(); 2529 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productLabels_); 2530 onChanged(); 2531 } else { 2532 productLabelsBuilder_.addAllMessages(values); 2533 } 2534 return this; 2535 } 2536 /** 2537 * 2538 * 2539 * <pre> 2540 * Key-value pairs that can be attached to a product. At query time, 2541 * constraints can be specified based on the product_labels. 2542 * Note that integer values can be provided as strings, e.g. "1199". Only 2543 * strings with integer values can match a range-based restriction which is 2544 * to be supported soon. 2545 * Multiple values can be assigned to the same key. One product may have up to 2546 * 500 product_labels. 2547 * Notice that the total number of distinct product_labels over all products 2548 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2549 * will refuse to work for that ProductSet. 2550 * </pre> 2551 * 2552 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2553 */ clearProductLabels()2554 public Builder clearProductLabels() { 2555 if (productLabelsBuilder_ == null) { 2556 productLabels_ = java.util.Collections.emptyList(); 2557 bitField0_ = (bitField0_ & ~0x00000010); 2558 onChanged(); 2559 } else { 2560 productLabelsBuilder_.clear(); 2561 } 2562 return this; 2563 } 2564 /** 2565 * 2566 * 2567 * <pre> 2568 * Key-value pairs that can be attached to a product. At query time, 2569 * constraints can be specified based on the product_labels. 2570 * Note that integer values can be provided as strings, e.g. "1199". Only 2571 * strings with integer values can match a range-based restriction which is 2572 * to be supported soon. 2573 * Multiple values can be assigned to the same key. One product may have up to 2574 * 500 product_labels. 2575 * Notice that the total number of distinct product_labels over all products 2576 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2577 * will refuse to work for that ProductSet. 2578 * </pre> 2579 * 2580 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2581 */ removeProductLabels(int index)2582 public Builder removeProductLabels(int index) { 2583 if (productLabelsBuilder_ == null) { 2584 ensureProductLabelsIsMutable(); 2585 productLabels_.remove(index); 2586 onChanged(); 2587 } else { 2588 productLabelsBuilder_.remove(index); 2589 } 2590 return this; 2591 } 2592 /** 2593 * 2594 * 2595 * <pre> 2596 * Key-value pairs that can be attached to a product. At query time, 2597 * constraints can be specified based on the product_labels. 2598 * Note that integer values can be provided as strings, e.g. "1199". Only 2599 * strings with integer values can match a range-based restriction which is 2600 * to be supported soon. 2601 * Multiple values can be assigned to the same key. One product may have up to 2602 * 500 product_labels. 2603 * Notice that the total number of distinct product_labels over all products 2604 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2605 * will refuse to work for that ProductSet. 2606 * </pre> 2607 * 2608 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2609 */ getProductLabelsBuilder( int index)2610 public com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder getProductLabelsBuilder( 2611 int index) { 2612 return getProductLabelsFieldBuilder().getBuilder(index); 2613 } 2614 /** 2615 * 2616 * 2617 * <pre> 2618 * Key-value pairs that can be attached to a product. At query time, 2619 * constraints can be specified based on the product_labels. 2620 * Note that integer values can be provided as strings, e.g. "1199". Only 2621 * strings with integer values can match a range-based restriction which is 2622 * to be supported soon. 2623 * Multiple values can be assigned to the same key. One product may have up to 2624 * 500 product_labels. 2625 * Notice that the total number of distinct product_labels over all products 2626 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2627 * will refuse to work for that ProductSet. 2628 * </pre> 2629 * 2630 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2631 */ getProductLabelsOrBuilder( int index)2632 public com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder getProductLabelsOrBuilder( 2633 int index) { 2634 if (productLabelsBuilder_ == null) { 2635 return productLabels_.get(index); 2636 } else { 2637 return productLabelsBuilder_.getMessageOrBuilder(index); 2638 } 2639 } 2640 /** 2641 * 2642 * 2643 * <pre> 2644 * Key-value pairs that can be attached to a product. At query time, 2645 * constraints can be specified based on the product_labels. 2646 * Note that integer values can be provided as strings, e.g. "1199". Only 2647 * strings with integer values can match a range-based restriction which is 2648 * to be supported soon. 2649 * Multiple values can be assigned to the same key. One product may have up to 2650 * 500 product_labels. 2651 * Notice that the total number of distinct product_labels over all products 2652 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2653 * will refuse to work for that ProductSet. 2654 * </pre> 2655 * 2656 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2657 */ 2658 public java.util.List<? extends com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder> getProductLabelsOrBuilderList()2659 getProductLabelsOrBuilderList() { 2660 if (productLabelsBuilder_ != null) { 2661 return productLabelsBuilder_.getMessageOrBuilderList(); 2662 } else { 2663 return java.util.Collections.unmodifiableList(productLabels_); 2664 } 2665 } 2666 /** 2667 * 2668 * 2669 * <pre> 2670 * Key-value pairs that can be attached to a product. At query time, 2671 * constraints can be specified based on the product_labels. 2672 * Note that integer values can be provided as strings, e.g. "1199". Only 2673 * strings with integer values can match a range-based restriction which is 2674 * to be supported soon. 2675 * Multiple values can be assigned to the same key. One product may have up to 2676 * 500 product_labels. 2677 * Notice that the total number of distinct product_labels over all products 2678 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2679 * will refuse to work for that ProductSet. 2680 * </pre> 2681 * 2682 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2683 */ addProductLabelsBuilder()2684 public com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder addProductLabelsBuilder() { 2685 return getProductLabelsFieldBuilder() 2686 .addBuilder(com.google.cloud.vision.v1p4beta1.Product.KeyValue.getDefaultInstance()); 2687 } 2688 /** 2689 * 2690 * 2691 * <pre> 2692 * Key-value pairs that can be attached to a product. At query time, 2693 * constraints can be specified based on the product_labels. 2694 * Note that integer values can be provided as strings, e.g. "1199". Only 2695 * strings with integer values can match a range-based restriction which is 2696 * to be supported soon. 2697 * Multiple values can be assigned to the same key. One product may have up to 2698 * 500 product_labels. 2699 * Notice that the total number of distinct product_labels over all products 2700 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2701 * will refuse to work for that ProductSet. 2702 * </pre> 2703 * 2704 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2705 */ addProductLabelsBuilder( int index)2706 public com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder addProductLabelsBuilder( 2707 int index) { 2708 return getProductLabelsFieldBuilder() 2709 .addBuilder( 2710 index, com.google.cloud.vision.v1p4beta1.Product.KeyValue.getDefaultInstance()); 2711 } 2712 /** 2713 * 2714 * 2715 * <pre> 2716 * Key-value pairs that can be attached to a product. At query time, 2717 * constraints can be specified based on the product_labels. 2718 * Note that integer values can be provided as strings, e.g. "1199". Only 2719 * strings with integer values can match a range-based restriction which is 2720 * to be supported soon. 2721 * Multiple values can be assigned to the same key. One product may have up to 2722 * 500 product_labels. 2723 * Notice that the total number of distinct product_labels over all products 2724 * in one ProductSet cannot exceed 1M, otherwise the product search pipeline 2725 * will refuse to work for that ProductSet. 2726 * </pre> 2727 * 2728 * <code>repeated .google.cloud.vision.v1p4beta1.Product.KeyValue product_labels = 5;</code> 2729 */ 2730 public java.util.List<com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder> getProductLabelsBuilderList()2731 getProductLabelsBuilderList() { 2732 return getProductLabelsFieldBuilder().getBuilderList(); 2733 } 2734 2735 private com.google.protobuf.RepeatedFieldBuilderV3< 2736 com.google.cloud.vision.v1p4beta1.Product.KeyValue, 2737 com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, 2738 com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder> getProductLabelsFieldBuilder()2739 getProductLabelsFieldBuilder() { 2740 if (productLabelsBuilder_ == null) { 2741 productLabelsBuilder_ = 2742 new com.google.protobuf.RepeatedFieldBuilderV3< 2743 com.google.cloud.vision.v1p4beta1.Product.KeyValue, 2744 com.google.cloud.vision.v1p4beta1.Product.KeyValue.Builder, 2745 com.google.cloud.vision.v1p4beta1.Product.KeyValueOrBuilder>( 2746 productLabels_, 2747 ((bitField0_ & 0x00000010) != 0), 2748 getParentForChildren(), 2749 isClean()); 2750 productLabels_ = null; 2751 } 2752 return productLabelsBuilder_; 2753 } 2754 2755 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2756 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2757 return super.setUnknownFields(unknownFields); 2758 } 2759 2760 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2761 public final Builder mergeUnknownFields( 2762 final com.google.protobuf.UnknownFieldSet unknownFields) { 2763 return super.mergeUnknownFields(unknownFields); 2764 } 2765 2766 // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p4beta1.Product) 2767 } 2768 2769 // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product) 2770 private static final com.google.cloud.vision.v1p4beta1.Product DEFAULT_INSTANCE; 2771 2772 static { 2773 DEFAULT_INSTANCE = new com.google.cloud.vision.v1p4beta1.Product(); 2774 } 2775 getDefaultInstance()2776 public static com.google.cloud.vision.v1p4beta1.Product getDefaultInstance() { 2777 return DEFAULT_INSTANCE; 2778 } 2779 2780 private static final com.google.protobuf.Parser<Product> PARSER = 2781 new com.google.protobuf.AbstractParser<Product>() { 2782 @java.lang.Override 2783 public Product parsePartialFrom( 2784 com.google.protobuf.CodedInputStream input, 2785 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2786 throws com.google.protobuf.InvalidProtocolBufferException { 2787 Builder builder = newBuilder(); 2788 try { 2789 builder.mergeFrom(input, extensionRegistry); 2790 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2791 throw e.setUnfinishedMessage(builder.buildPartial()); 2792 } catch (com.google.protobuf.UninitializedMessageException e) { 2793 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2794 } catch (java.io.IOException e) { 2795 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2796 .setUnfinishedMessage(builder.buildPartial()); 2797 } 2798 return builder.buildPartial(); 2799 } 2800 }; 2801 parser()2802 public static com.google.protobuf.Parser<Product> parser() { 2803 return PARSER; 2804 } 2805 2806 @java.lang.Override getParserForType()2807 public com.google.protobuf.Parser<Product> getParserForType() { 2808 return PARSER; 2809 } 2810 2811 @java.lang.Override getDefaultInstanceForType()2812 public com.google.cloud.vision.v1p4beta1.Product getDefaultInstanceForType() { 2813 return DEFAULT_INSTANCE; 2814 } 2815 } 2816