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