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