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/search_service.proto 18 19 package com.google.cloud.retail.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * Response message for 26 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.retail.v2.SearchResponse} 30 */ 31 public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse) 34 SearchResponseOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use SearchResponse.newBuilder() to construct. SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 SearchResponse()41 private SearchResponse() { 42 results_ = java.util.Collections.emptyList(); 43 facets_ = java.util.Collections.emptyList(); 44 correctedQuery_ = ""; 45 attributionToken_ = ""; 46 nextPageToken_ = ""; 47 redirectUri_ = ""; 48 appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; 49 invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); 50 experimentInfo_ = java.util.Collections.emptyList(); 51 } 52 53 @java.lang.Override 54 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)55 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 56 return new SearchResponse(); 57 } 58 59 @java.lang.Override getUnknownFields()60 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 61 return this.unknownFields; 62 } 63 getDescriptor()64 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 65 return com.google.cloud.retail.v2.SearchServiceProto 66 .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; 67 } 68 69 @java.lang.Override 70 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()71 internalGetFieldAccessorTable() { 72 return com.google.cloud.retail.v2.SearchServiceProto 73 .internal_static_google_cloud_retail_v2_SearchResponse_fieldAccessorTable 74 .ensureFieldAccessorsInitialized( 75 com.google.cloud.retail.v2.SearchResponse.class, 76 com.google.cloud.retail.v2.SearchResponse.Builder.class); 77 } 78 79 public interface SearchResultOrBuilder 80 extends 81 // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.SearchResult) 82 com.google.protobuf.MessageOrBuilder { 83 84 /** 85 * 86 * 87 * <pre> 88 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 89 * [Product][google.cloud.retail.v2.Product]. 90 * </pre> 91 * 92 * <code>string id = 1;</code> 93 * 94 * @return The id. 95 */ getId()96 java.lang.String getId(); 97 /** 98 * 99 * 100 * <pre> 101 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 102 * [Product][google.cloud.retail.v2.Product]. 103 * </pre> 104 * 105 * <code>string id = 1;</code> 106 * 107 * @return The bytes for id. 108 */ getIdBytes()109 com.google.protobuf.ByteString getIdBytes(); 110 111 /** 112 * 113 * 114 * <pre> 115 * The product data snippet in the search response. Only 116 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 117 * populated. 118 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 119 * product variants that match the search query. If there are multiple 120 * product variants matching the query, top 5 most relevant product variants 121 * are returned and ordered by relevancy. 122 * If relevancy can be deternmined, use 123 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 124 * to look up matched product variants fields. If relevancy cannot be 125 * determined, e.g. when searching "shoe" all products in a shoe product can 126 * be a match, 5 product variants are returned but order is meaningless. 127 * </pre> 128 * 129 * <code>.google.cloud.retail.v2.Product product = 2;</code> 130 * 131 * @return Whether the product field is set. 132 */ hasProduct()133 boolean hasProduct(); 134 /** 135 * 136 * 137 * <pre> 138 * The product data snippet in the search response. Only 139 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 140 * populated. 141 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 142 * product variants that match the search query. If there are multiple 143 * product variants matching the query, top 5 most relevant product variants 144 * are returned and ordered by relevancy. 145 * If relevancy can be deternmined, use 146 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 147 * to look up matched product variants fields. If relevancy cannot be 148 * determined, e.g. when searching "shoe" all products in a shoe product can 149 * be a match, 5 product variants are returned but order is meaningless. 150 * </pre> 151 * 152 * <code>.google.cloud.retail.v2.Product product = 2;</code> 153 * 154 * @return The product. 155 */ getProduct()156 com.google.cloud.retail.v2.Product getProduct(); 157 /** 158 * 159 * 160 * <pre> 161 * The product data snippet in the search response. Only 162 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 163 * populated. 164 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 165 * product variants that match the search query. If there are multiple 166 * product variants matching the query, top 5 most relevant product variants 167 * are returned and ordered by relevancy. 168 * If relevancy can be deternmined, use 169 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 170 * to look up matched product variants fields. If relevancy cannot be 171 * determined, e.g. when searching "shoe" all products in a shoe product can 172 * be a match, 5 product variants are returned but order is meaningless. 173 * </pre> 174 * 175 * <code>.google.cloud.retail.v2.Product product = 2;</code> 176 */ getProductOrBuilder()177 com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder(); 178 179 /** 180 * 181 * 182 * <pre> 183 * The count of matched 184 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 185 * [Product][google.cloud.retail.v2.Product]s. 186 * </pre> 187 * 188 * <code>int32 matching_variant_count = 3;</code> 189 * 190 * @return The matchingVariantCount. 191 */ getMatchingVariantCount()192 int getMatchingVariantCount(); 193 194 /** 195 * 196 * 197 * <pre> 198 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 199 * [Product][google.cloud.retail.v2.Product] matches the search query, this 200 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 201 * matched. The key is the 202 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 203 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 204 * matched attributes cannot be determined, this map will be empty. 205 * For example, a key "sku1" with field mask 206 * "products.color_info" indicates there is a match between 207 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 208 * </pre> 209 * 210 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 211 */ getMatchingVariantFieldsCount()212 int getMatchingVariantFieldsCount(); 213 /** 214 * 215 * 216 * <pre> 217 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 218 * [Product][google.cloud.retail.v2.Product] matches the search query, this 219 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 220 * matched. The key is the 221 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 222 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 223 * matched attributes cannot be determined, this map will be empty. 224 * For example, a key "sku1" with field mask 225 * "products.color_info" indicates there is a match between 226 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 227 * </pre> 228 * 229 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 230 */ containsMatchingVariantFields(java.lang.String key)231 boolean containsMatchingVariantFields(java.lang.String key); 232 /** Use {@link #getMatchingVariantFieldsMap()} instead. */ 233 @java.lang.Deprecated getMatchingVariantFields()234 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFields(); 235 /** 236 * 237 * 238 * <pre> 239 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 240 * [Product][google.cloud.retail.v2.Product] matches the search query, this 241 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 242 * matched. The key is the 243 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 244 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 245 * matched attributes cannot be determined, this map will be empty. 246 * For example, a key "sku1" with field mask 247 * "products.color_info" indicates there is a match between 248 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 249 * </pre> 250 * 251 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 252 */ getMatchingVariantFieldsMap()253 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFieldsMap(); 254 /** 255 * 256 * 257 * <pre> 258 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 259 * [Product][google.cloud.retail.v2.Product] matches the search query, this 260 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 261 * matched. The key is the 262 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 263 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 264 * matched attributes cannot be determined, this map will be empty. 265 * For example, a key "sku1" with field mask 266 * "products.color_info" indicates there is a match between 267 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 268 * </pre> 269 * 270 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 271 */ 272 /* nullable */ getMatchingVariantFieldsOrDefault( java.lang.String key, com.google.protobuf.FieldMask defaultValue)273 com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( 274 java.lang.String key, 275 /* nullable */ 276 com.google.protobuf.FieldMask defaultValue); 277 /** 278 * 279 * 280 * <pre> 281 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 282 * [Product][google.cloud.retail.v2.Product] matches the search query, this 283 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 284 * matched. The key is the 285 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 286 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 287 * matched attributes cannot be determined, this map will be empty. 288 * For example, a key "sku1" with field mask 289 * "products.color_info" indicates there is a match between 290 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 291 * </pre> 292 * 293 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 294 */ getMatchingVariantFieldsOrThrow(java.lang.String key)295 com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key); 296 297 /** 298 * 299 * 300 * <pre> 301 * The rollup matching 302 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 303 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 304 * the 305 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 306 * The values are the merged and de-duplicated 307 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 308 * rollup values are respect filter. For example, when filtering by 309 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 310 * returned. 311 * For textual and numerical attributes, the rollup values is a list of 312 * string or double values with type 313 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 314 * there are two variants with colors "red" and "blue", the rollup values 315 * are 316 * { key: "colorFamilies" 317 * value { 318 * list_value { 319 * values { string_value: "red" } 320 * values { string_value: "blue" } 321 * } 322 * } 323 * } 324 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 325 * values is a double value with type 326 * [google.protobuf.Value][google.protobuf.Value]. For example, 327 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 328 * are 10 variants in this product are available in the store "store1". 329 * </pre> 330 * 331 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 332 */ getVariantRollupValuesCount()333 int getVariantRollupValuesCount(); 334 /** 335 * 336 * 337 * <pre> 338 * The rollup matching 339 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 340 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 341 * the 342 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 343 * The values are the merged and de-duplicated 344 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 345 * rollup values are respect filter. For example, when filtering by 346 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 347 * returned. 348 * For textual and numerical attributes, the rollup values is a list of 349 * string or double values with type 350 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 351 * there are two variants with colors "red" and "blue", the rollup values 352 * are 353 * { key: "colorFamilies" 354 * value { 355 * list_value { 356 * values { string_value: "red" } 357 * values { string_value: "blue" } 358 * } 359 * } 360 * } 361 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 362 * values is a double value with type 363 * [google.protobuf.Value][google.protobuf.Value]. For example, 364 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 365 * are 10 variants in this product are available in the store "store1". 366 * </pre> 367 * 368 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 369 */ containsVariantRollupValues(java.lang.String key)370 boolean containsVariantRollupValues(java.lang.String key); 371 /** Use {@link #getVariantRollupValuesMap()} instead. */ 372 @java.lang.Deprecated getVariantRollupValues()373 java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValues(); 374 /** 375 * 376 * 377 * <pre> 378 * The rollup matching 379 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 380 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 381 * the 382 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 383 * The values are the merged and de-duplicated 384 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 385 * rollup values are respect filter. For example, when filtering by 386 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 387 * returned. 388 * For textual and numerical attributes, the rollup values is a list of 389 * string or double values with type 390 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 391 * there are two variants with colors "red" and "blue", the rollup values 392 * are 393 * { key: "colorFamilies" 394 * value { 395 * list_value { 396 * values { string_value: "red" } 397 * values { string_value: "blue" } 398 * } 399 * } 400 * } 401 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 402 * values is a double value with type 403 * [google.protobuf.Value][google.protobuf.Value]. For example, 404 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 405 * are 10 variants in this product are available in the store "store1". 406 * </pre> 407 * 408 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 409 */ getVariantRollupValuesMap()410 java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValuesMap(); 411 /** 412 * 413 * 414 * <pre> 415 * The rollup matching 416 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 417 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 418 * the 419 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 420 * The values are the merged and de-duplicated 421 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 422 * rollup values are respect filter. For example, when filtering by 423 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 424 * returned. 425 * For textual and numerical attributes, the rollup values is a list of 426 * string or double values with type 427 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 428 * there are two variants with colors "red" and "blue", the rollup values 429 * are 430 * { key: "colorFamilies" 431 * value { 432 * list_value { 433 * values { string_value: "red" } 434 * values { string_value: "blue" } 435 * } 436 * } 437 * } 438 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 439 * values is a double value with type 440 * [google.protobuf.Value][google.protobuf.Value]. For example, 441 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 442 * are 10 variants in this product are available in the store "store1". 443 * </pre> 444 * 445 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 446 */ 447 /* nullable */ getVariantRollupValuesOrDefault( java.lang.String key, com.google.protobuf.Value defaultValue)448 com.google.protobuf.Value getVariantRollupValuesOrDefault( 449 java.lang.String key, 450 /* nullable */ 451 com.google.protobuf.Value defaultValue); 452 /** 453 * 454 * 455 * <pre> 456 * The rollup matching 457 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 458 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 459 * the 460 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 461 * The values are the merged and de-duplicated 462 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 463 * rollup values are respect filter. For example, when filtering by 464 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 465 * returned. 466 * For textual and numerical attributes, the rollup values is a list of 467 * string or double values with type 468 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 469 * there are two variants with colors "red" and "blue", the rollup values 470 * are 471 * { key: "colorFamilies" 472 * value { 473 * list_value { 474 * values { string_value: "red" } 475 * values { string_value: "blue" } 476 * } 477 * } 478 * } 479 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 480 * values is a double value with type 481 * [google.protobuf.Value][google.protobuf.Value]. For example, 482 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 483 * are 10 variants in this product are available in the store "store1". 484 * </pre> 485 * 486 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 487 */ getVariantRollupValuesOrThrow(java.lang.String key)488 com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key); 489 490 /** 491 * 492 * 493 * <pre> 494 * Specifies previous events related to this product for this user based on 495 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 496 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 497 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 498 * This is set only when 499 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 500 * is 501 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 502 * Possible values: 503 * * `purchased`: Indicates that this product has been purchased before. 504 * </pre> 505 * 506 * <code>repeated string personal_labels = 7;</code> 507 * 508 * @return A list containing the personalLabels. 509 */ getPersonalLabelsList()510 java.util.List<java.lang.String> getPersonalLabelsList(); 511 /** 512 * 513 * 514 * <pre> 515 * Specifies previous events related to this product for this user based on 516 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 517 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 518 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 519 * This is set only when 520 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 521 * is 522 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 523 * Possible values: 524 * * `purchased`: Indicates that this product has been purchased before. 525 * </pre> 526 * 527 * <code>repeated string personal_labels = 7;</code> 528 * 529 * @return The count of personalLabels. 530 */ getPersonalLabelsCount()531 int getPersonalLabelsCount(); 532 /** 533 * 534 * 535 * <pre> 536 * Specifies previous events related to this product for this user based on 537 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 538 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 539 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 540 * This is set only when 541 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 542 * is 543 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 544 * Possible values: 545 * * `purchased`: Indicates that this product has been purchased before. 546 * </pre> 547 * 548 * <code>repeated string personal_labels = 7;</code> 549 * 550 * @param index The index of the element to return. 551 * @return The personalLabels at the given index. 552 */ getPersonalLabels(int index)553 java.lang.String getPersonalLabels(int index); 554 /** 555 * 556 * 557 * <pre> 558 * Specifies previous events related to this product for this user based on 559 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 560 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 561 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 562 * This is set only when 563 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 564 * is 565 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 566 * Possible values: 567 * * `purchased`: Indicates that this product has been purchased before. 568 * </pre> 569 * 570 * <code>repeated string personal_labels = 7;</code> 571 * 572 * @param index The index of the value to return. 573 * @return The bytes of the personalLabels at the given index. 574 */ getPersonalLabelsBytes(int index)575 com.google.protobuf.ByteString getPersonalLabelsBytes(int index); 576 } 577 /** 578 * 579 * 580 * <pre> 581 * Represents the search results. 582 * </pre> 583 * 584 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.SearchResult} 585 */ 586 public static final class SearchResult extends com.google.protobuf.GeneratedMessageV3 587 implements 588 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.SearchResult) 589 SearchResultOrBuilder { 590 private static final long serialVersionUID = 0L; 591 // Use SearchResult.newBuilder() to construct. SearchResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)592 private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 593 super(builder); 594 } 595 SearchResult()596 private SearchResult() { 597 id_ = ""; 598 personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; 599 } 600 601 @java.lang.Override 602 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)603 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 604 return new SearchResult(); 605 } 606 607 @java.lang.Override getUnknownFields()608 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 609 return this.unknownFields; 610 } 611 getDescriptor()612 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 613 return com.google.cloud.retail.v2.SearchServiceProto 614 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; 615 } 616 617 @SuppressWarnings({"rawtypes"}) 618 @java.lang.Override internalGetMapField(int number)619 protected com.google.protobuf.MapField internalGetMapField(int number) { 620 switch (number) { 621 case 4: 622 return internalGetMatchingVariantFields(); 623 case 5: 624 return internalGetVariantRollupValues(); 625 default: 626 throw new RuntimeException("Invalid map field number: " + number); 627 } 628 } 629 630 @java.lang.Override 631 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()632 internalGetFieldAccessorTable() { 633 return com.google.cloud.retail.v2.SearchServiceProto 634 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_fieldAccessorTable 635 .ensureFieldAccessorsInitialized( 636 com.google.cloud.retail.v2.SearchResponse.SearchResult.class, 637 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder.class); 638 } 639 640 public static final int ID_FIELD_NUMBER = 1; 641 642 @SuppressWarnings("serial") 643 private volatile java.lang.Object id_ = ""; 644 /** 645 * 646 * 647 * <pre> 648 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 649 * [Product][google.cloud.retail.v2.Product]. 650 * </pre> 651 * 652 * <code>string id = 1;</code> 653 * 654 * @return The id. 655 */ 656 @java.lang.Override getId()657 public java.lang.String getId() { 658 java.lang.Object ref = id_; 659 if (ref instanceof java.lang.String) { 660 return (java.lang.String) ref; 661 } else { 662 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 663 java.lang.String s = bs.toStringUtf8(); 664 id_ = s; 665 return s; 666 } 667 } 668 /** 669 * 670 * 671 * <pre> 672 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 673 * [Product][google.cloud.retail.v2.Product]. 674 * </pre> 675 * 676 * <code>string id = 1;</code> 677 * 678 * @return The bytes for id. 679 */ 680 @java.lang.Override getIdBytes()681 public com.google.protobuf.ByteString getIdBytes() { 682 java.lang.Object ref = id_; 683 if (ref instanceof java.lang.String) { 684 com.google.protobuf.ByteString b = 685 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 686 id_ = b; 687 return b; 688 } else { 689 return (com.google.protobuf.ByteString) ref; 690 } 691 } 692 693 public static final int PRODUCT_FIELD_NUMBER = 2; 694 private com.google.cloud.retail.v2.Product product_; 695 /** 696 * 697 * 698 * <pre> 699 * The product data snippet in the search response. Only 700 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 701 * populated. 702 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 703 * product variants that match the search query. If there are multiple 704 * product variants matching the query, top 5 most relevant product variants 705 * are returned and ordered by relevancy. 706 * If relevancy can be deternmined, use 707 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 708 * to look up matched product variants fields. If relevancy cannot be 709 * determined, e.g. when searching "shoe" all products in a shoe product can 710 * be a match, 5 product variants are returned but order is meaningless. 711 * </pre> 712 * 713 * <code>.google.cloud.retail.v2.Product product = 2;</code> 714 * 715 * @return Whether the product field is set. 716 */ 717 @java.lang.Override hasProduct()718 public boolean hasProduct() { 719 return product_ != null; 720 } 721 /** 722 * 723 * 724 * <pre> 725 * The product data snippet in the search response. Only 726 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 727 * populated. 728 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 729 * product variants that match the search query. If there are multiple 730 * product variants matching the query, top 5 most relevant product variants 731 * are returned and ordered by relevancy. 732 * If relevancy can be deternmined, use 733 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 734 * to look up matched product variants fields. If relevancy cannot be 735 * determined, e.g. when searching "shoe" all products in a shoe product can 736 * be a match, 5 product variants are returned but order is meaningless. 737 * </pre> 738 * 739 * <code>.google.cloud.retail.v2.Product product = 2;</code> 740 * 741 * @return The product. 742 */ 743 @java.lang.Override getProduct()744 public com.google.cloud.retail.v2.Product getProduct() { 745 return product_ == null ? com.google.cloud.retail.v2.Product.getDefaultInstance() : product_; 746 } 747 /** 748 * 749 * 750 * <pre> 751 * The product data snippet in the search response. Only 752 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 753 * populated. 754 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 755 * product variants that match the search query. If there are multiple 756 * product variants matching the query, top 5 most relevant product variants 757 * are returned and ordered by relevancy. 758 * If relevancy can be deternmined, use 759 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 760 * to look up matched product variants fields. If relevancy cannot be 761 * determined, e.g. when searching "shoe" all products in a shoe product can 762 * be a match, 5 product variants are returned but order is meaningless. 763 * </pre> 764 * 765 * <code>.google.cloud.retail.v2.Product product = 2;</code> 766 */ 767 @java.lang.Override getProductOrBuilder()768 public com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder() { 769 return product_ == null ? com.google.cloud.retail.v2.Product.getDefaultInstance() : product_; 770 } 771 772 public static final int MATCHING_VARIANT_COUNT_FIELD_NUMBER = 3; 773 private int matchingVariantCount_ = 0; 774 /** 775 * 776 * 777 * <pre> 778 * The count of matched 779 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 780 * [Product][google.cloud.retail.v2.Product]s. 781 * </pre> 782 * 783 * <code>int32 matching_variant_count = 3;</code> 784 * 785 * @return The matchingVariantCount. 786 */ 787 @java.lang.Override getMatchingVariantCount()788 public int getMatchingVariantCount() { 789 return matchingVariantCount_; 790 } 791 792 public static final int MATCHING_VARIANT_FIELDS_FIELD_NUMBER = 4; 793 794 private static final class MatchingVariantFieldsDefaultEntryHolder { 795 static final com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.FieldMask> 796 defaultEntry = 797 com.google.protobuf.MapEntry 798 .<java.lang.String, com.google.protobuf.FieldMask>newDefaultInstance( 799 com.google.cloud.retail.v2.SearchServiceProto 800 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor, 801 com.google.protobuf.WireFormat.FieldType.STRING, 802 "", 803 com.google.protobuf.WireFormat.FieldType.MESSAGE, 804 com.google.protobuf.FieldMask.getDefaultInstance()); 805 } 806 807 @SuppressWarnings("serial") 808 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.FieldMask> 809 matchingVariantFields_; 810 811 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.FieldMask> internalGetMatchingVariantFields()812 internalGetMatchingVariantFields() { 813 if (matchingVariantFields_ == null) { 814 return com.google.protobuf.MapField.emptyMapField( 815 MatchingVariantFieldsDefaultEntryHolder.defaultEntry); 816 } 817 return matchingVariantFields_; 818 } 819 getMatchingVariantFieldsCount()820 public int getMatchingVariantFieldsCount() { 821 return internalGetMatchingVariantFields().getMap().size(); 822 } 823 /** 824 * 825 * 826 * <pre> 827 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 828 * [Product][google.cloud.retail.v2.Product] matches the search query, this 829 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 830 * matched. The key is the 831 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 832 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 833 * matched attributes cannot be determined, this map will be empty. 834 * For example, a key "sku1" with field mask 835 * "products.color_info" indicates there is a match between 836 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 837 * </pre> 838 * 839 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 840 */ 841 @java.lang.Override containsMatchingVariantFields(java.lang.String key)842 public boolean containsMatchingVariantFields(java.lang.String key) { 843 if (key == null) { 844 throw new NullPointerException("map key"); 845 } 846 return internalGetMatchingVariantFields().getMap().containsKey(key); 847 } 848 /** Use {@link #getMatchingVariantFieldsMap()} instead. */ 849 @java.lang.Override 850 @java.lang.Deprecated 851 public java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFields()852 getMatchingVariantFields() { 853 return getMatchingVariantFieldsMap(); 854 } 855 /** 856 * 857 * 858 * <pre> 859 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 860 * [Product][google.cloud.retail.v2.Product] matches the search query, this 861 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 862 * matched. The key is the 863 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 864 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 865 * matched attributes cannot be determined, this map will be empty. 866 * For example, a key "sku1" with field mask 867 * "products.color_info" indicates there is a match between 868 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 869 * </pre> 870 * 871 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 872 */ 873 @java.lang.Override 874 public java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFieldsMap()875 getMatchingVariantFieldsMap() { 876 return internalGetMatchingVariantFields().getMap(); 877 } 878 /** 879 * 880 * 881 * <pre> 882 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 883 * [Product][google.cloud.retail.v2.Product] matches the search query, this 884 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 885 * matched. The key is the 886 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 887 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 888 * matched attributes cannot be determined, this map will be empty. 889 * For example, a key "sku1" with field mask 890 * "products.color_info" indicates there is a match between 891 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 892 * </pre> 893 * 894 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 895 */ 896 @java.lang.Override getMatchingVariantFieldsOrDefault( java.lang.String key, com.google.protobuf.FieldMask defaultValue)897 public /* nullable */ com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( 898 java.lang.String key, 899 /* nullable */ 900 com.google.protobuf.FieldMask defaultValue) { 901 if (key == null) { 902 throw new NullPointerException("map key"); 903 } 904 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> map = 905 internalGetMatchingVariantFields().getMap(); 906 return map.containsKey(key) ? map.get(key) : defaultValue; 907 } 908 /** 909 * 910 * 911 * <pre> 912 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 913 * [Product][google.cloud.retail.v2.Product] matches the search query, this 914 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 915 * matched. The key is the 916 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 917 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 918 * matched attributes cannot be determined, this map will be empty. 919 * For example, a key "sku1" with field mask 920 * "products.color_info" indicates there is a match between 921 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 922 * </pre> 923 * 924 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 925 */ 926 @java.lang.Override getMatchingVariantFieldsOrThrow(java.lang.String key)927 public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { 928 if (key == null) { 929 throw new NullPointerException("map key"); 930 } 931 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> map = 932 internalGetMatchingVariantFields().getMap(); 933 if (!map.containsKey(key)) { 934 throw new java.lang.IllegalArgumentException(); 935 } 936 return map.get(key); 937 } 938 939 public static final int VARIANT_ROLLUP_VALUES_FIELD_NUMBER = 5; 940 941 private static final class VariantRollupValuesDefaultEntryHolder { 942 static final com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> 943 defaultEntry = 944 com.google.protobuf.MapEntry 945 .<java.lang.String, com.google.protobuf.Value>newDefaultInstance( 946 com.google.cloud.retail.v2.SearchServiceProto 947 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_VariantRollupValuesEntry_descriptor, 948 com.google.protobuf.WireFormat.FieldType.STRING, 949 "", 950 com.google.protobuf.WireFormat.FieldType.MESSAGE, 951 com.google.protobuf.Value.getDefaultInstance()); 952 } 953 954 @SuppressWarnings("serial") 955 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> 956 variantRollupValues_; 957 958 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> internalGetVariantRollupValues()959 internalGetVariantRollupValues() { 960 if (variantRollupValues_ == null) { 961 return com.google.protobuf.MapField.emptyMapField( 962 VariantRollupValuesDefaultEntryHolder.defaultEntry); 963 } 964 return variantRollupValues_; 965 } 966 getVariantRollupValuesCount()967 public int getVariantRollupValuesCount() { 968 return internalGetVariantRollupValues().getMap().size(); 969 } 970 /** 971 * 972 * 973 * <pre> 974 * The rollup matching 975 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 976 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 977 * the 978 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 979 * The values are the merged and de-duplicated 980 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 981 * rollup values are respect filter. For example, when filtering by 982 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 983 * returned. 984 * For textual and numerical attributes, the rollup values is a list of 985 * string or double values with type 986 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 987 * there are two variants with colors "red" and "blue", the rollup values 988 * are 989 * { key: "colorFamilies" 990 * value { 991 * list_value { 992 * values { string_value: "red" } 993 * values { string_value: "blue" } 994 * } 995 * } 996 * } 997 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 998 * values is a double value with type 999 * [google.protobuf.Value][google.protobuf.Value]. For example, 1000 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 1001 * are 10 variants in this product are available in the store "store1". 1002 * </pre> 1003 * 1004 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 1005 */ 1006 @java.lang.Override containsVariantRollupValues(java.lang.String key)1007 public boolean containsVariantRollupValues(java.lang.String key) { 1008 if (key == null) { 1009 throw new NullPointerException("map key"); 1010 } 1011 return internalGetVariantRollupValues().getMap().containsKey(key); 1012 } 1013 /** Use {@link #getVariantRollupValuesMap()} instead. */ 1014 @java.lang.Override 1015 @java.lang.Deprecated getVariantRollupValues()1016 public java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValues() { 1017 return getVariantRollupValuesMap(); 1018 } 1019 /** 1020 * 1021 * 1022 * <pre> 1023 * The rollup matching 1024 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 1025 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 1026 * the 1027 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 1028 * The values are the merged and de-duplicated 1029 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 1030 * rollup values are respect filter. For example, when filtering by 1031 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 1032 * returned. 1033 * For textual and numerical attributes, the rollup values is a list of 1034 * string or double values with type 1035 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 1036 * there are two variants with colors "red" and "blue", the rollup values 1037 * are 1038 * { key: "colorFamilies" 1039 * value { 1040 * list_value { 1041 * values { string_value: "red" } 1042 * values { string_value: "blue" } 1043 * } 1044 * } 1045 * } 1046 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 1047 * values is a double value with type 1048 * [google.protobuf.Value][google.protobuf.Value]. For example, 1049 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 1050 * are 10 variants in this product are available in the store "store1". 1051 * </pre> 1052 * 1053 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 1054 */ 1055 @java.lang.Override getVariantRollupValuesMap()1056 public java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValuesMap() { 1057 return internalGetVariantRollupValues().getMap(); 1058 } 1059 /** 1060 * 1061 * 1062 * <pre> 1063 * The rollup matching 1064 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 1065 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 1066 * the 1067 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 1068 * The values are the merged and de-duplicated 1069 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 1070 * rollup values are respect filter. For example, when filtering by 1071 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 1072 * returned. 1073 * For textual and numerical attributes, the rollup values is a list of 1074 * string or double values with type 1075 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 1076 * there are two variants with colors "red" and "blue", the rollup values 1077 * are 1078 * { key: "colorFamilies" 1079 * value { 1080 * list_value { 1081 * values { string_value: "red" } 1082 * values { string_value: "blue" } 1083 * } 1084 * } 1085 * } 1086 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 1087 * values is a double value with type 1088 * [google.protobuf.Value][google.protobuf.Value]. For example, 1089 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 1090 * are 10 variants in this product are available in the store "store1". 1091 * </pre> 1092 * 1093 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 1094 */ 1095 @java.lang.Override getVariantRollupValuesOrDefault( java.lang.String key, com.google.protobuf.Value defaultValue)1096 public /* nullable */ com.google.protobuf.Value getVariantRollupValuesOrDefault( 1097 java.lang.String key, 1098 /* nullable */ 1099 com.google.protobuf.Value defaultValue) { 1100 if (key == null) { 1101 throw new NullPointerException("map key"); 1102 } 1103 java.util.Map<java.lang.String, com.google.protobuf.Value> map = 1104 internalGetVariantRollupValues().getMap(); 1105 return map.containsKey(key) ? map.get(key) : defaultValue; 1106 } 1107 /** 1108 * 1109 * 1110 * <pre> 1111 * The rollup matching 1112 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 1113 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 1114 * the 1115 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 1116 * The values are the merged and de-duplicated 1117 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 1118 * rollup values are respect filter. For example, when filtering by 1119 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 1120 * returned. 1121 * For textual and numerical attributes, the rollup values is a list of 1122 * string or double values with type 1123 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 1124 * there are two variants with colors "red" and "blue", the rollup values 1125 * are 1126 * { key: "colorFamilies" 1127 * value { 1128 * list_value { 1129 * values { string_value: "red" } 1130 * values { string_value: "blue" } 1131 * } 1132 * } 1133 * } 1134 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 1135 * values is a double value with type 1136 * [google.protobuf.Value][google.protobuf.Value]. For example, 1137 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 1138 * are 10 variants in this product are available in the store "store1". 1139 * </pre> 1140 * 1141 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 1142 */ 1143 @java.lang.Override getVariantRollupValuesOrThrow(java.lang.String key)1144 public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { 1145 if (key == null) { 1146 throw new NullPointerException("map key"); 1147 } 1148 java.util.Map<java.lang.String, com.google.protobuf.Value> map = 1149 internalGetVariantRollupValues().getMap(); 1150 if (!map.containsKey(key)) { 1151 throw new java.lang.IllegalArgumentException(); 1152 } 1153 return map.get(key); 1154 } 1155 1156 public static final int PERSONAL_LABELS_FIELD_NUMBER = 7; 1157 1158 @SuppressWarnings("serial") 1159 private com.google.protobuf.LazyStringList personalLabels_; 1160 /** 1161 * 1162 * 1163 * <pre> 1164 * Specifies previous events related to this product for this user based on 1165 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 1166 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 1167 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 1168 * This is set only when 1169 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 1170 * is 1171 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 1172 * Possible values: 1173 * * `purchased`: Indicates that this product has been purchased before. 1174 * </pre> 1175 * 1176 * <code>repeated string personal_labels = 7;</code> 1177 * 1178 * @return A list containing the personalLabels. 1179 */ getPersonalLabelsList()1180 public com.google.protobuf.ProtocolStringList getPersonalLabelsList() { 1181 return personalLabels_; 1182 } 1183 /** 1184 * 1185 * 1186 * <pre> 1187 * Specifies previous events related to this product for this user based on 1188 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 1189 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 1190 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 1191 * This is set only when 1192 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 1193 * is 1194 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 1195 * Possible values: 1196 * * `purchased`: Indicates that this product has been purchased before. 1197 * </pre> 1198 * 1199 * <code>repeated string personal_labels = 7;</code> 1200 * 1201 * @return The count of personalLabels. 1202 */ getPersonalLabelsCount()1203 public int getPersonalLabelsCount() { 1204 return personalLabels_.size(); 1205 } 1206 /** 1207 * 1208 * 1209 * <pre> 1210 * Specifies previous events related to this product for this user based on 1211 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 1212 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 1213 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 1214 * This is set only when 1215 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 1216 * is 1217 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 1218 * Possible values: 1219 * * `purchased`: Indicates that this product has been purchased before. 1220 * </pre> 1221 * 1222 * <code>repeated string personal_labels = 7;</code> 1223 * 1224 * @param index The index of the element to return. 1225 * @return The personalLabels at the given index. 1226 */ getPersonalLabels(int index)1227 public java.lang.String getPersonalLabels(int index) { 1228 return personalLabels_.get(index); 1229 } 1230 /** 1231 * 1232 * 1233 * <pre> 1234 * Specifies previous events related to this product for this user based on 1235 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 1236 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 1237 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 1238 * This is set only when 1239 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 1240 * is 1241 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 1242 * Possible values: 1243 * * `purchased`: Indicates that this product has been purchased before. 1244 * </pre> 1245 * 1246 * <code>repeated string personal_labels = 7;</code> 1247 * 1248 * @param index The index of the value to return. 1249 * @return The bytes of the personalLabels at the given index. 1250 */ getPersonalLabelsBytes(int index)1251 public com.google.protobuf.ByteString getPersonalLabelsBytes(int index) { 1252 return personalLabels_.getByteString(index); 1253 } 1254 1255 private byte memoizedIsInitialized = -1; 1256 1257 @java.lang.Override isInitialized()1258 public final boolean isInitialized() { 1259 byte isInitialized = memoizedIsInitialized; 1260 if (isInitialized == 1) return true; 1261 if (isInitialized == 0) return false; 1262 1263 memoizedIsInitialized = 1; 1264 return true; 1265 } 1266 1267 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1268 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1269 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { 1270 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); 1271 } 1272 if (product_ != null) { 1273 output.writeMessage(2, getProduct()); 1274 } 1275 if (matchingVariantCount_ != 0) { 1276 output.writeInt32(3, matchingVariantCount_); 1277 } 1278 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1279 output, 1280 internalGetMatchingVariantFields(), 1281 MatchingVariantFieldsDefaultEntryHolder.defaultEntry, 1282 4); 1283 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1284 output, 1285 internalGetVariantRollupValues(), 1286 VariantRollupValuesDefaultEntryHolder.defaultEntry, 1287 5); 1288 for (int i = 0; i < personalLabels_.size(); i++) { 1289 com.google.protobuf.GeneratedMessageV3.writeString(output, 7, personalLabels_.getRaw(i)); 1290 } 1291 getUnknownFields().writeTo(output); 1292 } 1293 1294 @java.lang.Override getSerializedSize()1295 public int getSerializedSize() { 1296 int size = memoizedSize; 1297 if (size != -1) return size; 1298 1299 size = 0; 1300 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { 1301 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); 1302 } 1303 if (product_ != null) { 1304 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); 1305 } 1306 if (matchingVariantCount_ != 0) { 1307 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, matchingVariantCount_); 1308 } 1309 for (java.util.Map.Entry<java.lang.String, com.google.protobuf.FieldMask> entry : 1310 internalGetMatchingVariantFields().getMap().entrySet()) { 1311 com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.FieldMask> 1312 matchingVariantFields__ = 1313 MatchingVariantFieldsDefaultEntryHolder.defaultEntry 1314 .newBuilderForType() 1315 .setKey(entry.getKey()) 1316 .setValue(entry.getValue()) 1317 .build(); 1318 size += 1319 com.google.protobuf.CodedOutputStream.computeMessageSize(4, matchingVariantFields__); 1320 } 1321 for (java.util.Map.Entry<java.lang.String, com.google.protobuf.Value> entry : 1322 internalGetVariantRollupValues().getMap().entrySet()) { 1323 com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> 1324 variantRollupValues__ = 1325 VariantRollupValuesDefaultEntryHolder.defaultEntry 1326 .newBuilderForType() 1327 .setKey(entry.getKey()) 1328 .setValue(entry.getValue()) 1329 .build(); 1330 size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, variantRollupValues__); 1331 } 1332 { 1333 int dataSize = 0; 1334 for (int i = 0; i < personalLabels_.size(); i++) { 1335 dataSize += computeStringSizeNoTag(personalLabels_.getRaw(i)); 1336 } 1337 size += dataSize; 1338 size += 1 * getPersonalLabelsList().size(); 1339 } 1340 size += getUnknownFields().getSerializedSize(); 1341 memoizedSize = size; 1342 return size; 1343 } 1344 1345 @java.lang.Override equals(final java.lang.Object obj)1346 public boolean equals(final java.lang.Object obj) { 1347 if (obj == this) { 1348 return true; 1349 } 1350 if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.SearchResult)) { 1351 return super.equals(obj); 1352 } 1353 com.google.cloud.retail.v2.SearchResponse.SearchResult other = 1354 (com.google.cloud.retail.v2.SearchResponse.SearchResult) obj; 1355 1356 if (!getId().equals(other.getId())) return false; 1357 if (hasProduct() != other.hasProduct()) return false; 1358 if (hasProduct()) { 1359 if (!getProduct().equals(other.getProduct())) return false; 1360 } 1361 if (getMatchingVariantCount() != other.getMatchingVariantCount()) return false; 1362 if (!internalGetMatchingVariantFields().equals(other.internalGetMatchingVariantFields())) 1363 return false; 1364 if (!internalGetVariantRollupValues().equals(other.internalGetVariantRollupValues())) 1365 return false; 1366 if (!getPersonalLabelsList().equals(other.getPersonalLabelsList())) return false; 1367 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1368 return true; 1369 } 1370 1371 @java.lang.Override hashCode()1372 public int hashCode() { 1373 if (memoizedHashCode != 0) { 1374 return memoizedHashCode; 1375 } 1376 int hash = 41; 1377 hash = (19 * hash) + getDescriptor().hashCode(); 1378 hash = (37 * hash) + ID_FIELD_NUMBER; 1379 hash = (53 * hash) + getId().hashCode(); 1380 if (hasProduct()) { 1381 hash = (37 * hash) + PRODUCT_FIELD_NUMBER; 1382 hash = (53 * hash) + getProduct().hashCode(); 1383 } 1384 hash = (37 * hash) + MATCHING_VARIANT_COUNT_FIELD_NUMBER; 1385 hash = (53 * hash) + getMatchingVariantCount(); 1386 if (!internalGetMatchingVariantFields().getMap().isEmpty()) { 1387 hash = (37 * hash) + MATCHING_VARIANT_FIELDS_FIELD_NUMBER; 1388 hash = (53 * hash) + internalGetMatchingVariantFields().hashCode(); 1389 } 1390 if (!internalGetVariantRollupValues().getMap().isEmpty()) { 1391 hash = (37 * hash) + VARIANT_ROLLUP_VALUES_FIELD_NUMBER; 1392 hash = (53 * hash) + internalGetVariantRollupValues().hashCode(); 1393 } 1394 if (getPersonalLabelsCount() > 0) { 1395 hash = (37 * hash) + PERSONAL_LABELS_FIELD_NUMBER; 1396 hash = (53 * hash) + getPersonalLabelsList().hashCode(); 1397 } 1398 hash = (29 * hash) + getUnknownFields().hashCode(); 1399 memoizedHashCode = hash; 1400 return hash; 1401 } 1402 parseFrom( java.nio.ByteBuffer data)1403 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1404 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 1405 return PARSER.parseFrom(data); 1406 } 1407 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1408 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1409 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1410 throws com.google.protobuf.InvalidProtocolBufferException { 1411 return PARSER.parseFrom(data, extensionRegistry); 1412 } 1413 parseFrom( com.google.protobuf.ByteString data)1414 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1415 com.google.protobuf.ByteString data) 1416 throws com.google.protobuf.InvalidProtocolBufferException { 1417 return PARSER.parseFrom(data); 1418 } 1419 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1420 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1421 com.google.protobuf.ByteString data, 1422 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1423 throws com.google.protobuf.InvalidProtocolBufferException { 1424 return PARSER.parseFrom(data, extensionRegistry); 1425 } 1426 parseFrom(byte[] data)1427 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom(byte[] data) 1428 throws com.google.protobuf.InvalidProtocolBufferException { 1429 return PARSER.parseFrom(data); 1430 } 1431 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1432 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1433 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1434 throws com.google.protobuf.InvalidProtocolBufferException { 1435 return PARSER.parseFrom(data, extensionRegistry); 1436 } 1437 parseFrom( java.io.InputStream input)1438 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1439 java.io.InputStream input) throws java.io.IOException { 1440 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1441 } 1442 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1443 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1444 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1445 throws java.io.IOException { 1446 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1447 PARSER, input, extensionRegistry); 1448 } 1449 parseDelimitedFrom( java.io.InputStream input)1450 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseDelimitedFrom( 1451 java.io.InputStream input) throws java.io.IOException { 1452 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1453 } 1454 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1455 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseDelimitedFrom( 1456 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1457 throws java.io.IOException { 1458 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1459 PARSER, input, extensionRegistry); 1460 } 1461 parseFrom( com.google.protobuf.CodedInputStream input)1462 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1463 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1464 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1465 } 1466 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1467 public static com.google.cloud.retail.v2.SearchResponse.SearchResult parseFrom( 1468 com.google.protobuf.CodedInputStream input, 1469 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1470 throws java.io.IOException { 1471 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1472 PARSER, input, extensionRegistry); 1473 } 1474 1475 @java.lang.Override newBuilderForType()1476 public Builder newBuilderForType() { 1477 return newBuilder(); 1478 } 1479 newBuilder()1480 public static Builder newBuilder() { 1481 return DEFAULT_INSTANCE.toBuilder(); 1482 } 1483 newBuilder( com.google.cloud.retail.v2.SearchResponse.SearchResult prototype)1484 public static Builder newBuilder( 1485 com.google.cloud.retail.v2.SearchResponse.SearchResult prototype) { 1486 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1487 } 1488 1489 @java.lang.Override toBuilder()1490 public Builder toBuilder() { 1491 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1492 } 1493 1494 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1495 protected Builder newBuilderForType( 1496 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1497 Builder builder = new Builder(parent); 1498 return builder; 1499 } 1500 /** 1501 * 1502 * 1503 * <pre> 1504 * Represents the search results. 1505 * </pre> 1506 * 1507 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.SearchResult} 1508 */ 1509 public static final class Builder 1510 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1511 implements 1512 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.SearchResult) 1513 com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder { getDescriptor()1514 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1515 return com.google.cloud.retail.v2.SearchServiceProto 1516 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; 1517 } 1518 1519 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)1520 protected com.google.protobuf.MapField internalGetMapField(int number) { 1521 switch (number) { 1522 case 4: 1523 return internalGetMatchingVariantFields(); 1524 case 5: 1525 return internalGetVariantRollupValues(); 1526 default: 1527 throw new RuntimeException("Invalid map field number: " + number); 1528 } 1529 } 1530 1531 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)1532 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 1533 switch (number) { 1534 case 4: 1535 return internalGetMutableMatchingVariantFields(); 1536 case 5: 1537 return internalGetMutableVariantRollupValues(); 1538 default: 1539 throw new RuntimeException("Invalid map field number: " + number); 1540 } 1541 } 1542 1543 @java.lang.Override 1544 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1545 internalGetFieldAccessorTable() { 1546 return com.google.cloud.retail.v2.SearchServiceProto 1547 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_fieldAccessorTable 1548 .ensureFieldAccessorsInitialized( 1549 com.google.cloud.retail.v2.SearchResponse.SearchResult.class, 1550 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder.class); 1551 } 1552 1553 // Construct using com.google.cloud.retail.v2.SearchResponse.SearchResult.newBuilder() Builder()1554 private Builder() {} 1555 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1556 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1557 super(parent); 1558 } 1559 1560 @java.lang.Override clear()1561 public Builder clear() { 1562 super.clear(); 1563 bitField0_ = 0; 1564 id_ = ""; 1565 product_ = null; 1566 if (productBuilder_ != null) { 1567 productBuilder_.dispose(); 1568 productBuilder_ = null; 1569 } 1570 matchingVariantCount_ = 0; 1571 internalGetMutableMatchingVariantFields().clear(); 1572 internalGetMutableVariantRollupValues().clear(); 1573 personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1574 bitField0_ = (bitField0_ & ~0x00000020); 1575 return this; 1576 } 1577 1578 @java.lang.Override getDescriptorForType()1579 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1580 return com.google.cloud.retail.v2.SearchServiceProto 1581 .internal_static_google_cloud_retail_v2_SearchResponse_SearchResult_descriptor; 1582 } 1583 1584 @java.lang.Override getDefaultInstanceForType()1585 public com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstanceForType() { 1586 return com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance(); 1587 } 1588 1589 @java.lang.Override build()1590 public com.google.cloud.retail.v2.SearchResponse.SearchResult build() { 1591 com.google.cloud.retail.v2.SearchResponse.SearchResult result = buildPartial(); 1592 if (!result.isInitialized()) { 1593 throw newUninitializedMessageException(result); 1594 } 1595 return result; 1596 } 1597 1598 @java.lang.Override buildPartial()1599 public com.google.cloud.retail.v2.SearchResponse.SearchResult buildPartial() { 1600 com.google.cloud.retail.v2.SearchResponse.SearchResult result = 1601 new com.google.cloud.retail.v2.SearchResponse.SearchResult(this); 1602 buildPartialRepeatedFields(result); 1603 if (bitField0_ != 0) { 1604 buildPartial0(result); 1605 } 1606 onBuilt(); 1607 return result; 1608 } 1609 buildPartialRepeatedFields( com.google.cloud.retail.v2.SearchResponse.SearchResult result)1610 private void buildPartialRepeatedFields( 1611 com.google.cloud.retail.v2.SearchResponse.SearchResult result) { 1612 if (((bitField0_ & 0x00000020) != 0)) { 1613 personalLabels_ = personalLabels_.getUnmodifiableView(); 1614 bitField0_ = (bitField0_ & ~0x00000020); 1615 } 1616 result.personalLabels_ = personalLabels_; 1617 } 1618 buildPartial0(com.google.cloud.retail.v2.SearchResponse.SearchResult result)1619 private void buildPartial0(com.google.cloud.retail.v2.SearchResponse.SearchResult result) { 1620 int from_bitField0_ = bitField0_; 1621 if (((from_bitField0_ & 0x00000001) != 0)) { 1622 result.id_ = id_; 1623 } 1624 if (((from_bitField0_ & 0x00000002) != 0)) { 1625 result.product_ = productBuilder_ == null ? product_ : productBuilder_.build(); 1626 } 1627 if (((from_bitField0_ & 0x00000004) != 0)) { 1628 result.matchingVariantCount_ = matchingVariantCount_; 1629 } 1630 if (((from_bitField0_ & 0x00000008) != 0)) { 1631 result.matchingVariantFields_ = internalGetMatchingVariantFields(); 1632 result.matchingVariantFields_.makeImmutable(); 1633 } 1634 if (((from_bitField0_ & 0x00000010) != 0)) { 1635 result.variantRollupValues_ = internalGetVariantRollupValues(); 1636 result.variantRollupValues_.makeImmutable(); 1637 } 1638 } 1639 1640 @java.lang.Override clone()1641 public Builder clone() { 1642 return super.clone(); 1643 } 1644 1645 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1646 public Builder setField( 1647 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1648 return super.setField(field, value); 1649 } 1650 1651 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1652 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1653 return super.clearField(field); 1654 } 1655 1656 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1657 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1658 return super.clearOneof(oneof); 1659 } 1660 1661 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1662 public Builder setRepeatedField( 1663 com.google.protobuf.Descriptors.FieldDescriptor field, 1664 int index, 1665 java.lang.Object value) { 1666 return super.setRepeatedField(field, index, value); 1667 } 1668 1669 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1670 public Builder addRepeatedField( 1671 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1672 return super.addRepeatedField(field, value); 1673 } 1674 1675 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1676 public Builder mergeFrom(com.google.protobuf.Message other) { 1677 if (other instanceof com.google.cloud.retail.v2.SearchResponse.SearchResult) { 1678 return mergeFrom((com.google.cloud.retail.v2.SearchResponse.SearchResult) other); 1679 } else { 1680 super.mergeFrom(other); 1681 return this; 1682 } 1683 } 1684 mergeFrom(com.google.cloud.retail.v2.SearchResponse.SearchResult other)1685 public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.SearchResult other) { 1686 if (other == com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()) 1687 return this; 1688 if (!other.getId().isEmpty()) { 1689 id_ = other.id_; 1690 bitField0_ |= 0x00000001; 1691 onChanged(); 1692 } 1693 if (other.hasProduct()) { 1694 mergeProduct(other.getProduct()); 1695 } 1696 if (other.getMatchingVariantCount() != 0) { 1697 setMatchingVariantCount(other.getMatchingVariantCount()); 1698 } 1699 internalGetMutableMatchingVariantFields() 1700 .mergeFrom(other.internalGetMatchingVariantFields()); 1701 bitField0_ |= 0x00000008; 1702 internalGetMutableVariantRollupValues().mergeFrom(other.internalGetVariantRollupValues()); 1703 bitField0_ |= 0x00000010; 1704 if (!other.personalLabels_.isEmpty()) { 1705 if (personalLabels_.isEmpty()) { 1706 personalLabels_ = other.personalLabels_; 1707 bitField0_ = (bitField0_ & ~0x00000020); 1708 } else { 1709 ensurePersonalLabelsIsMutable(); 1710 personalLabels_.addAll(other.personalLabels_); 1711 } 1712 onChanged(); 1713 } 1714 this.mergeUnknownFields(other.getUnknownFields()); 1715 onChanged(); 1716 return this; 1717 } 1718 1719 @java.lang.Override isInitialized()1720 public final boolean isInitialized() { 1721 return true; 1722 } 1723 1724 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1725 public Builder mergeFrom( 1726 com.google.protobuf.CodedInputStream input, 1727 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1728 throws java.io.IOException { 1729 if (extensionRegistry == null) { 1730 throw new java.lang.NullPointerException(); 1731 } 1732 try { 1733 boolean done = false; 1734 while (!done) { 1735 int tag = input.readTag(); 1736 switch (tag) { 1737 case 0: 1738 done = true; 1739 break; 1740 case 10: 1741 { 1742 id_ = input.readStringRequireUtf8(); 1743 bitField0_ |= 0x00000001; 1744 break; 1745 } // case 10 1746 case 18: 1747 { 1748 input.readMessage(getProductFieldBuilder().getBuilder(), extensionRegistry); 1749 bitField0_ |= 0x00000002; 1750 break; 1751 } // case 18 1752 case 24: 1753 { 1754 matchingVariantCount_ = input.readInt32(); 1755 bitField0_ |= 0x00000004; 1756 break; 1757 } // case 24 1758 case 34: 1759 { 1760 com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.FieldMask> 1761 matchingVariantFields__ = 1762 input.readMessage( 1763 MatchingVariantFieldsDefaultEntryHolder.defaultEntry 1764 .getParserForType(), 1765 extensionRegistry); 1766 internalGetMutableMatchingVariantFields() 1767 .getMutableMap() 1768 .put(matchingVariantFields__.getKey(), matchingVariantFields__.getValue()); 1769 bitField0_ |= 0x00000008; 1770 break; 1771 } // case 34 1772 case 42: 1773 { 1774 com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> 1775 variantRollupValues__ = 1776 input.readMessage( 1777 VariantRollupValuesDefaultEntryHolder.defaultEntry.getParserForType(), 1778 extensionRegistry); 1779 internalGetMutableVariantRollupValues() 1780 .getMutableMap() 1781 .put(variantRollupValues__.getKey(), variantRollupValues__.getValue()); 1782 bitField0_ |= 0x00000010; 1783 break; 1784 } // case 42 1785 case 58: 1786 { 1787 java.lang.String s = input.readStringRequireUtf8(); 1788 ensurePersonalLabelsIsMutable(); 1789 personalLabels_.add(s); 1790 break; 1791 } // case 58 1792 default: 1793 { 1794 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1795 done = true; // was an endgroup tag 1796 } 1797 break; 1798 } // default: 1799 } // switch (tag) 1800 } // while (!done) 1801 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1802 throw e.unwrapIOException(); 1803 } finally { 1804 onChanged(); 1805 } // finally 1806 return this; 1807 } 1808 1809 private int bitField0_; 1810 1811 private java.lang.Object id_ = ""; 1812 /** 1813 * 1814 * 1815 * <pre> 1816 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 1817 * [Product][google.cloud.retail.v2.Product]. 1818 * </pre> 1819 * 1820 * <code>string id = 1;</code> 1821 * 1822 * @return The id. 1823 */ getId()1824 public java.lang.String getId() { 1825 java.lang.Object ref = id_; 1826 if (!(ref instanceof java.lang.String)) { 1827 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1828 java.lang.String s = bs.toStringUtf8(); 1829 id_ = s; 1830 return s; 1831 } else { 1832 return (java.lang.String) ref; 1833 } 1834 } 1835 /** 1836 * 1837 * 1838 * <pre> 1839 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 1840 * [Product][google.cloud.retail.v2.Product]. 1841 * </pre> 1842 * 1843 * <code>string id = 1;</code> 1844 * 1845 * @return The bytes for id. 1846 */ getIdBytes()1847 public com.google.protobuf.ByteString getIdBytes() { 1848 java.lang.Object ref = id_; 1849 if (ref instanceof String) { 1850 com.google.protobuf.ByteString b = 1851 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1852 id_ = b; 1853 return b; 1854 } else { 1855 return (com.google.protobuf.ByteString) ref; 1856 } 1857 } 1858 /** 1859 * 1860 * 1861 * <pre> 1862 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 1863 * [Product][google.cloud.retail.v2.Product]. 1864 * </pre> 1865 * 1866 * <code>string id = 1;</code> 1867 * 1868 * @param value The id to set. 1869 * @return This builder for chaining. 1870 */ setId(java.lang.String value)1871 public Builder setId(java.lang.String value) { 1872 if (value == null) { 1873 throw new NullPointerException(); 1874 } 1875 id_ = value; 1876 bitField0_ |= 0x00000001; 1877 onChanged(); 1878 return this; 1879 } 1880 /** 1881 * 1882 * 1883 * <pre> 1884 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 1885 * [Product][google.cloud.retail.v2.Product]. 1886 * </pre> 1887 * 1888 * <code>string id = 1;</code> 1889 * 1890 * @return This builder for chaining. 1891 */ clearId()1892 public Builder clearId() { 1893 id_ = getDefaultInstance().getId(); 1894 bitField0_ = (bitField0_ & ~0x00000001); 1895 onChanged(); 1896 return this; 1897 } 1898 /** 1899 * 1900 * 1901 * <pre> 1902 * [Product.id][google.cloud.retail.v2.Product.id] of the searched 1903 * [Product][google.cloud.retail.v2.Product]. 1904 * </pre> 1905 * 1906 * <code>string id = 1;</code> 1907 * 1908 * @param value The bytes for id to set. 1909 * @return This builder for chaining. 1910 */ setIdBytes(com.google.protobuf.ByteString value)1911 public Builder setIdBytes(com.google.protobuf.ByteString value) { 1912 if (value == null) { 1913 throw new NullPointerException(); 1914 } 1915 checkByteStringIsUtf8(value); 1916 id_ = value; 1917 bitField0_ |= 0x00000001; 1918 onChanged(); 1919 return this; 1920 } 1921 1922 private com.google.cloud.retail.v2.Product product_; 1923 private com.google.protobuf.SingleFieldBuilderV3< 1924 com.google.cloud.retail.v2.Product, 1925 com.google.cloud.retail.v2.Product.Builder, 1926 com.google.cloud.retail.v2.ProductOrBuilder> 1927 productBuilder_; 1928 /** 1929 * 1930 * 1931 * <pre> 1932 * The product data snippet in the search response. Only 1933 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 1934 * populated. 1935 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 1936 * product variants that match the search query. If there are multiple 1937 * product variants matching the query, top 5 most relevant product variants 1938 * are returned and ordered by relevancy. 1939 * If relevancy can be deternmined, use 1940 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 1941 * to look up matched product variants fields. If relevancy cannot be 1942 * determined, e.g. when searching "shoe" all products in a shoe product can 1943 * be a match, 5 product variants are returned but order is meaningless. 1944 * </pre> 1945 * 1946 * <code>.google.cloud.retail.v2.Product product = 2;</code> 1947 * 1948 * @return Whether the product field is set. 1949 */ hasProduct()1950 public boolean hasProduct() { 1951 return ((bitField0_ & 0x00000002) != 0); 1952 } 1953 /** 1954 * 1955 * 1956 * <pre> 1957 * The product data snippet in the search response. Only 1958 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 1959 * populated. 1960 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 1961 * product variants that match the search query. If there are multiple 1962 * product variants matching the query, top 5 most relevant product variants 1963 * are returned and ordered by relevancy. 1964 * If relevancy can be deternmined, use 1965 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 1966 * to look up matched product variants fields. If relevancy cannot be 1967 * determined, e.g. when searching "shoe" all products in a shoe product can 1968 * be a match, 5 product variants are returned but order is meaningless. 1969 * </pre> 1970 * 1971 * <code>.google.cloud.retail.v2.Product product = 2;</code> 1972 * 1973 * @return The product. 1974 */ getProduct()1975 public com.google.cloud.retail.v2.Product getProduct() { 1976 if (productBuilder_ == null) { 1977 return product_ == null 1978 ? com.google.cloud.retail.v2.Product.getDefaultInstance() 1979 : product_; 1980 } else { 1981 return productBuilder_.getMessage(); 1982 } 1983 } 1984 /** 1985 * 1986 * 1987 * <pre> 1988 * The product data snippet in the search response. Only 1989 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 1990 * populated. 1991 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 1992 * product variants that match the search query. If there are multiple 1993 * product variants matching the query, top 5 most relevant product variants 1994 * are returned and ordered by relevancy. 1995 * If relevancy can be deternmined, use 1996 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 1997 * to look up matched product variants fields. If relevancy cannot be 1998 * determined, e.g. when searching "shoe" all products in a shoe product can 1999 * be a match, 5 product variants are returned but order is meaningless. 2000 * </pre> 2001 * 2002 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2003 */ setProduct(com.google.cloud.retail.v2.Product value)2004 public Builder setProduct(com.google.cloud.retail.v2.Product value) { 2005 if (productBuilder_ == null) { 2006 if (value == null) { 2007 throw new NullPointerException(); 2008 } 2009 product_ = value; 2010 } else { 2011 productBuilder_.setMessage(value); 2012 } 2013 bitField0_ |= 0x00000002; 2014 onChanged(); 2015 return this; 2016 } 2017 /** 2018 * 2019 * 2020 * <pre> 2021 * The product data snippet in the search response. Only 2022 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2023 * populated. 2024 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2025 * product variants that match the search query. If there are multiple 2026 * product variants matching the query, top 5 most relevant product variants 2027 * are returned and ordered by relevancy. 2028 * If relevancy can be deternmined, use 2029 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2030 * to look up matched product variants fields. If relevancy cannot be 2031 * determined, e.g. when searching "shoe" all products in a shoe product can 2032 * be a match, 5 product variants are returned but order is meaningless. 2033 * </pre> 2034 * 2035 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2036 */ setProduct(com.google.cloud.retail.v2.Product.Builder builderForValue)2037 public Builder setProduct(com.google.cloud.retail.v2.Product.Builder builderForValue) { 2038 if (productBuilder_ == null) { 2039 product_ = builderForValue.build(); 2040 } else { 2041 productBuilder_.setMessage(builderForValue.build()); 2042 } 2043 bitField0_ |= 0x00000002; 2044 onChanged(); 2045 return this; 2046 } 2047 /** 2048 * 2049 * 2050 * <pre> 2051 * The product data snippet in the search response. Only 2052 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2053 * populated. 2054 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2055 * product variants that match the search query. If there are multiple 2056 * product variants matching the query, top 5 most relevant product variants 2057 * are returned and ordered by relevancy. 2058 * If relevancy can be deternmined, use 2059 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2060 * to look up matched product variants fields. If relevancy cannot be 2061 * determined, e.g. when searching "shoe" all products in a shoe product can 2062 * be a match, 5 product variants are returned but order is meaningless. 2063 * </pre> 2064 * 2065 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2066 */ mergeProduct(com.google.cloud.retail.v2.Product value)2067 public Builder mergeProduct(com.google.cloud.retail.v2.Product value) { 2068 if (productBuilder_ == null) { 2069 if (((bitField0_ & 0x00000002) != 0) 2070 && product_ != null 2071 && product_ != com.google.cloud.retail.v2.Product.getDefaultInstance()) { 2072 getProductBuilder().mergeFrom(value); 2073 } else { 2074 product_ = value; 2075 } 2076 } else { 2077 productBuilder_.mergeFrom(value); 2078 } 2079 bitField0_ |= 0x00000002; 2080 onChanged(); 2081 return this; 2082 } 2083 /** 2084 * 2085 * 2086 * <pre> 2087 * The product data snippet in the search response. Only 2088 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2089 * populated. 2090 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2091 * product variants that match the search query. If there are multiple 2092 * product variants matching the query, top 5 most relevant product variants 2093 * are returned and ordered by relevancy. 2094 * If relevancy can be deternmined, use 2095 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2096 * to look up matched product variants fields. If relevancy cannot be 2097 * determined, e.g. when searching "shoe" all products in a shoe product can 2098 * be a match, 5 product variants are returned but order is meaningless. 2099 * </pre> 2100 * 2101 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2102 */ clearProduct()2103 public Builder clearProduct() { 2104 bitField0_ = (bitField0_ & ~0x00000002); 2105 product_ = null; 2106 if (productBuilder_ != null) { 2107 productBuilder_.dispose(); 2108 productBuilder_ = null; 2109 } 2110 onChanged(); 2111 return this; 2112 } 2113 /** 2114 * 2115 * 2116 * <pre> 2117 * The product data snippet in the search response. Only 2118 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2119 * populated. 2120 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2121 * product variants that match the search query. If there are multiple 2122 * product variants matching the query, top 5 most relevant product variants 2123 * are returned and ordered by relevancy. 2124 * If relevancy can be deternmined, use 2125 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2126 * to look up matched product variants fields. If relevancy cannot be 2127 * determined, e.g. when searching "shoe" all products in a shoe product can 2128 * be a match, 5 product variants are returned but order is meaningless. 2129 * </pre> 2130 * 2131 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2132 */ getProductBuilder()2133 public com.google.cloud.retail.v2.Product.Builder getProductBuilder() { 2134 bitField0_ |= 0x00000002; 2135 onChanged(); 2136 return getProductFieldBuilder().getBuilder(); 2137 } 2138 /** 2139 * 2140 * 2141 * <pre> 2142 * The product data snippet in the search response. Only 2143 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2144 * populated. 2145 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2146 * product variants that match the search query. If there are multiple 2147 * product variants matching the query, top 5 most relevant product variants 2148 * are returned and ordered by relevancy. 2149 * If relevancy can be deternmined, use 2150 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2151 * to look up matched product variants fields. If relevancy cannot be 2152 * determined, e.g. when searching "shoe" all products in a shoe product can 2153 * be a match, 5 product variants are returned but order is meaningless. 2154 * </pre> 2155 * 2156 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2157 */ getProductOrBuilder()2158 public com.google.cloud.retail.v2.ProductOrBuilder getProductOrBuilder() { 2159 if (productBuilder_ != null) { 2160 return productBuilder_.getMessageOrBuilder(); 2161 } else { 2162 return product_ == null 2163 ? com.google.cloud.retail.v2.Product.getDefaultInstance() 2164 : product_; 2165 } 2166 } 2167 /** 2168 * 2169 * 2170 * <pre> 2171 * The product data snippet in the search response. Only 2172 * [Product.name][google.cloud.retail.v2.Product.name] is guaranteed to be 2173 * populated. 2174 * [Product.variants][google.cloud.retail.v2.Product.variants] contains the 2175 * product variants that match the search query. If there are multiple 2176 * product variants matching the query, top 5 most relevant product variants 2177 * are returned and ordered by relevancy. 2178 * If relevancy can be deternmined, use 2179 * [matching_variant_fields][google.cloud.retail.v2.SearchResponse.SearchResult.matching_variant_fields] 2180 * to look up matched product variants fields. If relevancy cannot be 2181 * determined, e.g. when searching "shoe" all products in a shoe product can 2182 * be a match, 5 product variants are returned but order is meaningless. 2183 * </pre> 2184 * 2185 * <code>.google.cloud.retail.v2.Product product = 2;</code> 2186 */ 2187 private com.google.protobuf.SingleFieldBuilderV3< 2188 com.google.cloud.retail.v2.Product, 2189 com.google.cloud.retail.v2.Product.Builder, 2190 com.google.cloud.retail.v2.ProductOrBuilder> getProductFieldBuilder()2191 getProductFieldBuilder() { 2192 if (productBuilder_ == null) { 2193 productBuilder_ = 2194 new com.google.protobuf.SingleFieldBuilderV3< 2195 com.google.cloud.retail.v2.Product, 2196 com.google.cloud.retail.v2.Product.Builder, 2197 com.google.cloud.retail.v2.ProductOrBuilder>( 2198 getProduct(), getParentForChildren(), isClean()); 2199 product_ = null; 2200 } 2201 return productBuilder_; 2202 } 2203 2204 private int matchingVariantCount_; 2205 /** 2206 * 2207 * 2208 * <pre> 2209 * The count of matched 2210 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2211 * [Product][google.cloud.retail.v2.Product]s. 2212 * </pre> 2213 * 2214 * <code>int32 matching_variant_count = 3;</code> 2215 * 2216 * @return The matchingVariantCount. 2217 */ 2218 @java.lang.Override getMatchingVariantCount()2219 public int getMatchingVariantCount() { 2220 return matchingVariantCount_; 2221 } 2222 /** 2223 * 2224 * 2225 * <pre> 2226 * The count of matched 2227 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2228 * [Product][google.cloud.retail.v2.Product]s. 2229 * </pre> 2230 * 2231 * <code>int32 matching_variant_count = 3;</code> 2232 * 2233 * @param value The matchingVariantCount to set. 2234 * @return This builder for chaining. 2235 */ setMatchingVariantCount(int value)2236 public Builder setMatchingVariantCount(int value) { 2237 2238 matchingVariantCount_ = value; 2239 bitField0_ |= 0x00000004; 2240 onChanged(); 2241 return this; 2242 } 2243 /** 2244 * 2245 * 2246 * <pre> 2247 * The count of matched 2248 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2249 * [Product][google.cloud.retail.v2.Product]s. 2250 * </pre> 2251 * 2252 * <code>int32 matching_variant_count = 3;</code> 2253 * 2254 * @return This builder for chaining. 2255 */ clearMatchingVariantCount()2256 public Builder clearMatchingVariantCount() { 2257 bitField0_ = (bitField0_ & ~0x00000004); 2258 matchingVariantCount_ = 0; 2259 onChanged(); 2260 return this; 2261 } 2262 2263 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.FieldMask> 2264 matchingVariantFields_; 2265 2266 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.FieldMask> internalGetMatchingVariantFields()2267 internalGetMatchingVariantFields() { 2268 if (matchingVariantFields_ == null) { 2269 return com.google.protobuf.MapField.emptyMapField( 2270 MatchingVariantFieldsDefaultEntryHolder.defaultEntry); 2271 } 2272 return matchingVariantFields_; 2273 } 2274 2275 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.FieldMask> internalGetMutableMatchingVariantFields()2276 internalGetMutableMatchingVariantFields() { 2277 if (matchingVariantFields_ == null) { 2278 matchingVariantFields_ = 2279 com.google.protobuf.MapField.newMapField( 2280 MatchingVariantFieldsDefaultEntryHolder.defaultEntry); 2281 } 2282 if (!matchingVariantFields_.isMutable()) { 2283 matchingVariantFields_ = matchingVariantFields_.copy(); 2284 } 2285 bitField0_ |= 0x00000008; 2286 onChanged(); 2287 return matchingVariantFields_; 2288 } 2289 getMatchingVariantFieldsCount()2290 public int getMatchingVariantFieldsCount() { 2291 return internalGetMatchingVariantFields().getMap().size(); 2292 } 2293 /** 2294 * 2295 * 2296 * <pre> 2297 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2298 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2299 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2300 * matched. The key is the 2301 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2302 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2303 * matched attributes cannot be determined, this map will be empty. 2304 * For example, a key "sku1" with field mask 2305 * "products.color_info" indicates there is a match between 2306 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2307 * </pre> 2308 * 2309 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2310 */ 2311 @java.lang.Override containsMatchingVariantFields(java.lang.String key)2312 public boolean containsMatchingVariantFields(java.lang.String key) { 2313 if (key == null) { 2314 throw new NullPointerException("map key"); 2315 } 2316 return internalGetMatchingVariantFields().getMap().containsKey(key); 2317 } 2318 /** Use {@link #getMatchingVariantFieldsMap()} instead. */ 2319 @java.lang.Override 2320 @java.lang.Deprecated 2321 public java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFields()2322 getMatchingVariantFields() { 2323 return getMatchingVariantFieldsMap(); 2324 } 2325 /** 2326 * 2327 * 2328 * <pre> 2329 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2330 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2331 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2332 * matched. The key is the 2333 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2334 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2335 * matched attributes cannot be determined, this map will be empty. 2336 * For example, a key "sku1" with field mask 2337 * "products.color_info" indicates there is a match between 2338 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2339 * </pre> 2340 * 2341 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2342 */ 2343 @java.lang.Override 2344 public java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMatchingVariantFieldsMap()2345 getMatchingVariantFieldsMap() { 2346 return internalGetMatchingVariantFields().getMap(); 2347 } 2348 /** 2349 * 2350 * 2351 * <pre> 2352 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2353 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2354 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2355 * matched. The key is the 2356 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2357 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2358 * matched attributes cannot be determined, this map will be empty. 2359 * For example, a key "sku1" with field mask 2360 * "products.color_info" indicates there is a match between 2361 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2362 * </pre> 2363 * 2364 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2365 */ 2366 @java.lang.Override getMatchingVariantFieldsOrDefault( java.lang.String key, com.google.protobuf.FieldMask defaultValue)2367 public /* nullable */ com.google.protobuf.FieldMask getMatchingVariantFieldsOrDefault( 2368 java.lang.String key, 2369 /* nullable */ 2370 com.google.protobuf.FieldMask defaultValue) { 2371 if (key == null) { 2372 throw new NullPointerException("map key"); 2373 } 2374 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> map = 2375 internalGetMatchingVariantFields().getMap(); 2376 return map.containsKey(key) ? map.get(key) : defaultValue; 2377 } 2378 /** 2379 * 2380 * 2381 * <pre> 2382 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2383 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2384 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2385 * matched. The key is the 2386 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2387 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2388 * matched attributes cannot be determined, this map will be empty. 2389 * For example, a key "sku1" with field mask 2390 * "products.color_info" indicates there is a match between 2391 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2392 * </pre> 2393 * 2394 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2395 */ 2396 @java.lang.Override getMatchingVariantFieldsOrThrow(java.lang.String key)2397 public com.google.protobuf.FieldMask getMatchingVariantFieldsOrThrow(java.lang.String key) { 2398 if (key == null) { 2399 throw new NullPointerException("map key"); 2400 } 2401 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> map = 2402 internalGetMatchingVariantFields().getMap(); 2403 if (!map.containsKey(key)) { 2404 throw new java.lang.IllegalArgumentException(); 2405 } 2406 return map.get(key); 2407 } 2408 clearMatchingVariantFields()2409 public Builder clearMatchingVariantFields() { 2410 bitField0_ = (bitField0_ & ~0x00000008); 2411 internalGetMutableMatchingVariantFields().getMutableMap().clear(); 2412 return this; 2413 } 2414 /** 2415 * 2416 * 2417 * <pre> 2418 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2419 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2420 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2421 * matched. The key is the 2422 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2423 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2424 * matched attributes cannot be determined, this map will be empty. 2425 * For example, a key "sku1" with field mask 2426 * "products.color_info" indicates there is a match between 2427 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2428 * </pre> 2429 * 2430 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2431 */ removeMatchingVariantFields(java.lang.String key)2432 public Builder removeMatchingVariantFields(java.lang.String key) { 2433 if (key == null) { 2434 throw new NullPointerException("map key"); 2435 } 2436 internalGetMutableMatchingVariantFields().getMutableMap().remove(key); 2437 return this; 2438 } 2439 /** Use alternate mutation accessors instead. */ 2440 @java.lang.Deprecated 2441 public java.util.Map<java.lang.String, com.google.protobuf.FieldMask> getMutableMatchingVariantFields()2442 getMutableMatchingVariantFields() { 2443 bitField0_ |= 0x00000008; 2444 return internalGetMutableMatchingVariantFields().getMutableMap(); 2445 } 2446 /** 2447 * 2448 * 2449 * <pre> 2450 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2451 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2452 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2453 * matched. The key is the 2454 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2455 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2456 * matched attributes cannot be determined, this map will be empty. 2457 * For example, a key "sku1" with field mask 2458 * "products.color_info" indicates there is a match between 2459 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2460 * </pre> 2461 * 2462 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2463 */ putMatchingVariantFields( java.lang.String key, com.google.protobuf.FieldMask value)2464 public Builder putMatchingVariantFields( 2465 java.lang.String key, com.google.protobuf.FieldMask value) { 2466 if (key == null) { 2467 throw new NullPointerException("map key"); 2468 } 2469 if (value == null) { 2470 throw new NullPointerException("map value"); 2471 } 2472 internalGetMutableMatchingVariantFields().getMutableMap().put(key, value); 2473 bitField0_ |= 0x00000008; 2474 return this; 2475 } 2476 /** 2477 * 2478 * 2479 * <pre> 2480 * If a [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2481 * [Product][google.cloud.retail.v2.Product] matches the search query, this 2482 * map indicates which [Product][google.cloud.retail.v2.Product] fields are 2483 * matched. The key is the 2484 * [Product.name][google.cloud.retail.v2.Product.name], the value is a field 2485 * mask of the matched [Product][google.cloud.retail.v2.Product] fields. If 2486 * matched attributes cannot be determined, this map will be empty. 2487 * For example, a key "sku1" with field mask 2488 * "products.color_info" indicates there is a match between 2489 * "sku1" [ColorInfo][google.cloud.retail.v2.ColorInfo] and the query. 2490 * </pre> 2491 * 2492 * <code>map<string, .google.protobuf.FieldMask> matching_variant_fields = 4;</code> 2493 */ putAllMatchingVariantFields( java.util.Map<java.lang.String, com.google.protobuf.FieldMask> values)2494 public Builder putAllMatchingVariantFields( 2495 java.util.Map<java.lang.String, com.google.protobuf.FieldMask> values) { 2496 internalGetMutableMatchingVariantFields().getMutableMap().putAll(values); 2497 bitField0_ |= 0x00000008; 2498 return this; 2499 } 2500 2501 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> 2502 variantRollupValues_; 2503 2504 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> internalGetVariantRollupValues()2505 internalGetVariantRollupValues() { 2506 if (variantRollupValues_ == null) { 2507 return com.google.protobuf.MapField.emptyMapField( 2508 VariantRollupValuesDefaultEntryHolder.defaultEntry); 2509 } 2510 return variantRollupValues_; 2511 } 2512 2513 private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> internalGetMutableVariantRollupValues()2514 internalGetMutableVariantRollupValues() { 2515 if (variantRollupValues_ == null) { 2516 variantRollupValues_ = 2517 com.google.protobuf.MapField.newMapField( 2518 VariantRollupValuesDefaultEntryHolder.defaultEntry); 2519 } 2520 if (!variantRollupValues_.isMutable()) { 2521 variantRollupValues_ = variantRollupValues_.copy(); 2522 } 2523 bitField0_ |= 0x00000010; 2524 onChanged(); 2525 return variantRollupValues_; 2526 } 2527 getVariantRollupValuesCount()2528 public int getVariantRollupValuesCount() { 2529 return internalGetVariantRollupValues().getMap().size(); 2530 } 2531 /** 2532 * 2533 * 2534 * <pre> 2535 * The rollup matching 2536 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2537 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2538 * the 2539 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2540 * The values are the merged and de-duplicated 2541 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2542 * rollup values are respect filter. For example, when filtering by 2543 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2544 * returned. 2545 * For textual and numerical attributes, the rollup values is a list of 2546 * string or double values with type 2547 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2548 * there are two variants with colors "red" and "blue", the rollup values 2549 * are 2550 * { key: "colorFamilies" 2551 * value { 2552 * list_value { 2553 * values { string_value: "red" } 2554 * values { string_value: "blue" } 2555 * } 2556 * } 2557 * } 2558 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2559 * values is a double value with type 2560 * [google.protobuf.Value][google.protobuf.Value]. For example, 2561 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2562 * are 10 variants in this product are available in the store "store1". 2563 * </pre> 2564 * 2565 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2566 */ 2567 @java.lang.Override containsVariantRollupValues(java.lang.String key)2568 public boolean containsVariantRollupValues(java.lang.String key) { 2569 if (key == null) { 2570 throw new NullPointerException("map key"); 2571 } 2572 return internalGetVariantRollupValues().getMap().containsKey(key); 2573 } 2574 /** Use {@link #getVariantRollupValuesMap()} instead. */ 2575 @java.lang.Override 2576 @java.lang.Deprecated getVariantRollupValues()2577 public java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValues() { 2578 return getVariantRollupValuesMap(); 2579 } 2580 /** 2581 * 2582 * 2583 * <pre> 2584 * The rollup matching 2585 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2586 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2587 * the 2588 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2589 * The values are the merged and de-duplicated 2590 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2591 * rollup values are respect filter. For example, when filtering by 2592 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2593 * returned. 2594 * For textual and numerical attributes, the rollup values is a list of 2595 * string or double values with type 2596 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2597 * there are two variants with colors "red" and "blue", the rollup values 2598 * are 2599 * { key: "colorFamilies" 2600 * value { 2601 * list_value { 2602 * values { string_value: "red" } 2603 * values { string_value: "blue" } 2604 * } 2605 * } 2606 * } 2607 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2608 * values is a double value with type 2609 * [google.protobuf.Value][google.protobuf.Value]. For example, 2610 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2611 * are 10 variants in this product are available in the store "store1". 2612 * </pre> 2613 * 2614 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2615 */ 2616 @java.lang.Override 2617 public java.util.Map<java.lang.String, com.google.protobuf.Value> getVariantRollupValuesMap()2618 getVariantRollupValuesMap() { 2619 return internalGetVariantRollupValues().getMap(); 2620 } 2621 /** 2622 * 2623 * 2624 * <pre> 2625 * The rollup matching 2626 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2627 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2628 * the 2629 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2630 * The values are the merged and de-duplicated 2631 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2632 * rollup values are respect filter. For example, when filtering by 2633 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2634 * returned. 2635 * For textual and numerical attributes, the rollup values is a list of 2636 * string or double values with type 2637 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2638 * there are two variants with colors "red" and "blue", the rollup values 2639 * are 2640 * { key: "colorFamilies" 2641 * value { 2642 * list_value { 2643 * values { string_value: "red" } 2644 * values { string_value: "blue" } 2645 * } 2646 * } 2647 * } 2648 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2649 * values is a double value with type 2650 * [google.protobuf.Value][google.protobuf.Value]. For example, 2651 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2652 * are 10 variants in this product are available in the store "store1". 2653 * </pre> 2654 * 2655 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2656 */ 2657 @java.lang.Override getVariantRollupValuesOrDefault( java.lang.String key, com.google.protobuf.Value defaultValue)2658 public /* nullable */ com.google.protobuf.Value getVariantRollupValuesOrDefault( 2659 java.lang.String key, 2660 /* nullable */ 2661 com.google.protobuf.Value defaultValue) { 2662 if (key == null) { 2663 throw new NullPointerException("map key"); 2664 } 2665 java.util.Map<java.lang.String, com.google.protobuf.Value> map = 2666 internalGetVariantRollupValues().getMap(); 2667 return map.containsKey(key) ? map.get(key) : defaultValue; 2668 } 2669 /** 2670 * 2671 * 2672 * <pre> 2673 * The rollup matching 2674 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2675 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2676 * the 2677 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2678 * The values are the merged and de-duplicated 2679 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2680 * rollup values are respect filter. For example, when filtering by 2681 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2682 * returned. 2683 * For textual and numerical attributes, the rollup values is a list of 2684 * string or double values with type 2685 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2686 * there are two variants with colors "red" and "blue", the rollup values 2687 * are 2688 * { key: "colorFamilies" 2689 * value { 2690 * list_value { 2691 * values { string_value: "red" } 2692 * values { string_value: "blue" } 2693 * } 2694 * } 2695 * } 2696 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2697 * values is a double value with type 2698 * [google.protobuf.Value][google.protobuf.Value]. For example, 2699 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2700 * are 10 variants in this product are available in the store "store1". 2701 * </pre> 2702 * 2703 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2704 */ 2705 @java.lang.Override getVariantRollupValuesOrThrow(java.lang.String key)2706 public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key) { 2707 if (key == null) { 2708 throw new NullPointerException("map key"); 2709 } 2710 java.util.Map<java.lang.String, com.google.protobuf.Value> map = 2711 internalGetVariantRollupValues().getMap(); 2712 if (!map.containsKey(key)) { 2713 throw new java.lang.IllegalArgumentException(); 2714 } 2715 return map.get(key); 2716 } 2717 clearVariantRollupValues()2718 public Builder clearVariantRollupValues() { 2719 bitField0_ = (bitField0_ & ~0x00000010); 2720 internalGetMutableVariantRollupValues().getMutableMap().clear(); 2721 return this; 2722 } 2723 /** 2724 * 2725 * 2726 * <pre> 2727 * The rollup matching 2728 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2729 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2730 * the 2731 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2732 * The values are the merged and de-duplicated 2733 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2734 * rollup values are respect filter. For example, when filtering by 2735 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2736 * returned. 2737 * For textual and numerical attributes, the rollup values is a list of 2738 * string or double values with type 2739 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2740 * there are two variants with colors "red" and "blue", the rollup values 2741 * are 2742 * { key: "colorFamilies" 2743 * value { 2744 * list_value { 2745 * values { string_value: "red" } 2746 * values { string_value: "blue" } 2747 * } 2748 * } 2749 * } 2750 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2751 * values is a double value with type 2752 * [google.protobuf.Value][google.protobuf.Value]. For example, 2753 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2754 * are 10 variants in this product are available in the store "store1". 2755 * </pre> 2756 * 2757 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2758 */ removeVariantRollupValues(java.lang.String key)2759 public Builder removeVariantRollupValues(java.lang.String key) { 2760 if (key == null) { 2761 throw new NullPointerException("map key"); 2762 } 2763 internalGetMutableVariantRollupValues().getMutableMap().remove(key); 2764 return this; 2765 } 2766 /** Use alternate mutation accessors instead. */ 2767 @java.lang.Deprecated 2768 public java.util.Map<java.lang.String, com.google.protobuf.Value> getMutableVariantRollupValues()2769 getMutableVariantRollupValues() { 2770 bitField0_ |= 0x00000010; 2771 return internalGetMutableVariantRollupValues().getMutableMap(); 2772 } 2773 /** 2774 * 2775 * 2776 * <pre> 2777 * The rollup matching 2778 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2779 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2780 * the 2781 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2782 * The values are the merged and de-duplicated 2783 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2784 * rollup values are respect filter. For example, when filtering by 2785 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2786 * returned. 2787 * For textual and numerical attributes, the rollup values is a list of 2788 * string or double values with type 2789 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2790 * there are two variants with colors "red" and "blue", the rollup values 2791 * are 2792 * { key: "colorFamilies" 2793 * value { 2794 * list_value { 2795 * values { string_value: "red" } 2796 * values { string_value: "blue" } 2797 * } 2798 * } 2799 * } 2800 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2801 * values is a double value with type 2802 * [google.protobuf.Value][google.protobuf.Value]. For example, 2803 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2804 * are 10 variants in this product are available in the store "store1". 2805 * </pre> 2806 * 2807 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2808 */ putVariantRollupValues(java.lang.String key, com.google.protobuf.Value value)2809 public Builder putVariantRollupValues(java.lang.String key, com.google.protobuf.Value value) { 2810 if (key == null) { 2811 throw new NullPointerException("map key"); 2812 } 2813 if (value == null) { 2814 throw new NullPointerException("map value"); 2815 } 2816 internalGetMutableVariantRollupValues().getMutableMap().put(key, value); 2817 bitField0_ |= 0x00000010; 2818 return this; 2819 } 2820 /** 2821 * 2822 * 2823 * <pre> 2824 * The rollup matching 2825 * [variant][google.cloud.retail.v2.Product.Type.VARIANT] 2826 * [Product][google.cloud.retail.v2.Product] attributes. The key is one of 2827 * the 2828 * [SearchRequest.variant_rollup_keys][google.cloud.retail.v2.SearchRequest.variant_rollup_keys]. 2829 * The values are the merged and de-duplicated 2830 * [Product][google.cloud.retail.v2.Product] attributes. Notice that the 2831 * rollup values are respect filter. For example, when filtering by 2832 * "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is 2833 * returned. 2834 * For textual and numerical attributes, the rollup values is a list of 2835 * string or double values with type 2836 * [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if 2837 * there are two variants with colors "red" and "blue", the rollup values 2838 * are 2839 * { key: "colorFamilies" 2840 * value { 2841 * list_value { 2842 * values { string_value: "red" } 2843 * values { string_value: "blue" } 2844 * } 2845 * } 2846 * } 2847 * For [FulfillmentInfo][google.cloud.retail.v2.FulfillmentInfo], the rollup 2848 * values is a double value with type 2849 * [google.protobuf.Value][google.protobuf.Value]. For example, 2850 * `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there 2851 * are 10 variants in this product are available in the store "store1". 2852 * </pre> 2853 * 2854 * <code>map<string, .google.protobuf.Value> variant_rollup_values = 5;</code> 2855 */ putAllVariantRollupValues( java.util.Map<java.lang.String, com.google.protobuf.Value> values)2856 public Builder putAllVariantRollupValues( 2857 java.util.Map<java.lang.String, com.google.protobuf.Value> values) { 2858 internalGetMutableVariantRollupValues().getMutableMap().putAll(values); 2859 bitField0_ |= 0x00000010; 2860 return this; 2861 } 2862 2863 private com.google.protobuf.LazyStringList personalLabels_ = 2864 com.google.protobuf.LazyStringArrayList.EMPTY; 2865 ensurePersonalLabelsIsMutable()2866 private void ensurePersonalLabelsIsMutable() { 2867 if (!((bitField0_ & 0x00000020) != 0)) { 2868 personalLabels_ = new com.google.protobuf.LazyStringArrayList(personalLabels_); 2869 bitField0_ |= 0x00000020; 2870 } 2871 } 2872 /** 2873 * 2874 * 2875 * <pre> 2876 * Specifies previous events related to this product for this user based on 2877 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 2878 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 2879 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 2880 * This is set only when 2881 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 2882 * is 2883 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 2884 * Possible values: 2885 * * `purchased`: Indicates that this product has been purchased before. 2886 * </pre> 2887 * 2888 * <code>repeated string personal_labels = 7;</code> 2889 * 2890 * @return A list containing the personalLabels. 2891 */ getPersonalLabelsList()2892 public com.google.protobuf.ProtocolStringList getPersonalLabelsList() { 2893 return personalLabels_.getUnmodifiableView(); 2894 } 2895 /** 2896 * 2897 * 2898 * <pre> 2899 * Specifies previous events related to this product for this user based on 2900 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 2901 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 2902 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 2903 * This is set only when 2904 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 2905 * is 2906 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 2907 * Possible values: 2908 * * `purchased`: Indicates that this product has been purchased before. 2909 * </pre> 2910 * 2911 * <code>repeated string personal_labels = 7;</code> 2912 * 2913 * @return The count of personalLabels. 2914 */ getPersonalLabelsCount()2915 public int getPersonalLabelsCount() { 2916 return personalLabels_.size(); 2917 } 2918 /** 2919 * 2920 * 2921 * <pre> 2922 * Specifies previous events related to this product for this user based on 2923 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 2924 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 2925 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 2926 * This is set only when 2927 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 2928 * is 2929 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 2930 * Possible values: 2931 * * `purchased`: Indicates that this product has been purchased before. 2932 * </pre> 2933 * 2934 * <code>repeated string personal_labels = 7;</code> 2935 * 2936 * @param index The index of the element to return. 2937 * @return The personalLabels at the given index. 2938 */ getPersonalLabels(int index)2939 public java.lang.String getPersonalLabels(int index) { 2940 return personalLabels_.get(index); 2941 } 2942 /** 2943 * 2944 * 2945 * <pre> 2946 * Specifies previous events related to this product for this user based on 2947 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 2948 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 2949 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 2950 * This is set only when 2951 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 2952 * is 2953 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 2954 * Possible values: 2955 * * `purchased`: Indicates that this product has been purchased before. 2956 * </pre> 2957 * 2958 * <code>repeated string personal_labels = 7;</code> 2959 * 2960 * @param index The index of the value to return. 2961 * @return The bytes of the personalLabels at the given index. 2962 */ getPersonalLabelsBytes(int index)2963 public com.google.protobuf.ByteString getPersonalLabelsBytes(int index) { 2964 return personalLabels_.getByteString(index); 2965 } 2966 /** 2967 * 2968 * 2969 * <pre> 2970 * Specifies previous events related to this product for this user based on 2971 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 2972 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 2973 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 2974 * This is set only when 2975 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 2976 * is 2977 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 2978 * Possible values: 2979 * * `purchased`: Indicates that this product has been purchased before. 2980 * </pre> 2981 * 2982 * <code>repeated string personal_labels = 7;</code> 2983 * 2984 * @param index The index to set the value at. 2985 * @param value The personalLabels to set. 2986 * @return This builder for chaining. 2987 */ setPersonalLabels(int index, java.lang.String value)2988 public Builder setPersonalLabels(int index, java.lang.String value) { 2989 if (value == null) { 2990 throw new NullPointerException(); 2991 } 2992 ensurePersonalLabelsIsMutable(); 2993 personalLabels_.set(index, value); 2994 onChanged(); 2995 return this; 2996 } 2997 /** 2998 * 2999 * 3000 * <pre> 3001 * Specifies previous events related to this product for this user based on 3002 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 3003 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 3004 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 3005 * This is set only when 3006 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 3007 * is 3008 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 3009 * Possible values: 3010 * * `purchased`: Indicates that this product has been purchased before. 3011 * </pre> 3012 * 3013 * <code>repeated string personal_labels = 7;</code> 3014 * 3015 * @param value The personalLabels to add. 3016 * @return This builder for chaining. 3017 */ addPersonalLabels(java.lang.String value)3018 public Builder addPersonalLabels(java.lang.String value) { 3019 if (value == null) { 3020 throw new NullPointerException(); 3021 } 3022 ensurePersonalLabelsIsMutable(); 3023 personalLabels_.add(value); 3024 onChanged(); 3025 return this; 3026 } 3027 /** 3028 * 3029 * 3030 * <pre> 3031 * Specifies previous events related to this product for this user based on 3032 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 3033 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 3034 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 3035 * This is set only when 3036 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 3037 * is 3038 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 3039 * Possible values: 3040 * * `purchased`: Indicates that this product has been purchased before. 3041 * </pre> 3042 * 3043 * <code>repeated string personal_labels = 7;</code> 3044 * 3045 * @param values The personalLabels to add. 3046 * @return This builder for chaining. 3047 */ addAllPersonalLabels(java.lang.Iterable<java.lang.String> values)3048 public Builder addAllPersonalLabels(java.lang.Iterable<java.lang.String> values) { 3049 ensurePersonalLabelsIsMutable(); 3050 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, personalLabels_); 3051 onChanged(); 3052 return this; 3053 } 3054 /** 3055 * 3056 * 3057 * <pre> 3058 * Specifies previous events related to this product for this user based on 3059 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 3060 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 3061 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 3062 * This is set only when 3063 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 3064 * is 3065 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 3066 * Possible values: 3067 * * `purchased`: Indicates that this product has been purchased before. 3068 * </pre> 3069 * 3070 * <code>repeated string personal_labels = 7;</code> 3071 * 3072 * @return This builder for chaining. 3073 */ clearPersonalLabels()3074 public Builder clearPersonalLabels() { 3075 personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; 3076 bitField0_ = (bitField0_ & ~0x00000020); 3077 onChanged(); 3078 return this; 3079 } 3080 /** 3081 * 3082 * 3083 * <pre> 3084 * Specifies previous events related to this product for this user based on 3085 * [UserEvent][google.cloud.retail.v2.UserEvent] with same 3086 * [SearchRequest.visitor_id][google.cloud.retail.v2.SearchRequest.visitor_id] 3087 * or [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id]. 3088 * This is set only when 3089 * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.mode] 3090 * is 3091 * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode.AUTO]. 3092 * Possible values: 3093 * * `purchased`: Indicates that this product has been purchased before. 3094 * </pre> 3095 * 3096 * <code>repeated string personal_labels = 7;</code> 3097 * 3098 * @param value The bytes of the personalLabels to add. 3099 * @return This builder for chaining. 3100 */ addPersonalLabelsBytes(com.google.protobuf.ByteString value)3101 public Builder addPersonalLabelsBytes(com.google.protobuf.ByteString value) { 3102 if (value == null) { 3103 throw new NullPointerException(); 3104 } 3105 checkByteStringIsUtf8(value); 3106 ensurePersonalLabelsIsMutable(); 3107 personalLabels_.add(value); 3108 onChanged(); 3109 return this; 3110 } 3111 3112 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3113 public final Builder setUnknownFields( 3114 final com.google.protobuf.UnknownFieldSet unknownFields) { 3115 return super.setUnknownFields(unknownFields); 3116 } 3117 3118 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3119 public final Builder mergeUnknownFields( 3120 final com.google.protobuf.UnknownFieldSet unknownFields) { 3121 return super.mergeUnknownFields(unknownFields); 3122 } 3123 3124 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.SearchResult) 3125 } 3126 3127 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.SearchResult) 3128 private static final com.google.cloud.retail.v2.SearchResponse.SearchResult DEFAULT_INSTANCE; 3129 3130 static { 3131 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.SearchResult(); 3132 } 3133 getDefaultInstance()3134 public static com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstance() { 3135 return DEFAULT_INSTANCE; 3136 } 3137 3138 private static final com.google.protobuf.Parser<SearchResult> PARSER = 3139 new com.google.protobuf.AbstractParser<SearchResult>() { 3140 @java.lang.Override 3141 public SearchResult parsePartialFrom( 3142 com.google.protobuf.CodedInputStream input, 3143 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3144 throws com.google.protobuf.InvalidProtocolBufferException { 3145 Builder builder = newBuilder(); 3146 try { 3147 builder.mergeFrom(input, extensionRegistry); 3148 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3149 throw e.setUnfinishedMessage(builder.buildPartial()); 3150 } catch (com.google.protobuf.UninitializedMessageException e) { 3151 throw e.asInvalidProtocolBufferException() 3152 .setUnfinishedMessage(builder.buildPartial()); 3153 } catch (java.io.IOException e) { 3154 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3155 .setUnfinishedMessage(builder.buildPartial()); 3156 } 3157 return builder.buildPartial(); 3158 } 3159 }; 3160 parser()3161 public static com.google.protobuf.Parser<SearchResult> parser() { 3162 return PARSER; 3163 } 3164 3165 @java.lang.Override getParserForType()3166 public com.google.protobuf.Parser<SearchResult> getParserForType() { 3167 return PARSER; 3168 } 3169 3170 @java.lang.Override getDefaultInstanceForType()3171 public com.google.cloud.retail.v2.SearchResponse.SearchResult getDefaultInstanceForType() { 3172 return DEFAULT_INSTANCE; 3173 } 3174 } 3175 3176 public interface FacetOrBuilder 3177 extends 3178 // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.Facet) 3179 com.google.protobuf.MessageOrBuilder { 3180 3181 /** 3182 * 3183 * 3184 * <pre> 3185 * The key for this facet. E.g., "colorFamilies" or "price" or 3186 * "attributes.attr1". 3187 * </pre> 3188 * 3189 * <code>string key = 1;</code> 3190 * 3191 * @return The key. 3192 */ getKey()3193 java.lang.String getKey(); 3194 /** 3195 * 3196 * 3197 * <pre> 3198 * The key for this facet. E.g., "colorFamilies" or "price" or 3199 * "attributes.attr1". 3200 * </pre> 3201 * 3202 * <code>string key = 1;</code> 3203 * 3204 * @return The bytes for key. 3205 */ getKeyBytes()3206 com.google.protobuf.ByteString getKeyBytes(); 3207 3208 /** 3209 * 3210 * 3211 * <pre> 3212 * The facet values for this field. 3213 * </pre> 3214 * 3215 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 3216 */ getValuesList()3217 java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> getValuesList(); 3218 /** 3219 * 3220 * 3221 * <pre> 3222 * The facet values for this field. 3223 * </pre> 3224 * 3225 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 3226 */ getValues(int index)3227 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index); 3228 /** 3229 * 3230 * 3231 * <pre> 3232 * The facet values for this field. 3233 * </pre> 3234 * 3235 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 3236 */ getValuesCount()3237 int getValuesCount(); 3238 /** 3239 * 3240 * 3241 * <pre> 3242 * The facet values for this field. 3243 * </pre> 3244 * 3245 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 3246 */ 3247 java.util.List<? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> getValuesOrBuilderList()3248 getValuesOrBuilderList(); 3249 /** 3250 * 3251 * 3252 * <pre> 3253 * The facet values for this field. 3254 * </pre> 3255 * 3256 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 3257 */ getValuesOrBuilder( int index)3258 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( 3259 int index); 3260 3261 /** 3262 * 3263 * 3264 * <pre> 3265 * Whether the facet is dynamically generated. 3266 * </pre> 3267 * 3268 * <code>bool dynamic_facet = 3;</code> 3269 * 3270 * @return The dynamicFacet. 3271 */ getDynamicFacet()3272 boolean getDynamicFacet(); 3273 } 3274 /** 3275 * 3276 * 3277 * <pre> 3278 * A facet result. 3279 * </pre> 3280 * 3281 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet} 3282 */ 3283 public static final class Facet extends com.google.protobuf.GeneratedMessageV3 3284 implements 3285 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.Facet) 3286 FacetOrBuilder { 3287 private static final long serialVersionUID = 0L; 3288 // Use Facet.newBuilder() to construct. Facet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)3289 private Facet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 3290 super(builder); 3291 } 3292 Facet()3293 private Facet() { 3294 key_ = ""; 3295 values_ = java.util.Collections.emptyList(); 3296 } 3297 3298 @java.lang.Override 3299 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)3300 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 3301 return new Facet(); 3302 } 3303 3304 @java.lang.Override getUnknownFields()3305 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 3306 return this.unknownFields; 3307 } 3308 getDescriptor()3309 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 3310 return com.google.cloud.retail.v2.SearchServiceProto 3311 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; 3312 } 3313 3314 @java.lang.Override 3315 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()3316 internalGetFieldAccessorTable() { 3317 return com.google.cloud.retail.v2.SearchServiceProto 3318 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_fieldAccessorTable 3319 .ensureFieldAccessorsInitialized( 3320 com.google.cloud.retail.v2.SearchResponse.Facet.class, 3321 com.google.cloud.retail.v2.SearchResponse.Facet.Builder.class); 3322 } 3323 3324 public interface FacetValueOrBuilder 3325 extends 3326 // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) 3327 com.google.protobuf.MessageOrBuilder { 3328 3329 /** 3330 * 3331 * 3332 * <pre> 3333 * Text value of a facet, such as "Black" for facet "colorFamilies". 3334 * </pre> 3335 * 3336 * <code>string value = 1;</code> 3337 * 3338 * @return Whether the value field is set. 3339 */ hasValue()3340 boolean hasValue(); 3341 /** 3342 * 3343 * 3344 * <pre> 3345 * Text value of a facet, such as "Black" for facet "colorFamilies". 3346 * </pre> 3347 * 3348 * <code>string value = 1;</code> 3349 * 3350 * @return The value. 3351 */ getValue()3352 java.lang.String getValue(); 3353 /** 3354 * 3355 * 3356 * <pre> 3357 * Text value of a facet, such as "Black" for facet "colorFamilies". 3358 * </pre> 3359 * 3360 * <code>string value = 1;</code> 3361 * 3362 * @return The bytes for value. 3363 */ getValueBytes()3364 com.google.protobuf.ByteString getValueBytes(); 3365 3366 /** 3367 * 3368 * 3369 * <pre> 3370 * Interval value for a facet, such as [10, 20) for facet "price". 3371 * </pre> 3372 * 3373 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3374 * 3375 * @return Whether the interval field is set. 3376 */ hasInterval()3377 boolean hasInterval(); 3378 /** 3379 * 3380 * 3381 * <pre> 3382 * Interval value for a facet, such as [10, 20) for facet "price". 3383 * </pre> 3384 * 3385 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3386 * 3387 * @return The interval. 3388 */ getInterval()3389 com.google.cloud.retail.v2.Interval getInterval(); 3390 /** 3391 * 3392 * 3393 * <pre> 3394 * Interval value for a facet, such as [10, 20) for facet "price". 3395 * </pre> 3396 * 3397 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3398 */ getIntervalOrBuilder()3399 com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder(); 3400 3401 /** 3402 * 3403 * 3404 * <pre> 3405 * Number of items that have this facet value. 3406 * </pre> 3407 * 3408 * <code>int64 count = 3;</code> 3409 * 3410 * @return The count. 3411 */ getCount()3412 long getCount(); 3413 3414 /** 3415 * 3416 * 3417 * <pre> 3418 * The minimum value in the 3419 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 3420 * Only supported on numerical facets and returned if 3421 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 3422 * is true. 3423 * </pre> 3424 * 3425 * <code>double min_value = 5;</code> 3426 * 3427 * @return The minValue. 3428 */ getMinValue()3429 double getMinValue(); 3430 3431 /** 3432 * 3433 * 3434 * <pre> 3435 * The maximum value in the 3436 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 3437 * Only supported on numerical facets and returned if 3438 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 3439 * is true. 3440 * </pre> 3441 * 3442 * <code>double max_value = 6;</code> 3443 * 3444 * @return The maxValue. 3445 */ getMaxValue()3446 double getMaxValue(); 3447 3448 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.FacetValueCase getFacetValueCase()3449 getFacetValueCase(); 3450 } 3451 /** 3452 * 3453 * 3454 * <pre> 3455 * A facet value which contains value names and their count. 3456 * </pre> 3457 * 3458 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet.FacetValue} 3459 */ 3460 public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 3461 implements 3462 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) 3463 FacetValueOrBuilder { 3464 private static final long serialVersionUID = 0L; 3465 // Use FacetValue.newBuilder() to construct. FacetValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)3466 private FacetValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 3467 super(builder); 3468 } 3469 FacetValue()3470 private FacetValue() {} 3471 3472 @java.lang.Override 3473 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)3474 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 3475 return new FacetValue(); 3476 } 3477 3478 @java.lang.Override getUnknownFields()3479 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 3480 return this.unknownFields; 3481 } 3482 getDescriptor()3483 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 3484 return com.google.cloud.retail.v2.SearchServiceProto 3485 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; 3486 } 3487 3488 @java.lang.Override 3489 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()3490 internalGetFieldAccessorTable() { 3491 return com.google.cloud.retail.v2.SearchServiceProto 3492 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_fieldAccessorTable 3493 .ensureFieldAccessorsInitialized( 3494 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.class, 3495 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder.class); 3496 } 3497 3498 private int facetValueCase_ = 0; 3499 private java.lang.Object facetValue_; 3500 3501 public enum FacetValueCase 3502 implements 3503 com.google.protobuf.Internal.EnumLite, 3504 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 3505 VALUE(1), 3506 INTERVAL(2), 3507 FACETVALUE_NOT_SET(0); 3508 private final int value; 3509 FacetValueCase(int value)3510 private FacetValueCase(int value) { 3511 this.value = value; 3512 } 3513 /** 3514 * @param value The number of the enum to look for. 3515 * @return The enum associated with the given number. 3516 * @deprecated Use {@link #forNumber(int)} instead. 3517 */ 3518 @java.lang.Deprecated valueOf(int value)3519 public static FacetValueCase valueOf(int value) { 3520 return forNumber(value); 3521 } 3522 forNumber(int value)3523 public static FacetValueCase forNumber(int value) { 3524 switch (value) { 3525 case 1: 3526 return VALUE; 3527 case 2: 3528 return INTERVAL; 3529 case 0: 3530 return FACETVALUE_NOT_SET; 3531 default: 3532 return null; 3533 } 3534 } 3535 getNumber()3536 public int getNumber() { 3537 return this.value; 3538 } 3539 }; 3540 getFacetValueCase()3541 public FacetValueCase getFacetValueCase() { 3542 return FacetValueCase.forNumber(facetValueCase_); 3543 } 3544 3545 public static final int VALUE_FIELD_NUMBER = 1; 3546 /** 3547 * 3548 * 3549 * <pre> 3550 * Text value of a facet, such as "Black" for facet "colorFamilies". 3551 * </pre> 3552 * 3553 * <code>string value = 1;</code> 3554 * 3555 * @return Whether the value field is set. 3556 */ hasValue()3557 public boolean hasValue() { 3558 return facetValueCase_ == 1; 3559 } 3560 /** 3561 * 3562 * 3563 * <pre> 3564 * Text value of a facet, such as "Black" for facet "colorFamilies". 3565 * </pre> 3566 * 3567 * <code>string value = 1;</code> 3568 * 3569 * @return The value. 3570 */ getValue()3571 public java.lang.String getValue() { 3572 java.lang.Object ref = ""; 3573 if (facetValueCase_ == 1) { 3574 ref = facetValue_; 3575 } 3576 if (ref instanceof java.lang.String) { 3577 return (java.lang.String) ref; 3578 } else { 3579 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3580 java.lang.String s = bs.toStringUtf8(); 3581 if (facetValueCase_ == 1) { 3582 facetValue_ = s; 3583 } 3584 return s; 3585 } 3586 } 3587 /** 3588 * 3589 * 3590 * <pre> 3591 * Text value of a facet, such as "Black" for facet "colorFamilies". 3592 * </pre> 3593 * 3594 * <code>string value = 1;</code> 3595 * 3596 * @return The bytes for value. 3597 */ getValueBytes()3598 public com.google.protobuf.ByteString getValueBytes() { 3599 java.lang.Object ref = ""; 3600 if (facetValueCase_ == 1) { 3601 ref = facetValue_; 3602 } 3603 if (ref instanceof java.lang.String) { 3604 com.google.protobuf.ByteString b = 3605 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3606 if (facetValueCase_ == 1) { 3607 facetValue_ = b; 3608 } 3609 return b; 3610 } else { 3611 return (com.google.protobuf.ByteString) ref; 3612 } 3613 } 3614 3615 public static final int INTERVAL_FIELD_NUMBER = 2; 3616 /** 3617 * 3618 * 3619 * <pre> 3620 * Interval value for a facet, such as [10, 20) for facet "price". 3621 * </pre> 3622 * 3623 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3624 * 3625 * @return Whether the interval field is set. 3626 */ 3627 @java.lang.Override hasInterval()3628 public boolean hasInterval() { 3629 return facetValueCase_ == 2; 3630 } 3631 /** 3632 * 3633 * 3634 * <pre> 3635 * Interval value for a facet, such as [10, 20) for facet "price". 3636 * </pre> 3637 * 3638 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3639 * 3640 * @return The interval. 3641 */ 3642 @java.lang.Override getInterval()3643 public com.google.cloud.retail.v2.Interval getInterval() { 3644 if (facetValueCase_ == 2) { 3645 return (com.google.cloud.retail.v2.Interval) facetValue_; 3646 } 3647 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 3648 } 3649 /** 3650 * 3651 * 3652 * <pre> 3653 * Interval value for a facet, such as [10, 20) for facet "price". 3654 * </pre> 3655 * 3656 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 3657 */ 3658 @java.lang.Override getIntervalOrBuilder()3659 public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder() { 3660 if (facetValueCase_ == 2) { 3661 return (com.google.cloud.retail.v2.Interval) facetValue_; 3662 } 3663 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 3664 } 3665 3666 public static final int COUNT_FIELD_NUMBER = 3; 3667 private long count_ = 0L; 3668 /** 3669 * 3670 * 3671 * <pre> 3672 * Number of items that have this facet value. 3673 * </pre> 3674 * 3675 * <code>int64 count = 3;</code> 3676 * 3677 * @return The count. 3678 */ 3679 @java.lang.Override getCount()3680 public long getCount() { 3681 return count_; 3682 } 3683 3684 public static final int MIN_VALUE_FIELD_NUMBER = 5; 3685 private double minValue_ = 0D; 3686 /** 3687 * 3688 * 3689 * <pre> 3690 * The minimum value in the 3691 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 3692 * Only supported on numerical facets and returned if 3693 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 3694 * is true. 3695 * </pre> 3696 * 3697 * <code>double min_value = 5;</code> 3698 * 3699 * @return The minValue. 3700 */ 3701 @java.lang.Override getMinValue()3702 public double getMinValue() { 3703 return minValue_; 3704 } 3705 3706 public static final int MAX_VALUE_FIELD_NUMBER = 6; 3707 private double maxValue_ = 0D; 3708 /** 3709 * 3710 * 3711 * <pre> 3712 * The maximum value in the 3713 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 3714 * Only supported on numerical facets and returned if 3715 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 3716 * is true. 3717 * </pre> 3718 * 3719 * <code>double max_value = 6;</code> 3720 * 3721 * @return The maxValue. 3722 */ 3723 @java.lang.Override getMaxValue()3724 public double getMaxValue() { 3725 return maxValue_; 3726 } 3727 3728 private byte memoizedIsInitialized = -1; 3729 3730 @java.lang.Override isInitialized()3731 public final boolean isInitialized() { 3732 byte isInitialized = memoizedIsInitialized; 3733 if (isInitialized == 1) return true; 3734 if (isInitialized == 0) return false; 3735 3736 memoizedIsInitialized = 1; 3737 return true; 3738 } 3739 3740 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)3741 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 3742 if (facetValueCase_ == 1) { 3743 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetValue_); 3744 } 3745 if (facetValueCase_ == 2) { 3746 output.writeMessage(2, (com.google.cloud.retail.v2.Interval) facetValue_); 3747 } 3748 if (count_ != 0L) { 3749 output.writeInt64(3, count_); 3750 } 3751 if (java.lang.Double.doubleToRawLongBits(minValue_) != 0) { 3752 output.writeDouble(5, minValue_); 3753 } 3754 if (java.lang.Double.doubleToRawLongBits(maxValue_) != 0) { 3755 output.writeDouble(6, maxValue_); 3756 } 3757 getUnknownFields().writeTo(output); 3758 } 3759 3760 @java.lang.Override getSerializedSize()3761 public int getSerializedSize() { 3762 int size = memoizedSize; 3763 if (size != -1) return size; 3764 3765 size = 0; 3766 if (facetValueCase_ == 1) { 3767 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetValue_); 3768 } 3769 if (facetValueCase_ == 2) { 3770 size += 3771 com.google.protobuf.CodedOutputStream.computeMessageSize( 3772 2, (com.google.cloud.retail.v2.Interval) facetValue_); 3773 } 3774 if (count_ != 0L) { 3775 size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); 3776 } 3777 if (java.lang.Double.doubleToRawLongBits(minValue_) != 0) { 3778 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, minValue_); 3779 } 3780 if (java.lang.Double.doubleToRawLongBits(maxValue_) != 0) { 3781 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, maxValue_); 3782 } 3783 size += getUnknownFields().getSerializedSize(); 3784 memoizedSize = size; 3785 return size; 3786 } 3787 3788 @java.lang.Override equals(final java.lang.Object obj)3789 public boolean equals(final java.lang.Object obj) { 3790 if (obj == this) { 3791 return true; 3792 } 3793 if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue)) { 3794 return super.equals(obj); 3795 } 3796 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue other = 3797 (com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) obj; 3798 3799 if (getCount() != other.getCount()) return false; 3800 if (java.lang.Double.doubleToLongBits(getMinValue()) 3801 != java.lang.Double.doubleToLongBits(other.getMinValue())) return false; 3802 if (java.lang.Double.doubleToLongBits(getMaxValue()) 3803 != java.lang.Double.doubleToLongBits(other.getMaxValue())) return false; 3804 if (!getFacetValueCase().equals(other.getFacetValueCase())) return false; 3805 switch (facetValueCase_) { 3806 case 1: 3807 if (!getValue().equals(other.getValue())) return false; 3808 break; 3809 case 2: 3810 if (!getInterval().equals(other.getInterval())) return false; 3811 break; 3812 case 0: 3813 default: 3814 } 3815 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 3816 return true; 3817 } 3818 3819 @java.lang.Override hashCode()3820 public int hashCode() { 3821 if (memoizedHashCode != 0) { 3822 return memoizedHashCode; 3823 } 3824 int hash = 41; 3825 hash = (19 * hash) + getDescriptor().hashCode(); 3826 hash = (37 * hash) + COUNT_FIELD_NUMBER; 3827 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); 3828 hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; 3829 hash = 3830 (53 * hash) 3831 + com.google.protobuf.Internal.hashLong( 3832 java.lang.Double.doubleToLongBits(getMinValue())); 3833 hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; 3834 hash = 3835 (53 * hash) 3836 + com.google.protobuf.Internal.hashLong( 3837 java.lang.Double.doubleToLongBits(getMaxValue())); 3838 switch (facetValueCase_) { 3839 case 1: 3840 hash = (37 * hash) + VALUE_FIELD_NUMBER; 3841 hash = (53 * hash) + getValue().hashCode(); 3842 break; 3843 case 2: 3844 hash = (37 * hash) + INTERVAL_FIELD_NUMBER; 3845 hash = (53 * hash) + getInterval().hashCode(); 3846 break; 3847 case 0: 3848 default: 3849 } 3850 hash = (29 * hash) + getUnknownFields().hashCode(); 3851 memoizedHashCode = hash; 3852 return hash; 3853 } 3854 parseFrom( java.nio.ByteBuffer data)3855 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3856 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 3857 return PARSER.parseFrom(data); 3858 } 3859 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3860 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3861 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3862 throws com.google.protobuf.InvalidProtocolBufferException { 3863 return PARSER.parseFrom(data, extensionRegistry); 3864 } 3865 parseFrom( com.google.protobuf.ByteString data)3866 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3867 com.google.protobuf.ByteString data) 3868 throws com.google.protobuf.InvalidProtocolBufferException { 3869 return PARSER.parseFrom(data); 3870 } 3871 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3872 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3873 com.google.protobuf.ByteString data, 3874 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3875 throws com.google.protobuf.InvalidProtocolBufferException { 3876 return PARSER.parseFrom(data, extensionRegistry); 3877 } 3878 parseFrom( byte[] data)3879 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3880 byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { 3881 return PARSER.parseFrom(data); 3882 } 3883 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3884 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3885 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3886 throws com.google.protobuf.InvalidProtocolBufferException { 3887 return PARSER.parseFrom(data, extensionRegistry); 3888 } 3889 parseFrom( java.io.InputStream input)3890 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3891 java.io.InputStream input) throws java.io.IOException { 3892 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 3893 } 3894 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3895 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3896 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3897 throws java.io.IOException { 3898 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 3899 PARSER, input, extensionRegistry); 3900 } 3901 parseDelimitedFrom( java.io.InputStream input)3902 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseDelimitedFrom( 3903 java.io.InputStream input) throws java.io.IOException { 3904 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 3905 } 3906 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3907 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseDelimitedFrom( 3908 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3909 throws java.io.IOException { 3910 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 3911 PARSER, input, extensionRegistry); 3912 } 3913 parseFrom( com.google.protobuf.CodedInputStream input)3914 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3915 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 3916 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 3917 } 3918 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3919 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue parseFrom( 3920 com.google.protobuf.CodedInputStream input, 3921 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3922 throws java.io.IOException { 3923 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 3924 PARSER, input, extensionRegistry); 3925 } 3926 3927 @java.lang.Override newBuilderForType()3928 public Builder newBuilderForType() { 3929 return newBuilder(); 3930 } 3931 newBuilder()3932 public static Builder newBuilder() { 3933 return DEFAULT_INSTANCE.toBuilder(); 3934 } 3935 newBuilder( com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue prototype)3936 public static Builder newBuilder( 3937 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue prototype) { 3938 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 3939 } 3940 3941 @java.lang.Override toBuilder()3942 public Builder toBuilder() { 3943 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 3944 } 3945 3946 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)3947 protected Builder newBuilderForType( 3948 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 3949 Builder builder = new Builder(parent); 3950 return builder; 3951 } 3952 /** 3953 * 3954 * 3955 * <pre> 3956 * A facet value which contains value names and their count. 3957 * </pre> 3958 * 3959 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet.FacetValue} 3960 */ 3961 public static final class Builder 3962 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 3963 implements 3964 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) 3965 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder { getDescriptor()3966 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 3967 return com.google.cloud.retail.v2.SearchServiceProto 3968 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; 3969 } 3970 3971 @java.lang.Override 3972 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()3973 internalGetFieldAccessorTable() { 3974 return com.google.cloud.retail.v2.SearchServiceProto 3975 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_fieldAccessorTable 3976 .ensureFieldAccessorsInitialized( 3977 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.class, 3978 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder.class); 3979 } 3980 3981 // Construct using com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.newBuilder() Builder()3982 private Builder() {} 3983 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)3984 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 3985 super(parent); 3986 } 3987 3988 @java.lang.Override clear()3989 public Builder clear() { 3990 super.clear(); 3991 bitField0_ = 0; 3992 if (intervalBuilder_ != null) { 3993 intervalBuilder_.clear(); 3994 } 3995 count_ = 0L; 3996 minValue_ = 0D; 3997 maxValue_ = 0D; 3998 facetValueCase_ = 0; 3999 facetValue_ = null; 4000 return this; 4001 } 4002 4003 @java.lang.Override getDescriptorForType()4004 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 4005 return com.google.cloud.retail.v2.SearchServiceProto 4006 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_FacetValue_descriptor; 4007 } 4008 4009 @java.lang.Override 4010 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getDefaultInstanceForType()4011 getDefaultInstanceForType() { 4012 return com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance(); 4013 } 4014 4015 @java.lang.Override build()4016 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue build() { 4017 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result = buildPartial(); 4018 if (!result.isInitialized()) { 4019 throw newUninitializedMessageException(result); 4020 } 4021 return result; 4022 } 4023 4024 @java.lang.Override buildPartial()4025 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue buildPartial() { 4026 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result = 4027 new com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(this); 4028 if (bitField0_ != 0) { 4029 buildPartial0(result); 4030 } 4031 buildPartialOneofs(result); 4032 onBuilt(); 4033 return result; 4034 } 4035 buildPartial0( com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result)4036 private void buildPartial0( 4037 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result) { 4038 int from_bitField0_ = bitField0_; 4039 if (((from_bitField0_ & 0x00000004) != 0)) { 4040 result.count_ = count_; 4041 } 4042 if (((from_bitField0_ & 0x00000008) != 0)) { 4043 result.minValue_ = minValue_; 4044 } 4045 if (((from_bitField0_ & 0x00000010) != 0)) { 4046 result.maxValue_ = maxValue_; 4047 } 4048 } 4049 buildPartialOneofs( com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result)4050 private void buildPartialOneofs( 4051 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue result) { 4052 result.facetValueCase_ = facetValueCase_; 4053 result.facetValue_ = this.facetValue_; 4054 if (facetValueCase_ == 2 && intervalBuilder_ != null) { 4055 result.facetValue_ = intervalBuilder_.build(); 4056 } 4057 } 4058 4059 @java.lang.Override clone()4060 public Builder clone() { 4061 return super.clone(); 4062 } 4063 4064 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)4065 public Builder setField( 4066 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 4067 return super.setField(field, value); 4068 } 4069 4070 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)4071 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 4072 return super.clearField(field); 4073 } 4074 4075 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)4076 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 4077 return super.clearOneof(oneof); 4078 } 4079 4080 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)4081 public Builder setRepeatedField( 4082 com.google.protobuf.Descriptors.FieldDescriptor field, 4083 int index, 4084 java.lang.Object value) { 4085 return super.setRepeatedField(field, index, value); 4086 } 4087 4088 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)4089 public Builder addRepeatedField( 4090 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 4091 return super.addRepeatedField(field, value); 4092 } 4093 4094 @java.lang.Override mergeFrom(com.google.protobuf.Message other)4095 public Builder mergeFrom(com.google.protobuf.Message other) { 4096 if (other instanceof com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) { 4097 return mergeFrom((com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue) other); 4098 } else { 4099 super.mergeFrom(other); 4100 return this; 4101 } 4102 } 4103 mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue other)4104 public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue other) { 4105 if (other 4106 == com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()) 4107 return this; 4108 if (other.getCount() != 0L) { 4109 setCount(other.getCount()); 4110 } 4111 if (other.getMinValue() != 0D) { 4112 setMinValue(other.getMinValue()); 4113 } 4114 if (other.getMaxValue() != 0D) { 4115 setMaxValue(other.getMaxValue()); 4116 } 4117 switch (other.getFacetValueCase()) { 4118 case VALUE: 4119 { 4120 facetValueCase_ = 1; 4121 facetValue_ = other.facetValue_; 4122 onChanged(); 4123 break; 4124 } 4125 case INTERVAL: 4126 { 4127 mergeInterval(other.getInterval()); 4128 break; 4129 } 4130 case FACETVALUE_NOT_SET: 4131 { 4132 break; 4133 } 4134 } 4135 this.mergeUnknownFields(other.getUnknownFields()); 4136 onChanged(); 4137 return this; 4138 } 4139 4140 @java.lang.Override isInitialized()4141 public final boolean isInitialized() { 4142 return true; 4143 } 4144 4145 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)4146 public Builder mergeFrom( 4147 com.google.protobuf.CodedInputStream input, 4148 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 4149 throws java.io.IOException { 4150 if (extensionRegistry == null) { 4151 throw new java.lang.NullPointerException(); 4152 } 4153 try { 4154 boolean done = false; 4155 while (!done) { 4156 int tag = input.readTag(); 4157 switch (tag) { 4158 case 0: 4159 done = true; 4160 break; 4161 case 10: 4162 { 4163 java.lang.String s = input.readStringRequireUtf8(); 4164 facetValueCase_ = 1; 4165 facetValue_ = s; 4166 break; 4167 } // case 10 4168 case 18: 4169 { 4170 input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); 4171 facetValueCase_ = 2; 4172 break; 4173 } // case 18 4174 case 24: 4175 { 4176 count_ = input.readInt64(); 4177 bitField0_ |= 0x00000004; 4178 break; 4179 } // case 24 4180 case 41: 4181 { 4182 minValue_ = input.readDouble(); 4183 bitField0_ |= 0x00000008; 4184 break; 4185 } // case 41 4186 case 49: 4187 { 4188 maxValue_ = input.readDouble(); 4189 bitField0_ |= 0x00000010; 4190 break; 4191 } // case 49 4192 default: 4193 { 4194 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 4195 done = true; // was an endgroup tag 4196 } 4197 break; 4198 } // default: 4199 } // switch (tag) 4200 } // while (!done) 4201 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 4202 throw e.unwrapIOException(); 4203 } finally { 4204 onChanged(); 4205 } // finally 4206 return this; 4207 } 4208 4209 private int facetValueCase_ = 0; 4210 private java.lang.Object facetValue_; 4211 getFacetValueCase()4212 public FacetValueCase getFacetValueCase() { 4213 return FacetValueCase.forNumber(facetValueCase_); 4214 } 4215 clearFacetValue()4216 public Builder clearFacetValue() { 4217 facetValueCase_ = 0; 4218 facetValue_ = null; 4219 onChanged(); 4220 return this; 4221 } 4222 4223 private int bitField0_; 4224 4225 /** 4226 * 4227 * 4228 * <pre> 4229 * Text value of a facet, such as "Black" for facet "colorFamilies". 4230 * </pre> 4231 * 4232 * <code>string value = 1;</code> 4233 * 4234 * @return Whether the value field is set. 4235 */ 4236 @java.lang.Override hasValue()4237 public boolean hasValue() { 4238 return facetValueCase_ == 1; 4239 } 4240 /** 4241 * 4242 * 4243 * <pre> 4244 * Text value of a facet, such as "Black" for facet "colorFamilies". 4245 * </pre> 4246 * 4247 * <code>string value = 1;</code> 4248 * 4249 * @return The value. 4250 */ 4251 @java.lang.Override getValue()4252 public java.lang.String getValue() { 4253 java.lang.Object ref = ""; 4254 if (facetValueCase_ == 1) { 4255 ref = facetValue_; 4256 } 4257 if (!(ref instanceof java.lang.String)) { 4258 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 4259 java.lang.String s = bs.toStringUtf8(); 4260 if (facetValueCase_ == 1) { 4261 facetValue_ = s; 4262 } 4263 return s; 4264 } else { 4265 return (java.lang.String) ref; 4266 } 4267 } 4268 /** 4269 * 4270 * 4271 * <pre> 4272 * Text value of a facet, such as "Black" for facet "colorFamilies". 4273 * </pre> 4274 * 4275 * <code>string value = 1;</code> 4276 * 4277 * @return The bytes for value. 4278 */ 4279 @java.lang.Override getValueBytes()4280 public com.google.protobuf.ByteString getValueBytes() { 4281 java.lang.Object ref = ""; 4282 if (facetValueCase_ == 1) { 4283 ref = facetValue_; 4284 } 4285 if (ref instanceof String) { 4286 com.google.protobuf.ByteString b = 4287 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 4288 if (facetValueCase_ == 1) { 4289 facetValue_ = b; 4290 } 4291 return b; 4292 } else { 4293 return (com.google.protobuf.ByteString) ref; 4294 } 4295 } 4296 /** 4297 * 4298 * 4299 * <pre> 4300 * Text value of a facet, such as "Black" for facet "colorFamilies". 4301 * </pre> 4302 * 4303 * <code>string value = 1;</code> 4304 * 4305 * @param value The value to set. 4306 * @return This builder for chaining. 4307 */ setValue(java.lang.String value)4308 public Builder setValue(java.lang.String value) { 4309 if (value == null) { 4310 throw new NullPointerException(); 4311 } 4312 facetValueCase_ = 1; 4313 facetValue_ = value; 4314 onChanged(); 4315 return this; 4316 } 4317 /** 4318 * 4319 * 4320 * <pre> 4321 * Text value of a facet, such as "Black" for facet "colorFamilies". 4322 * </pre> 4323 * 4324 * <code>string value = 1;</code> 4325 * 4326 * @return This builder for chaining. 4327 */ clearValue()4328 public Builder clearValue() { 4329 if (facetValueCase_ == 1) { 4330 facetValueCase_ = 0; 4331 facetValue_ = null; 4332 onChanged(); 4333 } 4334 return this; 4335 } 4336 /** 4337 * 4338 * 4339 * <pre> 4340 * Text value of a facet, such as "Black" for facet "colorFamilies". 4341 * </pre> 4342 * 4343 * <code>string value = 1;</code> 4344 * 4345 * @param value The bytes for value to set. 4346 * @return This builder for chaining. 4347 */ setValueBytes(com.google.protobuf.ByteString value)4348 public Builder setValueBytes(com.google.protobuf.ByteString value) { 4349 if (value == null) { 4350 throw new NullPointerException(); 4351 } 4352 checkByteStringIsUtf8(value); 4353 facetValueCase_ = 1; 4354 facetValue_ = value; 4355 onChanged(); 4356 return this; 4357 } 4358 4359 private com.google.protobuf.SingleFieldBuilderV3< 4360 com.google.cloud.retail.v2.Interval, 4361 com.google.cloud.retail.v2.Interval.Builder, 4362 com.google.cloud.retail.v2.IntervalOrBuilder> 4363 intervalBuilder_; 4364 /** 4365 * 4366 * 4367 * <pre> 4368 * Interval value for a facet, such as [10, 20) for facet "price". 4369 * </pre> 4370 * 4371 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4372 * 4373 * @return Whether the interval field is set. 4374 */ 4375 @java.lang.Override hasInterval()4376 public boolean hasInterval() { 4377 return facetValueCase_ == 2; 4378 } 4379 /** 4380 * 4381 * 4382 * <pre> 4383 * Interval value for a facet, such as [10, 20) for facet "price". 4384 * </pre> 4385 * 4386 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4387 * 4388 * @return The interval. 4389 */ 4390 @java.lang.Override getInterval()4391 public com.google.cloud.retail.v2.Interval getInterval() { 4392 if (intervalBuilder_ == null) { 4393 if (facetValueCase_ == 2) { 4394 return (com.google.cloud.retail.v2.Interval) facetValue_; 4395 } 4396 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 4397 } else { 4398 if (facetValueCase_ == 2) { 4399 return intervalBuilder_.getMessage(); 4400 } 4401 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 4402 } 4403 } 4404 /** 4405 * 4406 * 4407 * <pre> 4408 * Interval value for a facet, such as [10, 20) for facet "price". 4409 * </pre> 4410 * 4411 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4412 */ setInterval(com.google.cloud.retail.v2.Interval value)4413 public Builder setInterval(com.google.cloud.retail.v2.Interval value) { 4414 if (intervalBuilder_ == null) { 4415 if (value == null) { 4416 throw new NullPointerException(); 4417 } 4418 facetValue_ = value; 4419 onChanged(); 4420 } else { 4421 intervalBuilder_.setMessage(value); 4422 } 4423 facetValueCase_ = 2; 4424 return this; 4425 } 4426 /** 4427 * 4428 * 4429 * <pre> 4430 * Interval value for a facet, such as [10, 20) for facet "price". 4431 * </pre> 4432 * 4433 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4434 */ setInterval(com.google.cloud.retail.v2.Interval.Builder builderForValue)4435 public Builder setInterval(com.google.cloud.retail.v2.Interval.Builder builderForValue) { 4436 if (intervalBuilder_ == null) { 4437 facetValue_ = builderForValue.build(); 4438 onChanged(); 4439 } else { 4440 intervalBuilder_.setMessage(builderForValue.build()); 4441 } 4442 facetValueCase_ = 2; 4443 return this; 4444 } 4445 /** 4446 * 4447 * 4448 * <pre> 4449 * Interval value for a facet, such as [10, 20) for facet "price". 4450 * </pre> 4451 * 4452 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4453 */ mergeInterval(com.google.cloud.retail.v2.Interval value)4454 public Builder mergeInterval(com.google.cloud.retail.v2.Interval value) { 4455 if (intervalBuilder_ == null) { 4456 if (facetValueCase_ == 2 4457 && facetValue_ != com.google.cloud.retail.v2.Interval.getDefaultInstance()) { 4458 facetValue_ = 4459 com.google.cloud.retail.v2.Interval.newBuilder( 4460 (com.google.cloud.retail.v2.Interval) facetValue_) 4461 .mergeFrom(value) 4462 .buildPartial(); 4463 } else { 4464 facetValue_ = value; 4465 } 4466 onChanged(); 4467 } else { 4468 if (facetValueCase_ == 2) { 4469 intervalBuilder_.mergeFrom(value); 4470 } else { 4471 intervalBuilder_.setMessage(value); 4472 } 4473 } 4474 facetValueCase_ = 2; 4475 return this; 4476 } 4477 /** 4478 * 4479 * 4480 * <pre> 4481 * Interval value for a facet, such as [10, 20) for facet "price". 4482 * </pre> 4483 * 4484 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4485 */ clearInterval()4486 public Builder clearInterval() { 4487 if (intervalBuilder_ == null) { 4488 if (facetValueCase_ == 2) { 4489 facetValueCase_ = 0; 4490 facetValue_ = null; 4491 onChanged(); 4492 } 4493 } else { 4494 if (facetValueCase_ == 2) { 4495 facetValueCase_ = 0; 4496 facetValue_ = null; 4497 } 4498 intervalBuilder_.clear(); 4499 } 4500 return this; 4501 } 4502 /** 4503 * 4504 * 4505 * <pre> 4506 * Interval value for a facet, such as [10, 20) for facet "price". 4507 * </pre> 4508 * 4509 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4510 */ getIntervalBuilder()4511 public com.google.cloud.retail.v2.Interval.Builder getIntervalBuilder() { 4512 return getIntervalFieldBuilder().getBuilder(); 4513 } 4514 /** 4515 * 4516 * 4517 * <pre> 4518 * Interval value for a facet, such as [10, 20) for facet "price". 4519 * </pre> 4520 * 4521 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4522 */ 4523 @java.lang.Override getIntervalOrBuilder()4524 public com.google.cloud.retail.v2.IntervalOrBuilder getIntervalOrBuilder() { 4525 if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { 4526 return intervalBuilder_.getMessageOrBuilder(); 4527 } else { 4528 if (facetValueCase_ == 2) { 4529 return (com.google.cloud.retail.v2.Interval) facetValue_; 4530 } 4531 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 4532 } 4533 } 4534 /** 4535 * 4536 * 4537 * <pre> 4538 * Interval value for a facet, such as [10, 20) for facet "price". 4539 * </pre> 4540 * 4541 * <code>.google.cloud.retail.v2.Interval interval = 2;</code> 4542 */ 4543 private com.google.protobuf.SingleFieldBuilderV3< 4544 com.google.cloud.retail.v2.Interval, 4545 com.google.cloud.retail.v2.Interval.Builder, 4546 com.google.cloud.retail.v2.IntervalOrBuilder> getIntervalFieldBuilder()4547 getIntervalFieldBuilder() { 4548 if (intervalBuilder_ == null) { 4549 if (!(facetValueCase_ == 2)) { 4550 facetValue_ = com.google.cloud.retail.v2.Interval.getDefaultInstance(); 4551 } 4552 intervalBuilder_ = 4553 new com.google.protobuf.SingleFieldBuilderV3< 4554 com.google.cloud.retail.v2.Interval, 4555 com.google.cloud.retail.v2.Interval.Builder, 4556 com.google.cloud.retail.v2.IntervalOrBuilder>( 4557 (com.google.cloud.retail.v2.Interval) facetValue_, 4558 getParentForChildren(), 4559 isClean()); 4560 facetValue_ = null; 4561 } 4562 facetValueCase_ = 2; 4563 onChanged(); 4564 return intervalBuilder_; 4565 } 4566 4567 private long count_; 4568 /** 4569 * 4570 * 4571 * <pre> 4572 * Number of items that have this facet value. 4573 * </pre> 4574 * 4575 * <code>int64 count = 3;</code> 4576 * 4577 * @return The count. 4578 */ 4579 @java.lang.Override getCount()4580 public long getCount() { 4581 return count_; 4582 } 4583 /** 4584 * 4585 * 4586 * <pre> 4587 * Number of items that have this facet value. 4588 * </pre> 4589 * 4590 * <code>int64 count = 3;</code> 4591 * 4592 * @param value The count to set. 4593 * @return This builder for chaining. 4594 */ setCount(long value)4595 public Builder setCount(long value) { 4596 4597 count_ = value; 4598 bitField0_ |= 0x00000004; 4599 onChanged(); 4600 return this; 4601 } 4602 /** 4603 * 4604 * 4605 * <pre> 4606 * Number of items that have this facet value. 4607 * </pre> 4608 * 4609 * <code>int64 count = 3;</code> 4610 * 4611 * @return This builder for chaining. 4612 */ clearCount()4613 public Builder clearCount() { 4614 bitField0_ = (bitField0_ & ~0x00000004); 4615 count_ = 0L; 4616 onChanged(); 4617 return this; 4618 } 4619 4620 private double minValue_; 4621 /** 4622 * 4623 * 4624 * <pre> 4625 * The minimum value in the 4626 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4627 * Only supported on numerical facets and returned if 4628 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4629 * is true. 4630 * </pre> 4631 * 4632 * <code>double min_value = 5;</code> 4633 * 4634 * @return The minValue. 4635 */ 4636 @java.lang.Override getMinValue()4637 public double getMinValue() { 4638 return minValue_; 4639 } 4640 /** 4641 * 4642 * 4643 * <pre> 4644 * The minimum value in the 4645 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4646 * Only supported on numerical facets and returned if 4647 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4648 * is true. 4649 * </pre> 4650 * 4651 * <code>double min_value = 5;</code> 4652 * 4653 * @param value The minValue to set. 4654 * @return This builder for chaining. 4655 */ setMinValue(double value)4656 public Builder setMinValue(double value) { 4657 4658 minValue_ = value; 4659 bitField0_ |= 0x00000008; 4660 onChanged(); 4661 return this; 4662 } 4663 /** 4664 * 4665 * 4666 * <pre> 4667 * The minimum value in the 4668 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4669 * Only supported on numerical facets and returned if 4670 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4671 * is true. 4672 * </pre> 4673 * 4674 * <code>double min_value = 5;</code> 4675 * 4676 * @return This builder for chaining. 4677 */ clearMinValue()4678 public Builder clearMinValue() { 4679 bitField0_ = (bitField0_ & ~0x00000008); 4680 minValue_ = 0D; 4681 onChanged(); 4682 return this; 4683 } 4684 4685 private double maxValue_; 4686 /** 4687 * 4688 * 4689 * <pre> 4690 * The maximum value in the 4691 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4692 * Only supported on numerical facets and returned if 4693 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4694 * is true. 4695 * </pre> 4696 * 4697 * <code>double max_value = 6;</code> 4698 * 4699 * @return The maxValue. 4700 */ 4701 @java.lang.Override getMaxValue()4702 public double getMaxValue() { 4703 return maxValue_; 4704 } 4705 /** 4706 * 4707 * 4708 * <pre> 4709 * The maximum value in the 4710 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4711 * Only supported on numerical facets and returned if 4712 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4713 * is true. 4714 * </pre> 4715 * 4716 * <code>double max_value = 6;</code> 4717 * 4718 * @param value The maxValue to set. 4719 * @return This builder for chaining. 4720 */ setMaxValue(double value)4721 public Builder setMaxValue(double value) { 4722 4723 maxValue_ = value; 4724 bitField0_ |= 0x00000010; 4725 onChanged(); 4726 return this; 4727 } 4728 /** 4729 * 4730 * 4731 * <pre> 4732 * The maximum value in the 4733 * [FacetValue.interval][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.interval]. 4734 * Only supported on numerical facets and returned if 4735 * [SearchRequest.FacetSpec.FacetKey.return_min_max][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.return_min_max] 4736 * is true. 4737 * </pre> 4738 * 4739 * <code>double max_value = 6;</code> 4740 * 4741 * @return This builder for chaining. 4742 */ clearMaxValue()4743 public Builder clearMaxValue() { 4744 bitField0_ = (bitField0_ & ~0x00000010); 4745 maxValue_ = 0D; 4746 onChanged(); 4747 return this; 4748 } 4749 4750 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4751 public final Builder setUnknownFields( 4752 final com.google.protobuf.UnknownFieldSet unknownFields) { 4753 return super.setUnknownFields(unknownFields); 4754 } 4755 4756 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4757 public final Builder mergeUnknownFields( 4758 final com.google.protobuf.UnknownFieldSet unknownFields) { 4759 return super.mergeUnknownFields(unknownFields); 4760 } 4761 4762 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) 4763 } 4764 4765 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.Facet.FacetValue) 4766 private static final com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue 4767 DEFAULT_INSTANCE; 4768 4769 static { 4770 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue(); 4771 } 4772 4773 public static com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getDefaultInstance()4774 getDefaultInstance() { 4775 return DEFAULT_INSTANCE; 4776 } 4777 4778 private static final com.google.protobuf.Parser<FacetValue> PARSER = 4779 new com.google.protobuf.AbstractParser<FacetValue>() { 4780 @java.lang.Override 4781 public FacetValue parsePartialFrom( 4782 com.google.protobuf.CodedInputStream input, 4783 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 4784 throws com.google.protobuf.InvalidProtocolBufferException { 4785 Builder builder = newBuilder(); 4786 try { 4787 builder.mergeFrom(input, extensionRegistry); 4788 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 4789 throw e.setUnfinishedMessage(builder.buildPartial()); 4790 } catch (com.google.protobuf.UninitializedMessageException e) { 4791 throw e.asInvalidProtocolBufferException() 4792 .setUnfinishedMessage(builder.buildPartial()); 4793 } catch (java.io.IOException e) { 4794 throw new com.google.protobuf.InvalidProtocolBufferException(e) 4795 .setUnfinishedMessage(builder.buildPartial()); 4796 } 4797 return builder.buildPartial(); 4798 } 4799 }; 4800 parser()4801 public static com.google.protobuf.Parser<FacetValue> parser() { 4802 return PARSER; 4803 } 4804 4805 @java.lang.Override getParserForType()4806 public com.google.protobuf.Parser<FacetValue> getParserForType() { 4807 return PARSER; 4808 } 4809 4810 @java.lang.Override 4811 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getDefaultInstanceForType()4812 getDefaultInstanceForType() { 4813 return DEFAULT_INSTANCE; 4814 } 4815 } 4816 4817 public static final int KEY_FIELD_NUMBER = 1; 4818 4819 @SuppressWarnings("serial") 4820 private volatile java.lang.Object key_ = ""; 4821 /** 4822 * 4823 * 4824 * <pre> 4825 * The key for this facet. E.g., "colorFamilies" or "price" or 4826 * "attributes.attr1". 4827 * </pre> 4828 * 4829 * <code>string key = 1;</code> 4830 * 4831 * @return The key. 4832 */ 4833 @java.lang.Override getKey()4834 public java.lang.String getKey() { 4835 java.lang.Object ref = key_; 4836 if (ref instanceof java.lang.String) { 4837 return (java.lang.String) ref; 4838 } else { 4839 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 4840 java.lang.String s = bs.toStringUtf8(); 4841 key_ = s; 4842 return s; 4843 } 4844 } 4845 /** 4846 * 4847 * 4848 * <pre> 4849 * The key for this facet. E.g., "colorFamilies" or "price" or 4850 * "attributes.attr1". 4851 * </pre> 4852 * 4853 * <code>string key = 1;</code> 4854 * 4855 * @return The bytes for key. 4856 */ 4857 @java.lang.Override getKeyBytes()4858 public com.google.protobuf.ByteString getKeyBytes() { 4859 java.lang.Object ref = key_; 4860 if (ref instanceof java.lang.String) { 4861 com.google.protobuf.ByteString b = 4862 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 4863 key_ = b; 4864 return b; 4865 } else { 4866 return (com.google.protobuf.ByteString) ref; 4867 } 4868 } 4869 4870 public static final int VALUES_FIELD_NUMBER = 2; 4871 4872 @SuppressWarnings("serial") 4873 private java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> values_; 4874 /** 4875 * 4876 * 4877 * <pre> 4878 * The facet values for this field. 4879 * </pre> 4880 * 4881 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 4882 */ 4883 @java.lang.Override 4884 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> getValuesList()4885 getValuesList() { 4886 return values_; 4887 } 4888 /** 4889 * 4890 * 4891 * <pre> 4892 * The facet values for this field. 4893 * </pre> 4894 * 4895 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 4896 */ 4897 @java.lang.Override 4898 public java.util.List< 4899 ? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> getValuesOrBuilderList()4900 getValuesOrBuilderList() { 4901 return values_; 4902 } 4903 /** 4904 * 4905 * 4906 * <pre> 4907 * The facet values for this field. 4908 * </pre> 4909 * 4910 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 4911 */ 4912 @java.lang.Override getValuesCount()4913 public int getValuesCount() { 4914 return values_.size(); 4915 } 4916 /** 4917 * 4918 * 4919 * <pre> 4920 * The facet values for this field. 4921 * </pre> 4922 * 4923 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 4924 */ 4925 @java.lang.Override getValues(int index)4926 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index) { 4927 return values_.get(index); 4928 } 4929 /** 4930 * 4931 * 4932 * <pre> 4933 * The facet values for this field. 4934 * </pre> 4935 * 4936 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 4937 */ 4938 @java.lang.Override getValuesOrBuilder( int index)4939 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( 4940 int index) { 4941 return values_.get(index); 4942 } 4943 4944 public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; 4945 private boolean dynamicFacet_ = false; 4946 /** 4947 * 4948 * 4949 * <pre> 4950 * Whether the facet is dynamically generated. 4951 * </pre> 4952 * 4953 * <code>bool dynamic_facet = 3;</code> 4954 * 4955 * @return The dynamicFacet. 4956 */ 4957 @java.lang.Override getDynamicFacet()4958 public boolean getDynamicFacet() { 4959 return dynamicFacet_; 4960 } 4961 4962 private byte memoizedIsInitialized = -1; 4963 4964 @java.lang.Override isInitialized()4965 public final boolean isInitialized() { 4966 byte isInitialized = memoizedIsInitialized; 4967 if (isInitialized == 1) return true; 4968 if (isInitialized == 0) return false; 4969 4970 memoizedIsInitialized = 1; 4971 return true; 4972 } 4973 4974 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)4975 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 4976 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { 4977 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); 4978 } 4979 for (int i = 0; i < values_.size(); i++) { 4980 output.writeMessage(2, values_.get(i)); 4981 } 4982 if (dynamicFacet_ != false) { 4983 output.writeBool(3, dynamicFacet_); 4984 } 4985 getUnknownFields().writeTo(output); 4986 } 4987 4988 @java.lang.Override getSerializedSize()4989 public int getSerializedSize() { 4990 int size = memoizedSize; 4991 if (size != -1) return size; 4992 4993 size = 0; 4994 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { 4995 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); 4996 } 4997 for (int i = 0; i < values_.size(); i++) { 4998 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); 4999 } 5000 if (dynamicFacet_ != false) { 5001 size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dynamicFacet_); 5002 } 5003 size += getUnknownFields().getSerializedSize(); 5004 memoizedSize = size; 5005 return size; 5006 } 5007 5008 @java.lang.Override equals(final java.lang.Object obj)5009 public boolean equals(final java.lang.Object obj) { 5010 if (obj == this) { 5011 return true; 5012 } 5013 if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.Facet)) { 5014 return super.equals(obj); 5015 } 5016 com.google.cloud.retail.v2.SearchResponse.Facet other = 5017 (com.google.cloud.retail.v2.SearchResponse.Facet) obj; 5018 5019 if (!getKey().equals(other.getKey())) return false; 5020 if (!getValuesList().equals(other.getValuesList())) return false; 5021 if (getDynamicFacet() != other.getDynamicFacet()) return false; 5022 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 5023 return true; 5024 } 5025 5026 @java.lang.Override hashCode()5027 public int hashCode() { 5028 if (memoizedHashCode != 0) { 5029 return memoizedHashCode; 5030 } 5031 int hash = 41; 5032 hash = (19 * hash) + getDescriptor().hashCode(); 5033 hash = (37 * hash) + KEY_FIELD_NUMBER; 5034 hash = (53 * hash) + getKey().hashCode(); 5035 if (getValuesCount() > 0) { 5036 hash = (37 * hash) + VALUES_FIELD_NUMBER; 5037 hash = (53 * hash) + getValuesList().hashCode(); 5038 } 5039 hash = (37 * hash) + DYNAMIC_FACET_FIELD_NUMBER; 5040 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDynamicFacet()); 5041 hash = (29 * hash) + getUnknownFields().hashCode(); 5042 memoizedHashCode = hash; 5043 return hash; 5044 } 5045 parseFrom( java.nio.ByteBuffer data)5046 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5047 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 5048 return PARSER.parseFrom(data); 5049 } 5050 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5051 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5052 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5053 throws com.google.protobuf.InvalidProtocolBufferException { 5054 return PARSER.parseFrom(data, extensionRegistry); 5055 } 5056 parseFrom( com.google.protobuf.ByteString data)5057 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5058 com.google.protobuf.ByteString data) 5059 throws com.google.protobuf.InvalidProtocolBufferException { 5060 return PARSER.parseFrom(data); 5061 } 5062 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5063 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5064 com.google.protobuf.ByteString data, 5065 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5066 throws com.google.protobuf.InvalidProtocolBufferException { 5067 return PARSER.parseFrom(data, extensionRegistry); 5068 } 5069 parseFrom(byte[] data)5070 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom(byte[] data) 5071 throws com.google.protobuf.InvalidProtocolBufferException { 5072 return PARSER.parseFrom(data); 5073 } 5074 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5075 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5076 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5077 throws com.google.protobuf.InvalidProtocolBufferException { 5078 return PARSER.parseFrom(data, extensionRegistry); 5079 } 5080 parseFrom( java.io.InputStream input)5081 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5082 java.io.InputStream input) throws java.io.IOException { 5083 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 5084 } 5085 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5086 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5087 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5088 throws java.io.IOException { 5089 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 5090 PARSER, input, extensionRegistry); 5091 } 5092 parseDelimitedFrom( java.io.InputStream input)5093 public static com.google.cloud.retail.v2.SearchResponse.Facet parseDelimitedFrom( 5094 java.io.InputStream input) throws java.io.IOException { 5095 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 5096 } 5097 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5098 public static com.google.cloud.retail.v2.SearchResponse.Facet parseDelimitedFrom( 5099 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5100 throws java.io.IOException { 5101 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 5102 PARSER, input, extensionRegistry); 5103 } 5104 parseFrom( com.google.protobuf.CodedInputStream input)5105 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5106 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 5107 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 5108 } 5109 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5110 public static com.google.cloud.retail.v2.SearchResponse.Facet parseFrom( 5111 com.google.protobuf.CodedInputStream input, 5112 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5113 throws java.io.IOException { 5114 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 5115 PARSER, input, extensionRegistry); 5116 } 5117 5118 @java.lang.Override newBuilderForType()5119 public Builder newBuilderForType() { 5120 return newBuilder(); 5121 } 5122 newBuilder()5123 public static Builder newBuilder() { 5124 return DEFAULT_INSTANCE.toBuilder(); 5125 } 5126 newBuilder(com.google.cloud.retail.v2.SearchResponse.Facet prototype)5127 public static Builder newBuilder(com.google.cloud.retail.v2.SearchResponse.Facet prototype) { 5128 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 5129 } 5130 5131 @java.lang.Override toBuilder()5132 public Builder toBuilder() { 5133 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 5134 } 5135 5136 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)5137 protected Builder newBuilderForType( 5138 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 5139 Builder builder = new Builder(parent); 5140 return builder; 5141 } 5142 /** 5143 * 5144 * 5145 * <pre> 5146 * A facet result. 5147 * </pre> 5148 * 5149 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.Facet} 5150 */ 5151 public static final class Builder 5152 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 5153 implements 5154 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.Facet) 5155 com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder { getDescriptor()5156 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 5157 return com.google.cloud.retail.v2.SearchServiceProto 5158 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; 5159 } 5160 5161 @java.lang.Override 5162 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()5163 internalGetFieldAccessorTable() { 5164 return com.google.cloud.retail.v2.SearchServiceProto 5165 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_fieldAccessorTable 5166 .ensureFieldAccessorsInitialized( 5167 com.google.cloud.retail.v2.SearchResponse.Facet.class, 5168 com.google.cloud.retail.v2.SearchResponse.Facet.Builder.class); 5169 } 5170 5171 // Construct using com.google.cloud.retail.v2.SearchResponse.Facet.newBuilder() Builder()5172 private Builder() {} 5173 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)5174 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 5175 super(parent); 5176 } 5177 5178 @java.lang.Override clear()5179 public Builder clear() { 5180 super.clear(); 5181 bitField0_ = 0; 5182 key_ = ""; 5183 if (valuesBuilder_ == null) { 5184 values_ = java.util.Collections.emptyList(); 5185 } else { 5186 values_ = null; 5187 valuesBuilder_.clear(); 5188 } 5189 bitField0_ = (bitField0_ & ~0x00000002); 5190 dynamicFacet_ = false; 5191 return this; 5192 } 5193 5194 @java.lang.Override getDescriptorForType()5195 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 5196 return com.google.cloud.retail.v2.SearchServiceProto 5197 .internal_static_google_cloud_retail_v2_SearchResponse_Facet_descriptor; 5198 } 5199 5200 @java.lang.Override getDefaultInstanceForType()5201 public com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstanceForType() { 5202 return com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance(); 5203 } 5204 5205 @java.lang.Override build()5206 public com.google.cloud.retail.v2.SearchResponse.Facet build() { 5207 com.google.cloud.retail.v2.SearchResponse.Facet result = buildPartial(); 5208 if (!result.isInitialized()) { 5209 throw newUninitializedMessageException(result); 5210 } 5211 return result; 5212 } 5213 5214 @java.lang.Override buildPartial()5215 public com.google.cloud.retail.v2.SearchResponse.Facet buildPartial() { 5216 com.google.cloud.retail.v2.SearchResponse.Facet result = 5217 new com.google.cloud.retail.v2.SearchResponse.Facet(this); 5218 buildPartialRepeatedFields(result); 5219 if (bitField0_ != 0) { 5220 buildPartial0(result); 5221 } 5222 onBuilt(); 5223 return result; 5224 } 5225 buildPartialRepeatedFields( com.google.cloud.retail.v2.SearchResponse.Facet result)5226 private void buildPartialRepeatedFields( 5227 com.google.cloud.retail.v2.SearchResponse.Facet result) { 5228 if (valuesBuilder_ == null) { 5229 if (((bitField0_ & 0x00000002) != 0)) { 5230 values_ = java.util.Collections.unmodifiableList(values_); 5231 bitField0_ = (bitField0_ & ~0x00000002); 5232 } 5233 result.values_ = values_; 5234 } else { 5235 result.values_ = valuesBuilder_.build(); 5236 } 5237 } 5238 buildPartial0(com.google.cloud.retail.v2.SearchResponse.Facet result)5239 private void buildPartial0(com.google.cloud.retail.v2.SearchResponse.Facet result) { 5240 int from_bitField0_ = bitField0_; 5241 if (((from_bitField0_ & 0x00000001) != 0)) { 5242 result.key_ = key_; 5243 } 5244 if (((from_bitField0_ & 0x00000004) != 0)) { 5245 result.dynamicFacet_ = dynamicFacet_; 5246 } 5247 } 5248 5249 @java.lang.Override clone()5250 public Builder clone() { 5251 return super.clone(); 5252 } 5253 5254 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)5255 public Builder setField( 5256 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 5257 return super.setField(field, value); 5258 } 5259 5260 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)5261 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 5262 return super.clearField(field); 5263 } 5264 5265 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)5266 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 5267 return super.clearOneof(oneof); 5268 } 5269 5270 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)5271 public Builder setRepeatedField( 5272 com.google.protobuf.Descriptors.FieldDescriptor field, 5273 int index, 5274 java.lang.Object value) { 5275 return super.setRepeatedField(field, index, value); 5276 } 5277 5278 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)5279 public Builder addRepeatedField( 5280 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 5281 return super.addRepeatedField(field, value); 5282 } 5283 5284 @java.lang.Override mergeFrom(com.google.protobuf.Message other)5285 public Builder mergeFrom(com.google.protobuf.Message other) { 5286 if (other instanceof com.google.cloud.retail.v2.SearchResponse.Facet) { 5287 return mergeFrom((com.google.cloud.retail.v2.SearchResponse.Facet) other); 5288 } else { 5289 super.mergeFrom(other); 5290 return this; 5291 } 5292 } 5293 mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet other)5294 public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.Facet other) { 5295 if (other == com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()) 5296 return this; 5297 if (!other.getKey().isEmpty()) { 5298 key_ = other.key_; 5299 bitField0_ |= 0x00000001; 5300 onChanged(); 5301 } 5302 if (valuesBuilder_ == null) { 5303 if (!other.values_.isEmpty()) { 5304 if (values_.isEmpty()) { 5305 values_ = other.values_; 5306 bitField0_ = (bitField0_ & ~0x00000002); 5307 } else { 5308 ensureValuesIsMutable(); 5309 values_.addAll(other.values_); 5310 } 5311 onChanged(); 5312 } 5313 } else { 5314 if (!other.values_.isEmpty()) { 5315 if (valuesBuilder_.isEmpty()) { 5316 valuesBuilder_.dispose(); 5317 valuesBuilder_ = null; 5318 values_ = other.values_; 5319 bitField0_ = (bitField0_ & ~0x00000002); 5320 valuesBuilder_ = 5321 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 5322 ? getValuesFieldBuilder() 5323 : null; 5324 } else { 5325 valuesBuilder_.addAllMessages(other.values_); 5326 } 5327 } 5328 } 5329 if (other.getDynamicFacet() != false) { 5330 setDynamicFacet(other.getDynamicFacet()); 5331 } 5332 this.mergeUnknownFields(other.getUnknownFields()); 5333 onChanged(); 5334 return this; 5335 } 5336 5337 @java.lang.Override isInitialized()5338 public final boolean isInitialized() { 5339 return true; 5340 } 5341 5342 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)5343 public Builder mergeFrom( 5344 com.google.protobuf.CodedInputStream input, 5345 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5346 throws java.io.IOException { 5347 if (extensionRegistry == null) { 5348 throw new java.lang.NullPointerException(); 5349 } 5350 try { 5351 boolean done = false; 5352 while (!done) { 5353 int tag = input.readTag(); 5354 switch (tag) { 5355 case 0: 5356 done = true; 5357 break; 5358 case 10: 5359 { 5360 key_ = input.readStringRequireUtf8(); 5361 bitField0_ |= 0x00000001; 5362 break; 5363 } // case 10 5364 case 18: 5365 { 5366 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue m = 5367 input.readMessage( 5368 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.parser(), 5369 extensionRegistry); 5370 if (valuesBuilder_ == null) { 5371 ensureValuesIsMutable(); 5372 values_.add(m); 5373 } else { 5374 valuesBuilder_.addMessage(m); 5375 } 5376 break; 5377 } // case 18 5378 case 24: 5379 { 5380 dynamicFacet_ = input.readBool(); 5381 bitField0_ |= 0x00000004; 5382 break; 5383 } // case 24 5384 default: 5385 { 5386 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 5387 done = true; // was an endgroup tag 5388 } 5389 break; 5390 } // default: 5391 } // switch (tag) 5392 } // while (!done) 5393 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 5394 throw e.unwrapIOException(); 5395 } finally { 5396 onChanged(); 5397 } // finally 5398 return this; 5399 } 5400 5401 private int bitField0_; 5402 5403 private java.lang.Object key_ = ""; 5404 /** 5405 * 5406 * 5407 * <pre> 5408 * The key for this facet. E.g., "colorFamilies" or "price" or 5409 * "attributes.attr1". 5410 * </pre> 5411 * 5412 * <code>string key = 1;</code> 5413 * 5414 * @return The key. 5415 */ getKey()5416 public java.lang.String getKey() { 5417 java.lang.Object ref = key_; 5418 if (!(ref instanceof java.lang.String)) { 5419 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 5420 java.lang.String s = bs.toStringUtf8(); 5421 key_ = s; 5422 return s; 5423 } else { 5424 return (java.lang.String) ref; 5425 } 5426 } 5427 /** 5428 * 5429 * 5430 * <pre> 5431 * The key for this facet. E.g., "colorFamilies" or "price" or 5432 * "attributes.attr1". 5433 * </pre> 5434 * 5435 * <code>string key = 1;</code> 5436 * 5437 * @return The bytes for key. 5438 */ getKeyBytes()5439 public com.google.protobuf.ByteString getKeyBytes() { 5440 java.lang.Object ref = key_; 5441 if (ref instanceof String) { 5442 com.google.protobuf.ByteString b = 5443 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 5444 key_ = b; 5445 return b; 5446 } else { 5447 return (com.google.protobuf.ByteString) ref; 5448 } 5449 } 5450 /** 5451 * 5452 * 5453 * <pre> 5454 * The key for this facet. E.g., "colorFamilies" or "price" or 5455 * "attributes.attr1". 5456 * </pre> 5457 * 5458 * <code>string key = 1;</code> 5459 * 5460 * @param value The key to set. 5461 * @return This builder for chaining. 5462 */ setKey(java.lang.String value)5463 public Builder setKey(java.lang.String value) { 5464 if (value == null) { 5465 throw new NullPointerException(); 5466 } 5467 key_ = value; 5468 bitField0_ |= 0x00000001; 5469 onChanged(); 5470 return this; 5471 } 5472 /** 5473 * 5474 * 5475 * <pre> 5476 * The key for this facet. E.g., "colorFamilies" or "price" or 5477 * "attributes.attr1". 5478 * </pre> 5479 * 5480 * <code>string key = 1;</code> 5481 * 5482 * @return This builder for chaining. 5483 */ clearKey()5484 public Builder clearKey() { 5485 key_ = getDefaultInstance().getKey(); 5486 bitField0_ = (bitField0_ & ~0x00000001); 5487 onChanged(); 5488 return this; 5489 } 5490 /** 5491 * 5492 * 5493 * <pre> 5494 * The key for this facet. E.g., "colorFamilies" or "price" or 5495 * "attributes.attr1". 5496 * </pre> 5497 * 5498 * <code>string key = 1;</code> 5499 * 5500 * @param value The bytes for key to set. 5501 * @return This builder for chaining. 5502 */ setKeyBytes(com.google.protobuf.ByteString value)5503 public Builder setKeyBytes(com.google.protobuf.ByteString value) { 5504 if (value == null) { 5505 throw new NullPointerException(); 5506 } 5507 checkByteStringIsUtf8(value); 5508 key_ = value; 5509 bitField0_ |= 0x00000001; 5510 onChanged(); 5511 return this; 5512 } 5513 5514 private java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> values_ = 5515 java.util.Collections.emptyList(); 5516 ensureValuesIsMutable()5517 private void ensureValuesIsMutable() { 5518 if (!((bitField0_ & 0x00000002) != 0)) { 5519 values_ = 5520 new java.util.ArrayList<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue>( 5521 values_); 5522 bitField0_ |= 0x00000002; 5523 } 5524 } 5525 5526 private com.google.protobuf.RepeatedFieldBuilderV3< 5527 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, 5528 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, 5529 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> 5530 valuesBuilder_; 5531 5532 /** 5533 * 5534 * 5535 * <pre> 5536 * The facet values for this field. 5537 * </pre> 5538 * 5539 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5540 */ 5541 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> getValuesList()5542 getValuesList() { 5543 if (valuesBuilder_ == null) { 5544 return java.util.Collections.unmodifiableList(values_); 5545 } else { 5546 return valuesBuilder_.getMessageList(); 5547 } 5548 } 5549 /** 5550 * 5551 * 5552 * <pre> 5553 * The facet values for this field. 5554 * </pre> 5555 * 5556 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5557 */ getValuesCount()5558 public int getValuesCount() { 5559 if (valuesBuilder_ == null) { 5560 return values_.size(); 5561 } else { 5562 return valuesBuilder_.getCount(); 5563 } 5564 } 5565 /** 5566 * 5567 * 5568 * <pre> 5569 * The facet values for this field. 5570 * </pre> 5571 * 5572 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5573 */ getValues(int index)5574 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue getValues(int index) { 5575 if (valuesBuilder_ == null) { 5576 return values_.get(index); 5577 } else { 5578 return valuesBuilder_.getMessage(index); 5579 } 5580 } 5581 /** 5582 * 5583 * 5584 * <pre> 5585 * The facet values for this field. 5586 * </pre> 5587 * 5588 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5589 */ setValues( int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value)5590 public Builder setValues( 5591 int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { 5592 if (valuesBuilder_ == null) { 5593 if (value == null) { 5594 throw new NullPointerException(); 5595 } 5596 ensureValuesIsMutable(); 5597 values_.set(index, value); 5598 onChanged(); 5599 } else { 5600 valuesBuilder_.setMessage(index, value); 5601 } 5602 return this; 5603 } 5604 /** 5605 * 5606 * 5607 * <pre> 5608 * The facet values for this field. 5609 * </pre> 5610 * 5611 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5612 */ setValues( int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue)5613 public Builder setValues( 5614 int index, 5615 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { 5616 if (valuesBuilder_ == null) { 5617 ensureValuesIsMutable(); 5618 values_.set(index, builderForValue.build()); 5619 onChanged(); 5620 } else { 5621 valuesBuilder_.setMessage(index, builderForValue.build()); 5622 } 5623 return this; 5624 } 5625 /** 5626 * 5627 * 5628 * <pre> 5629 * The facet values for this field. 5630 * </pre> 5631 * 5632 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5633 */ addValues(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value)5634 public Builder addValues(com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { 5635 if (valuesBuilder_ == null) { 5636 if (value == null) { 5637 throw new NullPointerException(); 5638 } 5639 ensureValuesIsMutable(); 5640 values_.add(value); 5641 onChanged(); 5642 } else { 5643 valuesBuilder_.addMessage(value); 5644 } 5645 return this; 5646 } 5647 /** 5648 * 5649 * 5650 * <pre> 5651 * The facet values for this field. 5652 * </pre> 5653 * 5654 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5655 */ addValues( int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value)5656 public Builder addValues( 5657 int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue value) { 5658 if (valuesBuilder_ == null) { 5659 if (value == null) { 5660 throw new NullPointerException(); 5661 } 5662 ensureValuesIsMutable(); 5663 values_.add(index, value); 5664 onChanged(); 5665 } else { 5666 valuesBuilder_.addMessage(index, value); 5667 } 5668 return this; 5669 } 5670 /** 5671 * 5672 * 5673 * <pre> 5674 * The facet values for this field. 5675 * </pre> 5676 * 5677 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5678 */ addValues( com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue)5679 public Builder addValues( 5680 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { 5681 if (valuesBuilder_ == null) { 5682 ensureValuesIsMutable(); 5683 values_.add(builderForValue.build()); 5684 onChanged(); 5685 } else { 5686 valuesBuilder_.addMessage(builderForValue.build()); 5687 } 5688 return this; 5689 } 5690 /** 5691 * 5692 * 5693 * <pre> 5694 * The facet values for this field. 5695 * </pre> 5696 * 5697 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5698 */ addValues( int index, com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue)5699 public Builder addValues( 5700 int index, 5701 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder builderForValue) { 5702 if (valuesBuilder_ == null) { 5703 ensureValuesIsMutable(); 5704 values_.add(index, builderForValue.build()); 5705 onChanged(); 5706 } else { 5707 valuesBuilder_.addMessage(index, builderForValue.build()); 5708 } 5709 return this; 5710 } 5711 /** 5712 * 5713 * 5714 * <pre> 5715 * The facet values for this field. 5716 * </pre> 5717 * 5718 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5719 */ addAllValues( java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> values)5720 public Builder addAllValues( 5721 java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue> 5722 values) { 5723 if (valuesBuilder_ == null) { 5724 ensureValuesIsMutable(); 5725 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); 5726 onChanged(); 5727 } else { 5728 valuesBuilder_.addAllMessages(values); 5729 } 5730 return this; 5731 } 5732 /** 5733 * 5734 * 5735 * <pre> 5736 * The facet values for this field. 5737 * </pre> 5738 * 5739 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5740 */ clearValues()5741 public Builder clearValues() { 5742 if (valuesBuilder_ == null) { 5743 values_ = java.util.Collections.emptyList(); 5744 bitField0_ = (bitField0_ & ~0x00000002); 5745 onChanged(); 5746 } else { 5747 valuesBuilder_.clear(); 5748 } 5749 return this; 5750 } 5751 /** 5752 * 5753 * 5754 * <pre> 5755 * The facet values for this field. 5756 * </pre> 5757 * 5758 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5759 */ removeValues(int index)5760 public Builder removeValues(int index) { 5761 if (valuesBuilder_ == null) { 5762 ensureValuesIsMutable(); 5763 values_.remove(index); 5764 onChanged(); 5765 } else { 5766 valuesBuilder_.remove(index); 5767 } 5768 return this; 5769 } 5770 /** 5771 * 5772 * 5773 * <pre> 5774 * The facet values for this field. 5775 * </pre> 5776 * 5777 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5778 */ getValuesBuilder( int index)5779 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder getValuesBuilder( 5780 int index) { 5781 return getValuesFieldBuilder().getBuilder(index); 5782 } 5783 /** 5784 * 5785 * 5786 * <pre> 5787 * The facet values for this field. 5788 * </pre> 5789 * 5790 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5791 */ getValuesOrBuilder( int index)5792 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( 5793 int index) { 5794 if (valuesBuilder_ == null) { 5795 return values_.get(index); 5796 } else { 5797 return valuesBuilder_.getMessageOrBuilder(index); 5798 } 5799 } 5800 /** 5801 * 5802 * 5803 * <pre> 5804 * The facet values for this field. 5805 * </pre> 5806 * 5807 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5808 */ 5809 public java.util.List< 5810 ? extends com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> getValuesOrBuilderList()5811 getValuesOrBuilderList() { 5812 if (valuesBuilder_ != null) { 5813 return valuesBuilder_.getMessageOrBuilderList(); 5814 } else { 5815 return java.util.Collections.unmodifiableList(values_); 5816 } 5817 } 5818 /** 5819 * 5820 * 5821 * <pre> 5822 * The facet values for this field. 5823 * </pre> 5824 * 5825 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5826 */ addValuesBuilder()5827 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder addValuesBuilder() { 5828 return getValuesFieldBuilder() 5829 .addBuilder( 5830 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()); 5831 } 5832 /** 5833 * 5834 * 5835 * <pre> 5836 * The facet values for this field. 5837 * </pre> 5838 * 5839 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5840 */ addValuesBuilder( int index)5841 public com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder addValuesBuilder( 5842 int index) { 5843 return getValuesFieldBuilder() 5844 .addBuilder( 5845 index, 5846 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.getDefaultInstance()); 5847 } 5848 /** 5849 * 5850 * 5851 * <pre> 5852 * The facet values for this field. 5853 * </pre> 5854 * 5855 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet.FacetValue values = 2;</code> 5856 */ 5857 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder> getValuesBuilderList()5858 getValuesBuilderList() { 5859 return getValuesFieldBuilder().getBuilderList(); 5860 } 5861 5862 private com.google.protobuf.RepeatedFieldBuilderV3< 5863 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, 5864 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, 5865 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder> getValuesFieldBuilder()5866 getValuesFieldBuilder() { 5867 if (valuesBuilder_ == null) { 5868 valuesBuilder_ = 5869 new com.google.protobuf.RepeatedFieldBuilderV3< 5870 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue, 5871 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValue.Builder, 5872 com.google.cloud.retail.v2.SearchResponse.Facet.FacetValueOrBuilder>( 5873 values_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); 5874 values_ = null; 5875 } 5876 return valuesBuilder_; 5877 } 5878 5879 private boolean dynamicFacet_; 5880 /** 5881 * 5882 * 5883 * <pre> 5884 * Whether the facet is dynamically generated. 5885 * </pre> 5886 * 5887 * <code>bool dynamic_facet = 3;</code> 5888 * 5889 * @return The dynamicFacet. 5890 */ 5891 @java.lang.Override getDynamicFacet()5892 public boolean getDynamicFacet() { 5893 return dynamicFacet_; 5894 } 5895 /** 5896 * 5897 * 5898 * <pre> 5899 * Whether the facet is dynamically generated. 5900 * </pre> 5901 * 5902 * <code>bool dynamic_facet = 3;</code> 5903 * 5904 * @param value The dynamicFacet to set. 5905 * @return This builder for chaining. 5906 */ setDynamicFacet(boolean value)5907 public Builder setDynamicFacet(boolean value) { 5908 5909 dynamicFacet_ = value; 5910 bitField0_ |= 0x00000004; 5911 onChanged(); 5912 return this; 5913 } 5914 /** 5915 * 5916 * 5917 * <pre> 5918 * Whether the facet is dynamically generated. 5919 * </pre> 5920 * 5921 * <code>bool dynamic_facet = 3;</code> 5922 * 5923 * @return This builder for chaining. 5924 */ clearDynamicFacet()5925 public Builder clearDynamicFacet() { 5926 bitField0_ = (bitField0_ & ~0x00000004); 5927 dynamicFacet_ = false; 5928 onChanged(); 5929 return this; 5930 } 5931 5932 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)5933 public final Builder setUnknownFields( 5934 final com.google.protobuf.UnknownFieldSet unknownFields) { 5935 return super.setUnknownFields(unknownFields); 5936 } 5937 5938 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)5939 public final Builder mergeUnknownFields( 5940 final com.google.protobuf.UnknownFieldSet unknownFields) { 5941 return super.mergeUnknownFields(unknownFields); 5942 } 5943 5944 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.Facet) 5945 } 5946 5947 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.Facet) 5948 private static final com.google.cloud.retail.v2.SearchResponse.Facet DEFAULT_INSTANCE; 5949 5950 static { 5951 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.Facet(); 5952 } 5953 getDefaultInstance()5954 public static com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstance() { 5955 return DEFAULT_INSTANCE; 5956 } 5957 5958 private static final com.google.protobuf.Parser<Facet> PARSER = 5959 new com.google.protobuf.AbstractParser<Facet>() { 5960 @java.lang.Override 5961 public Facet parsePartialFrom( 5962 com.google.protobuf.CodedInputStream input, 5963 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 5964 throws com.google.protobuf.InvalidProtocolBufferException { 5965 Builder builder = newBuilder(); 5966 try { 5967 builder.mergeFrom(input, extensionRegistry); 5968 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 5969 throw e.setUnfinishedMessage(builder.buildPartial()); 5970 } catch (com.google.protobuf.UninitializedMessageException e) { 5971 throw e.asInvalidProtocolBufferException() 5972 .setUnfinishedMessage(builder.buildPartial()); 5973 } catch (java.io.IOException e) { 5974 throw new com.google.protobuf.InvalidProtocolBufferException(e) 5975 .setUnfinishedMessage(builder.buildPartial()); 5976 } 5977 return builder.buildPartial(); 5978 } 5979 }; 5980 parser()5981 public static com.google.protobuf.Parser<Facet> parser() { 5982 return PARSER; 5983 } 5984 5985 @java.lang.Override getParserForType()5986 public com.google.protobuf.Parser<Facet> getParserForType() { 5987 return PARSER; 5988 } 5989 5990 @java.lang.Override getDefaultInstanceForType()5991 public com.google.cloud.retail.v2.SearchResponse.Facet getDefaultInstanceForType() { 5992 return DEFAULT_INSTANCE; 5993 } 5994 } 5995 5996 public interface QueryExpansionInfoOrBuilder 5997 extends 5998 // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) 5999 com.google.protobuf.MessageOrBuilder { 6000 6001 /** 6002 * 6003 * 6004 * <pre> 6005 * Bool describing whether query expansion has occurred. 6006 * </pre> 6007 * 6008 * <code>bool expanded_query = 1;</code> 6009 * 6010 * @return The expandedQuery. 6011 */ getExpandedQuery()6012 boolean getExpandedQuery(); 6013 6014 /** 6015 * 6016 * 6017 * <pre> 6018 * Number of pinned results. This field will only be set when expansion 6019 * happens and 6020 * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] 6021 * is set to true. 6022 * </pre> 6023 * 6024 * <code>int64 pinned_result_count = 2;</code> 6025 * 6026 * @return The pinnedResultCount. 6027 */ getPinnedResultCount()6028 long getPinnedResultCount(); 6029 } 6030 /** 6031 * 6032 * 6033 * <pre> 6034 * Information describing query expansion including whether expansion has 6035 * occurred. 6036 * </pre> 6037 * 6038 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} 6039 */ 6040 public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 6041 implements 6042 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) 6043 QueryExpansionInfoOrBuilder { 6044 private static final long serialVersionUID = 0L; 6045 // Use QueryExpansionInfo.newBuilder() to construct. QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)6046 private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 6047 super(builder); 6048 } 6049 QueryExpansionInfo()6050 private QueryExpansionInfo() {} 6051 6052 @java.lang.Override 6053 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)6054 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 6055 return new QueryExpansionInfo(); 6056 } 6057 6058 @java.lang.Override getUnknownFields()6059 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 6060 return this.unknownFields; 6061 } 6062 getDescriptor()6063 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 6064 return com.google.cloud.retail.v2.SearchServiceProto 6065 .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; 6066 } 6067 6068 @java.lang.Override 6069 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()6070 internalGetFieldAccessorTable() { 6071 return com.google.cloud.retail.v2.SearchServiceProto 6072 .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_fieldAccessorTable 6073 .ensureFieldAccessorsInitialized( 6074 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.class, 6075 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder.class); 6076 } 6077 6078 public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; 6079 private boolean expandedQuery_ = false; 6080 /** 6081 * 6082 * 6083 * <pre> 6084 * Bool describing whether query expansion has occurred. 6085 * </pre> 6086 * 6087 * <code>bool expanded_query = 1;</code> 6088 * 6089 * @return The expandedQuery. 6090 */ 6091 @java.lang.Override getExpandedQuery()6092 public boolean getExpandedQuery() { 6093 return expandedQuery_; 6094 } 6095 6096 public static final int PINNED_RESULT_COUNT_FIELD_NUMBER = 2; 6097 private long pinnedResultCount_ = 0L; 6098 /** 6099 * 6100 * 6101 * <pre> 6102 * Number of pinned results. This field will only be set when expansion 6103 * happens and 6104 * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] 6105 * is set to true. 6106 * </pre> 6107 * 6108 * <code>int64 pinned_result_count = 2;</code> 6109 * 6110 * @return The pinnedResultCount. 6111 */ 6112 @java.lang.Override getPinnedResultCount()6113 public long getPinnedResultCount() { 6114 return pinnedResultCount_; 6115 } 6116 6117 private byte memoizedIsInitialized = -1; 6118 6119 @java.lang.Override isInitialized()6120 public final boolean isInitialized() { 6121 byte isInitialized = memoizedIsInitialized; 6122 if (isInitialized == 1) return true; 6123 if (isInitialized == 0) return false; 6124 6125 memoizedIsInitialized = 1; 6126 return true; 6127 } 6128 6129 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)6130 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 6131 if (expandedQuery_ != false) { 6132 output.writeBool(1, expandedQuery_); 6133 } 6134 if (pinnedResultCount_ != 0L) { 6135 output.writeInt64(2, pinnedResultCount_); 6136 } 6137 getUnknownFields().writeTo(output); 6138 } 6139 6140 @java.lang.Override getSerializedSize()6141 public int getSerializedSize() { 6142 int size = memoizedSize; 6143 if (size != -1) return size; 6144 6145 size = 0; 6146 if (expandedQuery_ != false) { 6147 size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); 6148 } 6149 if (pinnedResultCount_ != 0L) { 6150 size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pinnedResultCount_); 6151 } 6152 size += getUnknownFields().getSerializedSize(); 6153 memoizedSize = size; 6154 return size; 6155 } 6156 6157 @java.lang.Override equals(final java.lang.Object obj)6158 public boolean equals(final java.lang.Object obj) { 6159 if (obj == this) { 6160 return true; 6161 } 6162 if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo)) { 6163 return super.equals(obj); 6164 } 6165 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo other = 6166 (com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) obj; 6167 6168 if (getExpandedQuery() != other.getExpandedQuery()) return false; 6169 if (getPinnedResultCount() != other.getPinnedResultCount()) return false; 6170 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 6171 return true; 6172 } 6173 6174 @java.lang.Override hashCode()6175 public int hashCode() { 6176 if (memoizedHashCode != 0) { 6177 return memoizedHashCode; 6178 } 6179 int hash = 41; 6180 hash = (19 * hash) + getDescriptor().hashCode(); 6181 hash = (37 * hash) + EXPANDED_QUERY_FIELD_NUMBER; 6182 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); 6183 hash = (37 * hash) + PINNED_RESULT_COUNT_FIELD_NUMBER; 6184 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPinnedResultCount()); 6185 hash = (29 * hash) + getUnknownFields().hashCode(); 6186 memoizedHashCode = hash; 6187 return hash; 6188 } 6189 parseFrom( java.nio.ByteBuffer data)6190 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6191 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 6192 return PARSER.parseFrom(data); 6193 } 6194 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6195 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6196 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6197 throws com.google.protobuf.InvalidProtocolBufferException { 6198 return PARSER.parseFrom(data, extensionRegistry); 6199 } 6200 parseFrom( com.google.protobuf.ByteString data)6201 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6202 com.google.protobuf.ByteString data) 6203 throws com.google.protobuf.InvalidProtocolBufferException { 6204 return PARSER.parseFrom(data); 6205 } 6206 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6207 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6208 com.google.protobuf.ByteString data, 6209 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6210 throws com.google.protobuf.InvalidProtocolBufferException { 6211 return PARSER.parseFrom(data, extensionRegistry); 6212 } 6213 parseFrom( byte[] data)6214 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6215 byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { 6216 return PARSER.parseFrom(data); 6217 } 6218 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6219 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6220 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6221 throws com.google.protobuf.InvalidProtocolBufferException { 6222 return PARSER.parseFrom(data, extensionRegistry); 6223 } 6224 parseFrom( java.io.InputStream input)6225 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6226 java.io.InputStream input) throws java.io.IOException { 6227 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 6228 } 6229 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6230 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6231 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6232 throws java.io.IOException { 6233 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 6234 PARSER, input, extensionRegistry); 6235 } 6236 parseDelimitedFrom( java.io.InputStream input)6237 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseDelimitedFrom( 6238 java.io.InputStream input) throws java.io.IOException { 6239 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 6240 } 6241 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6242 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseDelimitedFrom( 6243 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6244 throws java.io.IOException { 6245 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 6246 PARSER, input, extensionRegistry); 6247 } 6248 parseFrom( com.google.protobuf.CodedInputStream input)6249 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6250 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 6251 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 6252 } 6253 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6254 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo parseFrom( 6255 com.google.protobuf.CodedInputStream input, 6256 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6257 throws java.io.IOException { 6258 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 6259 PARSER, input, extensionRegistry); 6260 } 6261 6262 @java.lang.Override newBuilderForType()6263 public Builder newBuilderForType() { 6264 return newBuilder(); 6265 } 6266 newBuilder()6267 public static Builder newBuilder() { 6268 return DEFAULT_INSTANCE.toBuilder(); 6269 } 6270 newBuilder( com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo prototype)6271 public static Builder newBuilder( 6272 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo prototype) { 6273 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 6274 } 6275 6276 @java.lang.Override toBuilder()6277 public Builder toBuilder() { 6278 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 6279 } 6280 6281 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)6282 protected Builder newBuilderForType( 6283 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 6284 Builder builder = new Builder(parent); 6285 return builder; 6286 } 6287 /** 6288 * 6289 * 6290 * <pre> 6291 * Information describing query expansion including whether expansion has 6292 * occurred. 6293 * </pre> 6294 * 6295 * Protobuf type {@code google.cloud.retail.v2.SearchResponse.QueryExpansionInfo} 6296 */ 6297 public static final class Builder 6298 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 6299 implements 6300 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) 6301 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder { getDescriptor()6302 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 6303 return com.google.cloud.retail.v2.SearchServiceProto 6304 .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; 6305 } 6306 6307 @java.lang.Override 6308 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()6309 internalGetFieldAccessorTable() { 6310 return com.google.cloud.retail.v2.SearchServiceProto 6311 .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_fieldAccessorTable 6312 .ensureFieldAccessorsInitialized( 6313 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.class, 6314 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder.class); 6315 } 6316 6317 // Construct using com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.newBuilder() Builder()6318 private Builder() {} 6319 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)6320 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 6321 super(parent); 6322 } 6323 6324 @java.lang.Override clear()6325 public Builder clear() { 6326 super.clear(); 6327 bitField0_ = 0; 6328 expandedQuery_ = false; 6329 pinnedResultCount_ = 0L; 6330 return this; 6331 } 6332 6333 @java.lang.Override getDescriptorForType()6334 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 6335 return com.google.cloud.retail.v2.SearchServiceProto 6336 .internal_static_google_cloud_retail_v2_SearchResponse_QueryExpansionInfo_descriptor; 6337 } 6338 6339 @java.lang.Override 6340 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getDefaultInstanceForType()6341 getDefaultInstanceForType() { 6342 return com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance(); 6343 } 6344 6345 @java.lang.Override build()6346 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo build() { 6347 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result = buildPartial(); 6348 if (!result.isInitialized()) { 6349 throw newUninitializedMessageException(result); 6350 } 6351 return result; 6352 } 6353 6354 @java.lang.Override buildPartial()6355 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo buildPartial() { 6356 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result = 6357 new com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(this); 6358 if (bitField0_ != 0) { 6359 buildPartial0(result); 6360 } 6361 onBuilt(); 6362 return result; 6363 } 6364 buildPartial0( com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result)6365 private void buildPartial0( 6366 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo result) { 6367 int from_bitField0_ = bitField0_; 6368 if (((from_bitField0_ & 0x00000001) != 0)) { 6369 result.expandedQuery_ = expandedQuery_; 6370 } 6371 if (((from_bitField0_ & 0x00000002) != 0)) { 6372 result.pinnedResultCount_ = pinnedResultCount_; 6373 } 6374 } 6375 6376 @java.lang.Override clone()6377 public Builder clone() { 6378 return super.clone(); 6379 } 6380 6381 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)6382 public Builder setField( 6383 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 6384 return super.setField(field, value); 6385 } 6386 6387 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)6388 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 6389 return super.clearField(field); 6390 } 6391 6392 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)6393 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 6394 return super.clearOneof(oneof); 6395 } 6396 6397 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)6398 public Builder setRepeatedField( 6399 com.google.protobuf.Descriptors.FieldDescriptor field, 6400 int index, 6401 java.lang.Object value) { 6402 return super.setRepeatedField(field, index, value); 6403 } 6404 6405 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)6406 public Builder addRepeatedField( 6407 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 6408 return super.addRepeatedField(field, value); 6409 } 6410 6411 @java.lang.Override mergeFrom(com.google.protobuf.Message other)6412 public Builder mergeFrom(com.google.protobuf.Message other) { 6413 if (other instanceof com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) { 6414 return mergeFrom((com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) other); 6415 } else { 6416 super.mergeFrom(other); 6417 return this; 6418 } 6419 } 6420 mergeFrom(com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo other)6421 public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo other) { 6422 if (other 6423 == com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance()) 6424 return this; 6425 if (other.getExpandedQuery() != false) { 6426 setExpandedQuery(other.getExpandedQuery()); 6427 } 6428 if (other.getPinnedResultCount() != 0L) { 6429 setPinnedResultCount(other.getPinnedResultCount()); 6430 } 6431 this.mergeUnknownFields(other.getUnknownFields()); 6432 onChanged(); 6433 return this; 6434 } 6435 6436 @java.lang.Override isInitialized()6437 public final boolean isInitialized() { 6438 return true; 6439 } 6440 6441 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)6442 public Builder mergeFrom( 6443 com.google.protobuf.CodedInputStream input, 6444 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6445 throws java.io.IOException { 6446 if (extensionRegistry == null) { 6447 throw new java.lang.NullPointerException(); 6448 } 6449 try { 6450 boolean done = false; 6451 while (!done) { 6452 int tag = input.readTag(); 6453 switch (tag) { 6454 case 0: 6455 done = true; 6456 break; 6457 case 8: 6458 { 6459 expandedQuery_ = input.readBool(); 6460 bitField0_ |= 0x00000001; 6461 break; 6462 } // case 8 6463 case 16: 6464 { 6465 pinnedResultCount_ = input.readInt64(); 6466 bitField0_ |= 0x00000002; 6467 break; 6468 } // case 16 6469 default: 6470 { 6471 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 6472 done = true; // was an endgroup tag 6473 } 6474 break; 6475 } // default: 6476 } // switch (tag) 6477 } // while (!done) 6478 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 6479 throw e.unwrapIOException(); 6480 } finally { 6481 onChanged(); 6482 } // finally 6483 return this; 6484 } 6485 6486 private int bitField0_; 6487 6488 private boolean expandedQuery_; 6489 /** 6490 * 6491 * 6492 * <pre> 6493 * Bool describing whether query expansion has occurred. 6494 * </pre> 6495 * 6496 * <code>bool expanded_query = 1;</code> 6497 * 6498 * @return The expandedQuery. 6499 */ 6500 @java.lang.Override getExpandedQuery()6501 public boolean getExpandedQuery() { 6502 return expandedQuery_; 6503 } 6504 /** 6505 * 6506 * 6507 * <pre> 6508 * Bool describing whether query expansion has occurred. 6509 * </pre> 6510 * 6511 * <code>bool expanded_query = 1;</code> 6512 * 6513 * @param value The expandedQuery to set. 6514 * @return This builder for chaining. 6515 */ setExpandedQuery(boolean value)6516 public Builder setExpandedQuery(boolean value) { 6517 6518 expandedQuery_ = value; 6519 bitField0_ |= 0x00000001; 6520 onChanged(); 6521 return this; 6522 } 6523 /** 6524 * 6525 * 6526 * <pre> 6527 * Bool describing whether query expansion has occurred. 6528 * </pre> 6529 * 6530 * <code>bool expanded_query = 1;</code> 6531 * 6532 * @return This builder for chaining. 6533 */ clearExpandedQuery()6534 public Builder clearExpandedQuery() { 6535 bitField0_ = (bitField0_ & ~0x00000001); 6536 expandedQuery_ = false; 6537 onChanged(); 6538 return this; 6539 } 6540 6541 private long pinnedResultCount_; 6542 /** 6543 * 6544 * 6545 * <pre> 6546 * Number of pinned results. This field will only be set when expansion 6547 * happens and 6548 * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] 6549 * is set to true. 6550 * </pre> 6551 * 6552 * <code>int64 pinned_result_count = 2;</code> 6553 * 6554 * @return The pinnedResultCount. 6555 */ 6556 @java.lang.Override getPinnedResultCount()6557 public long getPinnedResultCount() { 6558 return pinnedResultCount_; 6559 } 6560 /** 6561 * 6562 * 6563 * <pre> 6564 * Number of pinned results. This field will only be set when expansion 6565 * happens and 6566 * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] 6567 * is set to true. 6568 * </pre> 6569 * 6570 * <code>int64 pinned_result_count = 2;</code> 6571 * 6572 * @param value The pinnedResultCount to set. 6573 * @return This builder for chaining. 6574 */ setPinnedResultCount(long value)6575 public Builder setPinnedResultCount(long value) { 6576 6577 pinnedResultCount_ = value; 6578 bitField0_ |= 0x00000002; 6579 onChanged(); 6580 return this; 6581 } 6582 /** 6583 * 6584 * 6585 * <pre> 6586 * Number of pinned results. This field will only be set when expansion 6587 * happens and 6588 * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] 6589 * is set to true. 6590 * </pre> 6591 * 6592 * <code>int64 pinned_result_count = 2;</code> 6593 * 6594 * @return This builder for chaining. 6595 */ clearPinnedResultCount()6596 public Builder clearPinnedResultCount() { 6597 bitField0_ = (bitField0_ & ~0x00000002); 6598 pinnedResultCount_ = 0L; 6599 onChanged(); 6600 return this; 6601 } 6602 6603 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6604 public final Builder setUnknownFields( 6605 final com.google.protobuf.UnknownFieldSet unknownFields) { 6606 return super.setUnknownFields(unknownFields); 6607 } 6608 6609 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)6610 public final Builder mergeUnknownFields( 6611 final com.google.protobuf.UnknownFieldSet unknownFields) { 6612 return super.mergeUnknownFields(unknownFields); 6613 } 6614 6615 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) 6616 } 6617 6618 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse.QueryExpansionInfo) 6619 private static final com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo 6620 DEFAULT_INSTANCE; 6621 6622 static { 6623 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo(); 6624 } 6625 6626 public static com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getDefaultInstance()6627 getDefaultInstance() { 6628 return DEFAULT_INSTANCE; 6629 } 6630 6631 private static final com.google.protobuf.Parser<QueryExpansionInfo> PARSER = 6632 new com.google.protobuf.AbstractParser<QueryExpansionInfo>() { 6633 @java.lang.Override 6634 public QueryExpansionInfo parsePartialFrom( 6635 com.google.protobuf.CodedInputStream input, 6636 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 6637 throws com.google.protobuf.InvalidProtocolBufferException { 6638 Builder builder = newBuilder(); 6639 try { 6640 builder.mergeFrom(input, extensionRegistry); 6641 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 6642 throw e.setUnfinishedMessage(builder.buildPartial()); 6643 } catch (com.google.protobuf.UninitializedMessageException e) { 6644 throw e.asInvalidProtocolBufferException() 6645 .setUnfinishedMessage(builder.buildPartial()); 6646 } catch (java.io.IOException e) { 6647 throw new com.google.protobuf.InvalidProtocolBufferException(e) 6648 .setUnfinishedMessage(builder.buildPartial()); 6649 } 6650 return builder.buildPartial(); 6651 } 6652 }; 6653 parser()6654 public static com.google.protobuf.Parser<QueryExpansionInfo> parser() { 6655 return PARSER; 6656 } 6657 6658 @java.lang.Override getParserForType()6659 public com.google.protobuf.Parser<QueryExpansionInfo> getParserForType() { 6660 return PARSER; 6661 } 6662 6663 @java.lang.Override 6664 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getDefaultInstanceForType()6665 getDefaultInstanceForType() { 6666 return DEFAULT_INSTANCE; 6667 } 6668 } 6669 6670 public static final int RESULTS_FIELD_NUMBER = 1; 6671 6672 @SuppressWarnings("serial") 6673 private java.util.List<com.google.cloud.retail.v2.SearchResponse.SearchResult> results_; 6674 /** 6675 * 6676 * 6677 * <pre> 6678 * A list of matched items. The order represents the ranking. 6679 * </pre> 6680 * 6681 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 6682 */ 6683 @java.lang.Override getResultsList()6684 public java.util.List<com.google.cloud.retail.v2.SearchResponse.SearchResult> getResultsList() { 6685 return results_; 6686 } 6687 /** 6688 * 6689 * 6690 * <pre> 6691 * A list of matched items. The order represents the ranking. 6692 * </pre> 6693 * 6694 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 6695 */ 6696 @java.lang.Override 6697 public java.util.List<? extends com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> getResultsOrBuilderList()6698 getResultsOrBuilderList() { 6699 return results_; 6700 } 6701 /** 6702 * 6703 * 6704 * <pre> 6705 * A list of matched items. The order represents the ranking. 6706 * </pre> 6707 * 6708 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 6709 */ 6710 @java.lang.Override getResultsCount()6711 public int getResultsCount() { 6712 return results_.size(); 6713 } 6714 /** 6715 * 6716 * 6717 * <pre> 6718 * A list of matched items. The order represents the ranking. 6719 * </pre> 6720 * 6721 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 6722 */ 6723 @java.lang.Override getResults(int index)6724 public com.google.cloud.retail.v2.SearchResponse.SearchResult getResults(int index) { 6725 return results_.get(index); 6726 } 6727 /** 6728 * 6729 * 6730 * <pre> 6731 * A list of matched items. The order represents the ranking. 6732 * </pre> 6733 * 6734 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 6735 */ 6736 @java.lang.Override getResultsOrBuilder( int index)6737 public com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( 6738 int index) { 6739 return results_.get(index); 6740 } 6741 6742 public static final int FACETS_FIELD_NUMBER = 2; 6743 6744 @SuppressWarnings("serial") 6745 private java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet> facets_; 6746 /** 6747 * 6748 * 6749 * <pre> 6750 * Results of facets requested by user. 6751 * </pre> 6752 * 6753 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 6754 */ 6755 @java.lang.Override getFacetsList()6756 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet> getFacetsList() { 6757 return facets_; 6758 } 6759 /** 6760 * 6761 * 6762 * <pre> 6763 * Results of facets requested by user. 6764 * </pre> 6765 * 6766 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 6767 */ 6768 @java.lang.Override 6769 public java.util.List<? extends com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> getFacetsOrBuilderList()6770 getFacetsOrBuilderList() { 6771 return facets_; 6772 } 6773 /** 6774 * 6775 * 6776 * <pre> 6777 * Results of facets requested by user. 6778 * </pre> 6779 * 6780 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 6781 */ 6782 @java.lang.Override getFacetsCount()6783 public int getFacetsCount() { 6784 return facets_.size(); 6785 } 6786 /** 6787 * 6788 * 6789 * <pre> 6790 * Results of facets requested by user. 6791 * </pre> 6792 * 6793 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 6794 */ 6795 @java.lang.Override getFacets(int index)6796 public com.google.cloud.retail.v2.SearchResponse.Facet getFacets(int index) { 6797 return facets_.get(index); 6798 } 6799 /** 6800 * 6801 * 6802 * <pre> 6803 * Results of facets requested by user. 6804 * </pre> 6805 * 6806 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 6807 */ 6808 @java.lang.Override getFacetsOrBuilder(int index)6809 public com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index) { 6810 return facets_.get(index); 6811 } 6812 6813 public static final int TOTAL_SIZE_FIELD_NUMBER = 3; 6814 private int totalSize_ = 0; 6815 /** 6816 * 6817 * 6818 * <pre> 6819 * The estimated total count of matched items irrespective of pagination. The 6820 * count of [results][google.cloud.retail.v2.SearchResponse.results] returned 6821 * by pagination may be less than the 6822 * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that 6823 * matches. 6824 * </pre> 6825 * 6826 * <code>int32 total_size = 3;</code> 6827 * 6828 * @return The totalSize. 6829 */ 6830 @java.lang.Override getTotalSize()6831 public int getTotalSize() { 6832 return totalSize_; 6833 } 6834 6835 public static final int CORRECTED_QUERY_FIELD_NUMBER = 4; 6836 6837 @SuppressWarnings("serial") 6838 private volatile java.lang.Object correctedQuery_ = ""; 6839 /** 6840 * 6841 * 6842 * <pre> 6843 * Contains the spell corrected query, if found. If the spell correction type 6844 * is AUTOMATIC, then the search results are based on corrected_query. 6845 * Otherwise the original query is used for search. 6846 * </pre> 6847 * 6848 * <code>string corrected_query = 4;</code> 6849 * 6850 * @return The correctedQuery. 6851 */ 6852 @java.lang.Override getCorrectedQuery()6853 public java.lang.String getCorrectedQuery() { 6854 java.lang.Object ref = correctedQuery_; 6855 if (ref instanceof java.lang.String) { 6856 return (java.lang.String) ref; 6857 } else { 6858 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6859 java.lang.String s = bs.toStringUtf8(); 6860 correctedQuery_ = s; 6861 return s; 6862 } 6863 } 6864 /** 6865 * 6866 * 6867 * <pre> 6868 * Contains the spell corrected query, if found. If the spell correction type 6869 * is AUTOMATIC, then the search results are based on corrected_query. 6870 * Otherwise the original query is used for search. 6871 * </pre> 6872 * 6873 * <code>string corrected_query = 4;</code> 6874 * 6875 * @return The bytes for correctedQuery. 6876 */ 6877 @java.lang.Override getCorrectedQueryBytes()6878 public com.google.protobuf.ByteString getCorrectedQueryBytes() { 6879 java.lang.Object ref = correctedQuery_; 6880 if (ref instanceof java.lang.String) { 6881 com.google.protobuf.ByteString b = 6882 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6883 correctedQuery_ = b; 6884 return b; 6885 } else { 6886 return (com.google.protobuf.ByteString) ref; 6887 } 6888 } 6889 6890 public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 5; 6891 6892 @SuppressWarnings("serial") 6893 private volatile java.lang.Object attributionToken_ = ""; 6894 /** 6895 * 6896 * 6897 * <pre> 6898 * A unique search token. This should be included in the 6899 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 6900 * search, which enables accurate attribution of search model performance. 6901 * </pre> 6902 * 6903 * <code>string attribution_token = 5;</code> 6904 * 6905 * @return The attributionToken. 6906 */ 6907 @java.lang.Override getAttributionToken()6908 public java.lang.String getAttributionToken() { 6909 java.lang.Object ref = attributionToken_; 6910 if (ref instanceof java.lang.String) { 6911 return (java.lang.String) ref; 6912 } else { 6913 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6914 java.lang.String s = bs.toStringUtf8(); 6915 attributionToken_ = s; 6916 return s; 6917 } 6918 } 6919 /** 6920 * 6921 * 6922 * <pre> 6923 * A unique search token. This should be included in the 6924 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 6925 * search, which enables accurate attribution of search model performance. 6926 * </pre> 6927 * 6928 * <code>string attribution_token = 5;</code> 6929 * 6930 * @return The bytes for attributionToken. 6931 */ 6932 @java.lang.Override getAttributionTokenBytes()6933 public com.google.protobuf.ByteString getAttributionTokenBytes() { 6934 java.lang.Object ref = attributionToken_; 6935 if (ref instanceof java.lang.String) { 6936 com.google.protobuf.ByteString b = 6937 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6938 attributionToken_ = b; 6939 return b; 6940 } else { 6941 return (com.google.protobuf.ByteString) ref; 6942 } 6943 } 6944 6945 public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 6; 6946 6947 @SuppressWarnings("serial") 6948 private volatile java.lang.Object nextPageToken_ = ""; 6949 /** 6950 * 6951 * 6952 * <pre> 6953 * A token that can be sent as 6954 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 6955 * to retrieve the next page. If this field is omitted, there are no 6956 * subsequent pages. 6957 * </pre> 6958 * 6959 * <code>string next_page_token = 6;</code> 6960 * 6961 * @return The nextPageToken. 6962 */ 6963 @java.lang.Override getNextPageToken()6964 public java.lang.String getNextPageToken() { 6965 java.lang.Object ref = nextPageToken_; 6966 if (ref instanceof java.lang.String) { 6967 return (java.lang.String) ref; 6968 } else { 6969 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 6970 java.lang.String s = bs.toStringUtf8(); 6971 nextPageToken_ = s; 6972 return s; 6973 } 6974 } 6975 /** 6976 * 6977 * 6978 * <pre> 6979 * A token that can be sent as 6980 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 6981 * to retrieve the next page. If this field is omitted, there are no 6982 * subsequent pages. 6983 * </pre> 6984 * 6985 * <code>string next_page_token = 6;</code> 6986 * 6987 * @return The bytes for nextPageToken. 6988 */ 6989 @java.lang.Override getNextPageTokenBytes()6990 public com.google.protobuf.ByteString getNextPageTokenBytes() { 6991 java.lang.Object ref = nextPageToken_; 6992 if (ref instanceof java.lang.String) { 6993 com.google.protobuf.ByteString b = 6994 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 6995 nextPageToken_ = b; 6996 return b; 6997 } else { 6998 return (com.google.protobuf.ByteString) ref; 6999 } 7000 } 7001 7002 public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 7; 7003 private com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo queryExpansionInfo_; 7004 /** 7005 * 7006 * 7007 * <pre> 7008 * Query expansion information for the returned results. 7009 * </pre> 7010 * 7011 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 7012 * </code> 7013 * 7014 * @return Whether the queryExpansionInfo field is set. 7015 */ 7016 @java.lang.Override hasQueryExpansionInfo()7017 public boolean hasQueryExpansionInfo() { 7018 return queryExpansionInfo_ != null; 7019 } 7020 /** 7021 * 7022 * 7023 * <pre> 7024 * Query expansion information for the returned results. 7025 * </pre> 7026 * 7027 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 7028 * </code> 7029 * 7030 * @return The queryExpansionInfo. 7031 */ 7032 @java.lang.Override getQueryExpansionInfo()7033 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { 7034 return queryExpansionInfo_ == null 7035 ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() 7036 : queryExpansionInfo_; 7037 } 7038 /** 7039 * 7040 * 7041 * <pre> 7042 * Query expansion information for the returned results. 7043 * </pre> 7044 * 7045 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 7046 * </code> 7047 */ 7048 @java.lang.Override 7049 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder getQueryExpansionInfoOrBuilder()7050 getQueryExpansionInfoOrBuilder() { 7051 return queryExpansionInfo_ == null 7052 ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() 7053 : queryExpansionInfo_; 7054 } 7055 7056 public static final int REDIRECT_URI_FIELD_NUMBER = 10; 7057 7058 @SuppressWarnings("serial") 7059 private volatile java.lang.Object redirectUri_ = ""; 7060 /** 7061 * 7062 * 7063 * <pre> 7064 * The URI of a customer-defined redirect page. If redirect action is 7065 * triggered, no search is performed, and only 7066 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 7067 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 7068 * are set in the response. 7069 * </pre> 7070 * 7071 * <code>string redirect_uri = 10;</code> 7072 * 7073 * @return The redirectUri. 7074 */ 7075 @java.lang.Override getRedirectUri()7076 public java.lang.String getRedirectUri() { 7077 java.lang.Object ref = redirectUri_; 7078 if (ref instanceof java.lang.String) { 7079 return (java.lang.String) ref; 7080 } else { 7081 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 7082 java.lang.String s = bs.toStringUtf8(); 7083 redirectUri_ = s; 7084 return s; 7085 } 7086 } 7087 /** 7088 * 7089 * 7090 * <pre> 7091 * The URI of a customer-defined redirect page. If redirect action is 7092 * triggered, no search is performed, and only 7093 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 7094 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 7095 * are set in the response. 7096 * </pre> 7097 * 7098 * <code>string redirect_uri = 10;</code> 7099 * 7100 * @return The bytes for redirectUri. 7101 */ 7102 @java.lang.Override getRedirectUriBytes()7103 public com.google.protobuf.ByteString getRedirectUriBytes() { 7104 java.lang.Object ref = redirectUri_; 7105 if (ref instanceof java.lang.String) { 7106 com.google.protobuf.ByteString b = 7107 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 7108 redirectUri_ = b; 7109 return b; 7110 } else { 7111 return (com.google.protobuf.ByteString) ref; 7112 } 7113 } 7114 7115 public static final int APPLIED_CONTROLS_FIELD_NUMBER = 12; 7116 7117 @SuppressWarnings("serial") 7118 private com.google.protobuf.LazyStringList appliedControls_; 7119 /** 7120 * 7121 * 7122 * <pre> 7123 * The fully qualified resource name of applied 7124 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 7125 * </pre> 7126 * 7127 * <code>repeated string applied_controls = 12;</code> 7128 * 7129 * @return A list containing the appliedControls. 7130 */ getAppliedControlsList()7131 public com.google.protobuf.ProtocolStringList getAppliedControlsList() { 7132 return appliedControls_; 7133 } 7134 /** 7135 * 7136 * 7137 * <pre> 7138 * The fully qualified resource name of applied 7139 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 7140 * </pre> 7141 * 7142 * <code>repeated string applied_controls = 12;</code> 7143 * 7144 * @return The count of appliedControls. 7145 */ getAppliedControlsCount()7146 public int getAppliedControlsCount() { 7147 return appliedControls_.size(); 7148 } 7149 /** 7150 * 7151 * 7152 * <pre> 7153 * The fully qualified resource name of applied 7154 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 7155 * </pre> 7156 * 7157 * <code>repeated string applied_controls = 12;</code> 7158 * 7159 * @param index The index of the element to return. 7160 * @return The appliedControls at the given index. 7161 */ getAppliedControls(int index)7162 public java.lang.String getAppliedControls(int index) { 7163 return appliedControls_.get(index); 7164 } 7165 /** 7166 * 7167 * 7168 * <pre> 7169 * The fully qualified resource name of applied 7170 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 7171 * </pre> 7172 * 7173 * <code>repeated string applied_controls = 12;</code> 7174 * 7175 * @param index The index of the value to return. 7176 * @return The bytes of the appliedControls at the given index. 7177 */ getAppliedControlsBytes(int index)7178 public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { 7179 return appliedControls_.getByteString(index); 7180 } 7181 7182 public static final int INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER = 14; 7183 7184 @SuppressWarnings("serial") 7185 private java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> 7186 invalidConditionBoostSpecs_; 7187 /** 7188 * 7189 * 7190 * <pre> 7191 * The invalid 7192 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 7193 * that are not applied during serving. 7194 * </pre> 7195 * 7196 * <code> 7197 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 7198 * </code> 7199 */ 7200 @java.lang.Override 7201 public java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> getInvalidConditionBoostSpecsList()7202 getInvalidConditionBoostSpecsList() { 7203 return invalidConditionBoostSpecs_; 7204 } 7205 /** 7206 * 7207 * 7208 * <pre> 7209 * The invalid 7210 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 7211 * that are not applied during serving. 7212 * </pre> 7213 * 7214 * <code> 7215 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 7216 * </code> 7217 */ 7218 @java.lang.Override 7219 public java.util.List< 7220 ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> getInvalidConditionBoostSpecsOrBuilderList()7221 getInvalidConditionBoostSpecsOrBuilderList() { 7222 return invalidConditionBoostSpecs_; 7223 } 7224 /** 7225 * 7226 * 7227 * <pre> 7228 * The invalid 7229 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 7230 * that are not applied during serving. 7231 * </pre> 7232 * 7233 * <code> 7234 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 7235 * </code> 7236 */ 7237 @java.lang.Override getInvalidConditionBoostSpecsCount()7238 public int getInvalidConditionBoostSpecsCount() { 7239 return invalidConditionBoostSpecs_.size(); 7240 } 7241 /** 7242 * 7243 * 7244 * <pre> 7245 * The invalid 7246 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 7247 * that are not applied during serving. 7248 * </pre> 7249 * 7250 * <code> 7251 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 7252 * </code> 7253 */ 7254 @java.lang.Override 7255 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec getInvalidConditionBoostSpecs(int index)7256 getInvalidConditionBoostSpecs(int index) { 7257 return invalidConditionBoostSpecs_.get(index); 7258 } 7259 /** 7260 * 7261 * 7262 * <pre> 7263 * The invalid 7264 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 7265 * that are not applied during serving. 7266 * </pre> 7267 * 7268 * <code> 7269 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 7270 * </code> 7271 */ 7272 @java.lang.Override 7273 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder getInvalidConditionBoostSpecsOrBuilder(int index)7274 getInvalidConditionBoostSpecsOrBuilder(int index) { 7275 return invalidConditionBoostSpecs_.get(index); 7276 } 7277 7278 public static final int EXPERIMENT_INFO_FIELD_NUMBER = 17; 7279 7280 @SuppressWarnings("serial") 7281 private java.util.List<com.google.cloud.retail.v2.ExperimentInfo> experimentInfo_; 7282 /** 7283 * 7284 * 7285 * <pre> 7286 * Metadata related to A/B testing [Experiment][] associated with this 7287 * response. Only exists when an experiment is triggered. 7288 * </pre> 7289 * 7290 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 7291 */ 7292 @java.lang.Override getExperimentInfoList()7293 public java.util.List<com.google.cloud.retail.v2.ExperimentInfo> getExperimentInfoList() { 7294 return experimentInfo_; 7295 } 7296 /** 7297 * 7298 * 7299 * <pre> 7300 * Metadata related to A/B testing [Experiment][] associated with this 7301 * response. Only exists when an experiment is triggered. 7302 * </pre> 7303 * 7304 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 7305 */ 7306 @java.lang.Override 7307 public java.util.List<? extends com.google.cloud.retail.v2.ExperimentInfoOrBuilder> getExperimentInfoOrBuilderList()7308 getExperimentInfoOrBuilderList() { 7309 return experimentInfo_; 7310 } 7311 /** 7312 * 7313 * 7314 * <pre> 7315 * Metadata related to A/B testing [Experiment][] associated with this 7316 * response. Only exists when an experiment is triggered. 7317 * </pre> 7318 * 7319 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 7320 */ 7321 @java.lang.Override getExperimentInfoCount()7322 public int getExperimentInfoCount() { 7323 return experimentInfo_.size(); 7324 } 7325 /** 7326 * 7327 * 7328 * <pre> 7329 * Metadata related to A/B testing [Experiment][] associated with this 7330 * response. Only exists when an experiment is triggered. 7331 * </pre> 7332 * 7333 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 7334 */ 7335 @java.lang.Override getExperimentInfo(int index)7336 public com.google.cloud.retail.v2.ExperimentInfo getExperimentInfo(int index) { 7337 return experimentInfo_.get(index); 7338 } 7339 /** 7340 * 7341 * 7342 * <pre> 7343 * Metadata related to A/B testing [Experiment][] associated with this 7344 * response. Only exists when an experiment is triggered. 7345 * </pre> 7346 * 7347 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 7348 */ 7349 @java.lang.Override getExperimentInfoOrBuilder(int index)7350 public com.google.cloud.retail.v2.ExperimentInfoOrBuilder getExperimentInfoOrBuilder(int index) { 7351 return experimentInfo_.get(index); 7352 } 7353 7354 private byte memoizedIsInitialized = -1; 7355 7356 @java.lang.Override isInitialized()7357 public final boolean isInitialized() { 7358 byte isInitialized = memoizedIsInitialized; 7359 if (isInitialized == 1) return true; 7360 if (isInitialized == 0) return false; 7361 7362 memoizedIsInitialized = 1; 7363 return true; 7364 } 7365 7366 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)7367 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 7368 for (int i = 0; i < results_.size(); i++) { 7369 output.writeMessage(1, results_.get(i)); 7370 } 7371 for (int i = 0; i < facets_.size(); i++) { 7372 output.writeMessage(2, facets_.get(i)); 7373 } 7374 if (totalSize_ != 0) { 7375 output.writeInt32(3, totalSize_); 7376 } 7377 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { 7378 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, correctedQuery_); 7379 } 7380 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { 7381 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attributionToken_); 7382 } 7383 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { 7384 com.google.protobuf.GeneratedMessageV3.writeString(output, 6, nextPageToken_); 7385 } 7386 if (queryExpansionInfo_ != null) { 7387 output.writeMessage(7, getQueryExpansionInfo()); 7388 } 7389 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { 7390 com.google.protobuf.GeneratedMessageV3.writeString(output, 10, redirectUri_); 7391 } 7392 for (int i = 0; i < appliedControls_.size(); i++) { 7393 com.google.protobuf.GeneratedMessageV3.writeString(output, 12, appliedControls_.getRaw(i)); 7394 } 7395 for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { 7396 output.writeMessage(14, invalidConditionBoostSpecs_.get(i)); 7397 } 7398 for (int i = 0; i < experimentInfo_.size(); i++) { 7399 output.writeMessage(17, experimentInfo_.get(i)); 7400 } 7401 getUnknownFields().writeTo(output); 7402 } 7403 7404 @java.lang.Override getSerializedSize()7405 public int getSerializedSize() { 7406 int size = memoizedSize; 7407 if (size != -1) return size; 7408 7409 size = 0; 7410 for (int i = 0; i < results_.size(); i++) { 7411 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); 7412 } 7413 for (int i = 0; i < facets_.size(); i++) { 7414 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, facets_.get(i)); 7415 } 7416 if (totalSize_ != 0) { 7417 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); 7418 } 7419 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { 7420 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, correctedQuery_); 7421 } 7422 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { 7423 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attributionToken_); 7424 } 7425 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { 7426 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, nextPageToken_); 7427 } 7428 if (queryExpansionInfo_ != null) { 7429 size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getQueryExpansionInfo()); 7430 } 7431 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { 7432 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, redirectUri_); 7433 } 7434 { 7435 int dataSize = 0; 7436 for (int i = 0; i < appliedControls_.size(); i++) { 7437 dataSize += computeStringSizeNoTag(appliedControls_.getRaw(i)); 7438 } 7439 size += dataSize; 7440 size += 1 * getAppliedControlsList().size(); 7441 } 7442 for (int i = 0; i < invalidConditionBoostSpecs_.size(); i++) { 7443 size += 7444 com.google.protobuf.CodedOutputStream.computeMessageSize( 7445 14, invalidConditionBoostSpecs_.get(i)); 7446 } 7447 for (int i = 0; i < experimentInfo_.size(); i++) { 7448 size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, experimentInfo_.get(i)); 7449 } 7450 size += getUnknownFields().getSerializedSize(); 7451 memoizedSize = size; 7452 return size; 7453 } 7454 7455 @java.lang.Override equals(final java.lang.Object obj)7456 public boolean equals(final java.lang.Object obj) { 7457 if (obj == this) { 7458 return true; 7459 } 7460 if (!(obj instanceof com.google.cloud.retail.v2.SearchResponse)) { 7461 return super.equals(obj); 7462 } 7463 com.google.cloud.retail.v2.SearchResponse other = 7464 (com.google.cloud.retail.v2.SearchResponse) obj; 7465 7466 if (!getResultsList().equals(other.getResultsList())) return false; 7467 if (!getFacetsList().equals(other.getFacetsList())) return false; 7468 if (getTotalSize() != other.getTotalSize()) return false; 7469 if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; 7470 if (!getAttributionToken().equals(other.getAttributionToken())) return false; 7471 if (!getNextPageToken().equals(other.getNextPageToken())) return false; 7472 if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; 7473 if (hasQueryExpansionInfo()) { 7474 if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; 7475 } 7476 if (!getRedirectUri().equals(other.getRedirectUri())) return false; 7477 if (!getAppliedControlsList().equals(other.getAppliedControlsList())) return false; 7478 if (!getInvalidConditionBoostSpecsList().equals(other.getInvalidConditionBoostSpecsList())) 7479 return false; 7480 if (!getExperimentInfoList().equals(other.getExperimentInfoList())) return false; 7481 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 7482 return true; 7483 } 7484 7485 @java.lang.Override hashCode()7486 public int hashCode() { 7487 if (memoizedHashCode != 0) { 7488 return memoizedHashCode; 7489 } 7490 int hash = 41; 7491 hash = (19 * hash) + getDescriptor().hashCode(); 7492 if (getResultsCount() > 0) { 7493 hash = (37 * hash) + RESULTS_FIELD_NUMBER; 7494 hash = (53 * hash) + getResultsList().hashCode(); 7495 } 7496 if (getFacetsCount() > 0) { 7497 hash = (37 * hash) + FACETS_FIELD_NUMBER; 7498 hash = (53 * hash) + getFacetsList().hashCode(); 7499 } 7500 hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; 7501 hash = (53 * hash) + getTotalSize(); 7502 hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; 7503 hash = (53 * hash) + getCorrectedQuery().hashCode(); 7504 hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; 7505 hash = (53 * hash) + getAttributionToken().hashCode(); 7506 hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; 7507 hash = (53 * hash) + getNextPageToken().hashCode(); 7508 if (hasQueryExpansionInfo()) { 7509 hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; 7510 hash = (53 * hash) + getQueryExpansionInfo().hashCode(); 7511 } 7512 hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; 7513 hash = (53 * hash) + getRedirectUri().hashCode(); 7514 if (getAppliedControlsCount() > 0) { 7515 hash = (37 * hash) + APPLIED_CONTROLS_FIELD_NUMBER; 7516 hash = (53 * hash) + getAppliedControlsList().hashCode(); 7517 } 7518 if (getInvalidConditionBoostSpecsCount() > 0) { 7519 hash = (37 * hash) + INVALID_CONDITION_BOOST_SPECS_FIELD_NUMBER; 7520 hash = (53 * hash) + getInvalidConditionBoostSpecsList().hashCode(); 7521 } 7522 if (getExperimentInfoCount() > 0) { 7523 hash = (37 * hash) + EXPERIMENT_INFO_FIELD_NUMBER; 7524 hash = (53 * hash) + getExperimentInfoList().hashCode(); 7525 } 7526 hash = (29 * hash) + getUnknownFields().hashCode(); 7527 memoizedHashCode = hash; 7528 return hash; 7529 } 7530 parseFrom(java.nio.ByteBuffer data)7531 public static com.google.cloud.retail.v2.SearchResponse parseFrom(java.nio.ByteBuffer data) 7532 throws com.google.protobuf.InvalidProtocolBufferException { 7533 return PARSER.parseFrom(data); 7534 } 7535 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7536 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7537 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7538 throws com.google.protobuf.InvalidProtocolBufferException { 7539 return PARSER.parseFrom(data, extensionRegistry); 7540 } 7541 parseFrom( com.google.protobuf.ByteString data)7542 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7543 com.google.protobuf.ByteString data) 7544 throws com.google.protobuf.InvalidProtocolBufferException { 7545 return PARSER.parseFrom(data); 7546 } 7547 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7548 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7549 com.google.protobuf.ByteString data, 7550 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7551 throws com.google.protobuf.InvalidProtocolBufferException { 7552 return PARSER.parseFrom(data, extensionRegistry); 7553 } 7554 parseFrom(byte[] data)7555 public static com.google.cloud.retail.v2.SearchResponse parseFrom(byte[] data) 7556 throws com.google.protobuf.InvalidProtocolBufferException { 7557 return PARSER.parseFrom(data); 7558 } 7559 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7560 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7561 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7562 throws com.google.protobuf.InvalidProtocolBufferException { 7563 return PARSER.parseFrom(data, extensionRegistry); 7564 } 7565 parseFrom(java.io.InputStream input)7566 public static com.google.cloud.retail.v2.SearchResponse parseFrom(java.io.InputStream input) 7567 throws java.io.IOException { 7568 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 7569 } 7570 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7571 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7572 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7573 throws java.io.IOException { 7574 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 7575 PARSER, input, extensionRegistry); 7576 } 7577 parseDelimitedFrom( java.io.InputStream input)7578 public static com.google.cloud.retail.v2.SearchResponse parseDelimitedFrom( 7579 java.io.InputStream input) throws java.io.IOException { 7580 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 7581 } 7582 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7583 public static com.google.cloud.retail.v2.SearchResponse parseDelimitedFrom( 7584 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7585 throws java.io.IOException { 7586 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 7587 PARSER, input, extensionRegistry); 7588 } 7589 parseFrom( com.google.protobuf.CodedInputStream input)7590 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7591 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 7592 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 7593 } 7594 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)7595 public static com.google.cloud.retail.v2.SearchResponse parseFrom( 7596 com.google.protobuf.CodedInputStream input, 7597 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 7598 throws java.io.IOException { 7599 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 7600 PARSER, input, extensionRegistry); 7601 } 7602 7603 @java.lang.Override newBuilderForType()7604 public Builder newBuilderForType() { 7605 return newBuilder(); 7606 } 7607 newBuilder()7608 public static Builder newBuilder() { 7609 return DEFAULT_INSTANCE.toBuilder(); 7610 } 7611 newBuilder(com.google.cloud.retail.v2.SearchResponse prototype)7612 public static Builder newBuilder(com.google.cloud.retail.v2.SearchResponse prototype) { 7613 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 7614 } 7615 7616 @java.lang.Override toBuilder()7617 public Builder toBuilder() { 7618 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 7619 } 7620 7621 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)7622 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 7623 Builder builder = new Builder(parent); 7624 return builder; 7625 } 7626 /** 7627 * 7628 * 7629 * <pre> 7630 * Response message for 7631 * [SearchService.Search][google.cloud.retail.v2.SearchService.Search] method. 7632 * </pre> 7633 * 7634 * Protobuf type {@code google.cloud.retail.v2.SearchResponse} 7635 */ 7636 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 7637 implements 7638 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.SearchResponse) 7639 com.google.cloud.retail.v2.SearchResponseOrBuilder { getDescriptor()7640 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 7641 return com.google.cloud.retail.v2.SearchServiceProto 7642 .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; 7643 } 7644 7645 @java.lang.Override 7646 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()7647 internalGetFieldAccessorTable() { 7648 return com.google.cloud.retail.v2.SearchServiceProto 7649 .internal_static_google_cloud_retail_v2_SearchResponse_fieldAccessorTable 7650 .ensureFieldAccessorsInitialized( 7651 com.google.cloud.retail.v2.SearchResponse.class, 7652 com.google.cloud.retail.v2.SearchResponse.Builder.class); 7653 } 7654 7655 // Construct using com.google.cloud.retail.v2.SearchResponse.newBuilder() Builder()7656 private Builder() {} 7657 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)7658 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 7659 super(parent); 7660 } 7661 7662 @java.lang.Override clear()7663 public Builder clear() { 7664 super.clear(); 7665 bitField0_ = 0; 7666 if (resultsBuilder_ == null) { 7667 results_ = java.util.Collections.emptyList(); 7668 } else { 7669 results_ = null; 7670 resultsBuilder_.clear(); 7671 } 7672 bitField0_ = (bitField0_ & ~0x00000001); 7673 if (facetsBuilder_ == null) { 7674 facets_ = java.util.Collections.emptyList(); 7675 } else { 7676 facets_ = null; 7677 facetsBuilder_.clear(); 7678 } 7679 bitField0_ = (bitField0_ & ~0x00000002); 7680 totalSize_ = 0; 7681 correctedQuery_ = ""; 7682 attributionToken_ = ""; 7683 nextPageToken_ = ""; 7684 queryExpansionInfo_ = null; 7685 if (queryExpansionInfoBuilder_ != null) { 7686 queryExpansionInfoBuilder_.dispose(); 7687 queryExpansionInfoBuilder_ = null; 7688 } 7689 redirectUri_ = ""; 7690 appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; 7691 bitField0_ = (bitField0_ & ~0x00000100); 7692 if (invalidConditionBoostSpecsBuilder_ == null) { 7693 invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); 7694 } else { 7695 invalidConditionBoostSpecs_ = null; 7696 invalidConditionBoostSpecsBuilder_.clear(); 7697 } 7698 bitField0_ = (bitField0_ & ~0x00000200); 7699 if (experimentInfoBuilder_ == null) { 7700 experimentInfo_ = java.util.Collections.emptyList(); 7701 } else { 7702 experimentInfo_ = null; 7703 experimentInfoBuilder_.clear(); 7704 } 7705 bitField0_ = (bitField0_ & ~0x00000400); 7706 return this; 7707 } 7708 7709 @java.lang.Override getDescriptorForType()7710 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 7711 return com.google.cloud.retail.v2.SearchServiceProto 7712 .internal_static_google_cloud_retail_v2_SearchResponse_descriptor; 7713 } 7714 7715 @java.lang.Override getDefaultInstanceForType()7716 public com.google.cloud.retail.v2.SearchResponse getDefaultInstanceForType() { 7717 return com.google.cloud.retail.v2.SearchResponse.getDefaultInstance(); 7718 } 7719 7720 @java.lang.Override build()7721 public com.google.cloud.retail.v2.SearchResponse build() { 7722 com.google.cloud.retail.v2.SearchResponse result = buildPartial(); 7723 if (!result.isInitialized()) { 7724 throw newUninitializedMessageException(result); 7725 } 7726 return result; 7727 } 7728 7729 @java.lang.Override buildPartial()7730 public com.google.cloud.retail.v2.SearchResponse buildPartial() { 7731 com.google.cloud.retail.v2.SearchResponse result = 7732 new com.google.cloud.retail.v2.SearchResponse(this); 7733 buildPartialRepeatedFields(result); 7734 if (bitField0_ != 0) { 7735 buildPartial0(result); 7736 } 7737 onBuilt(); 7738 return result; 7739 } 7740 buildPartialRepeatedFields(com.google.cloud.retail.v2.SearchResponse result)7741 private void buildPartialRepeatedFields(com.google.cloud.retail.v2.SearchResponse result) { 7742 if (resultsBuilder_ == null) { 7743 if (((bitField0_ & 0x00000001) != 0)) { 7744 results_ = java.util.Collections.unmodifiableList(results_); 7745 bitField0_ = (bitField0_ & ~0x00000001); 7746 } 7747 result.results_ = results_; 7748 } else { 7749 result.results_ = resultsBuilder_.build(); 7750 } 7751 if (facetsBuilder_ == null) { 7752 if (((bitField0_ & 0x00000002) != 0)) { 7753 facets_ = java.util.Collections.unmodifiableList(facets_); 7754 bitField0_ = (bitField0_ & ~0x00000002); 7755 } 7756 result.facets_ = facets_; 7757 } else { 7758 result.facets_ = facetsBuilder_.build(); 7759 } 7760 if (((bitField0_ & 0x00000100) != 0)) { 7761 appliedControls_ = appliedControls_.getUnmodifiableView(); 7762 bitField0_ = (bitField0_ & ~0x00000100); 7763 } 7764 result.appliedControls_ = appliedControls_; 7765 if (invalidConditionBoostSpecsBuilder_ == null) { 7766 if (((bitField0_ & 0x00000200) != 0)) { 7767 invalidConditionBoostSpecs_ = 7768 java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); 7769 bitField0_ = (bitField0_ & ~0x00000200); 7770 } 7771 result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecs_; 7772 } else { 7773 result.invalidConditionBoostSpecs_ = invalidConditionBoostSpecsBuilder_.build(); 7774 } 7775 if (experimentInfoBuilder_ == null) { 7776 if (((bitField0_ & 0x00000400) != 0)) { 7777 experimentInfo_ = java.util.Collections.unmodifiableList(experimentInfo_); 7778 bitField0_ = (bitField0_ & ~0x00000400); 7779 } 7780 result.experimentInfo_ = experimentInfo_; 7781 } else { 7782 result.experimentInfo_ = experimentInfoBuilder_.build(); 7783 } 7784 } 7785 buildPartial0(com.google.cloud.retail.v2.SearchResponse result)7786 private void buildPartial0(com.google.cloud.retail.v2.SearchResponse result) { 7787 int from_bitField0_ = bitField0_; 7788 if (((from_bitField0_ & 0x00000004) != 0)) { 7789 result.totalSize_ = totalSize_; 7790 } 7791 if (((from_bitField0_ & 0x00000008) != 0)) { 7792 result.correctedQuery_ = correctedQuery_; 7793 } 7794 if (((from_bitField0_ & 0x00000010) != 0)) { 7795 result.attributionToken_ = attributionToken_; 7796 } 7797 if (((from_bitField0_ & 0x00000020) != 0)) { 7798 result.nextPageToken_ = nextPageToken_; 7799 } 7800 if (((from_bitField0_ & 0x00000040) != 0)) { 7801 result.queryExpansionInfo_ = 7802 queryExpansionInfoBuilder_ == null 7803 ? queryExpansionInfo_ 7804 : queryExpansionInfoBuilder_.build(); 7805 } 7806 if (((from_bitField0_ & 0x00000080) != 0)) { 7807 result.redirectUri_ = redirectUri_; 7808 } 7809 } 7810 7811 @java.lang.Override clone()7812 public Builder clone() { 7813 return super.clone(); 7814 } 7815 7816 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)7817 public Builder setField( 7818 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 7819 return super.setField(field, value); 7820 } 7821 7822 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)7823 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 7824 return super.clearField(field); 7825 } 7826 7827 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)7828 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 7829 return super.clearOneof(oneof); 7830 } 7831 7832 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)7833 public Builder setRepeatedField( 7834 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 7835 return super.setRepeatedField(field, index, value); 7836 } 7837 7838 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)7839 public Builder addRepeatedField( 7840 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 7841 return super.addRepeatedField(field, value); 7842 } 7843 7844 @java.lang.Override mergeFrom(com.google.protobuf.Message other)7845 public Builder mergeFrom(com.google.protobuf.Message other) { 7846 if (other instanceof com.google.cloud.retail.v2.SearchResponse) { 7847 return mergeFrom((com.google.cloud.retail.v2.SearchResponse) other); 7848 } else { 7849 super.mergeFrom(other); 7850 return this; 7851 } 7852 } 7853 mergeFrom(com.google.cloud.retail.v2.SearchResponse other)7854 public Builder mergeFrom(com.google.cloud.retail.v2.SearchResponse other) { 7855 if (other == com.google.cloud.retail.v2.SearchResponse.getDefaultInstance()) return this; 7856 if (resultsBuilder_ == null) { 7857 if (!other.results_.isEmpty()) { 7858 if (results_.isEmpty()) { 7859 results_ = other.results_; 7860 bitField0_ = (bitField0_ & ~0x00000001); 7861 } else { 7862 ensureResultsIsMutable(); 7863 results_.addAll(other.results_); 7864 } 7865 onChanged(); 7866 } 7867 } else { 7868 if (!other.results_.isEmpty()) { 7869 if (resultsBuilder_.isEmpty()) { 7870 resultsBuilder_.dispose(); 7871 resultsBuilder_ = null; 7872 results_ = other.results_; 7873 bitField0_ = (bitField0_ & ~0x00000001); 7874 resultsBuilder_ = 7875 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 7876 ? getResultsFieldBuilder() 7877 : null; 7878 } else { 7879 resultsBuilder_.addAllMessages(other.results_); 7880 } 7881 } 7882 } 7883 if (facetsBuilder_ == null) { 7884 if (!other.facets_.isEmpty()) { 7885 if (facets_.isEmpty()) { 7886 facets_ = other.facets_; 7887 bitField0_ = (bitField0_ & ~0x00000002); 7888 } else { 7889 ensureFacetsIsMutable(); 7890 facets_.addAll(other.facets_); 7891 } 7892 onChanged(); 7893 } 7894 } else { 7895 if (!other.facets_.isEmpty()) { 7896 if (facetsBuilder_.isEmpty()) { 7897 facetsBuilder_.dispose(); 7898 facetsBuilder_ = null; 7899 facets_ = other.facets_; 7900 bitField0_ = (bitField0_ & ~0x00000002); 7901 facetsBuilder_ = 7902 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 7903 ? getFacetsFieldBuilder() 7904 : null; 7905 } else { 7906 facetsBuilder_.addAllMessages(other.facets_); 7907 } 7908 } 7909 } 7910 if (other.getTotalSize() != 0) { 7911 setTotalSize(other.getTotalSize()); 7912 } 7913 if (!other.getCorrectedQuery().isEmpty()) { 7914 correctedQuery_ = other.correctedQuery_; 7915 bitField0_ |= 0x00000008; 7916 onChanged(); 7917 } 7918 if (!other.getAttributionToken().isEmpty()) { 7919 attributionToken_ = other.attributionToken_; 7920 bitField0_ |= 0x00000010; 7921 onChanged(); 7922 } 7923 if (!other.getNextPageToken().isEmpty()) { 7924 nextPageToken_ = other.nextPageToken_; 7925 bitField0_ |= 0x00000020; 7926 onChanged(); 7927 } 7928 if (other.hasQueryExpansionInfo()) { 7929 mergeQueryExpansionInfo(other.getQueryExpansionInfo()); 7930 } 7931 if (!other.getRedirectUri().isEmpty()) { 7932 redirectUri_ = other.redirectUri_; 7933 bitField0_ |= 0x00000080; 7934 onChanged(); 7935 } 7936 if (!other.appliedControls_.isEmpty()) { 7937 if (appliedControls_.isEmpty()) { 7938 appliedControls_ = other.appliedControls_; 7939 bitField0_ = (bitField0_ & ~0x00000100); 7940 } else { 7941 ensureAppliedControlsIsMutable(); 7942 appliedControls_.addAll(other.appliedControls_); 7943 } 7944 onChanged(); 7945 } 7946 if (invalidConditionBoostSpecsBuilder_ == null) { 7947 if (!other.invalidConditionBoostSpecs_.isEmpty()) { 7948 if (invalidConditionBoostSpecs_.isEmpty()) { 7949 invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; 7950 bitField0_ = (bitField0_ & ~0x00000200); 7951 } else { 7952 ensureInvalidConditionBoostSpecsIsMutable(); 7953 invalidConditionBoostSpecs_.addAll(other.invalidConditionBoostSpecs_); 7954 } 7955 onChanged(); 7956 } 7957 } else { 7958 if (!other.invalidConditionBoostSpecs_.isEmpty()) { 7959 if (invalidConditionBoostSpecsBuilder_.isEmpty()) { 7960 invalidConditionBoostSpecsBuilder_.dispose(); 7961 invalidConditionBoostSpecsBuilder_ = null; 7962 invalidConditionBoostSpecs_ = other.invalidConditionBoostSpecs_; 7963 bitField0_ = (bitField0_ & ~0x00000200); 7964 invalidConditionBoostSpecsBuilder_ = 7965 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 7966 ? getInvalidConditionBoostSpecsFieldBuilder() 7967 : null; 7968 } else { 7969 invalidConditionBoostSpecsBuilder_.addAllMessages(other.invalidConditionBoostSpecs_); 7970 } 7971 } 7972 } 7973 if (experimentInfoBuilder_ == null) { 7974 if (!other.experimentInfo_.isEmpty()) { 7975 if (experimentInfo_.isEmpty()) { 7976 experimentInfo_ = other.experimentInfo_; 7977 bitField0_ = (bitField0_ & ~0x00000400); 7978 } else { 7979 ensureExperimentInfoIsMutable(); 7980 experimentInfo_.addAll(other.experimentInfo_); 7981 } 7982 onChanged(); 7983 } 7984 } else { 7985 if (!other.experimentInfo_.isEmpty()) { 7986 if (experimentInfoBuilder_.isEmpty()) { 7987 experimentInfoBuilder_.dispose(); 7988 experimentInfoBuilder_ = null; 7989 experimentInfo_ = other.experimentInfo_; 7990 bitField0_ = (bitField0_ & ~0x00000400); 7991 experimentInfoBuilder_ = 7992 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 7993 ? getExperimentInfoFieldBuilder() 7994 : null; 7995 } else { 7996 experimentInfoBuilder_.addAllMessages(other.experimentInfo_); 7997 } 7998 } 7999 } 8000 this.mergeUnknownFields(other.getUnknownFields()); 8001 onChanged(); 8002 return this; 8003 } 8004 8005 @java.lang.Override isInitialized()8006 public final boolean isInitialized() { 8007 return true; 8008 } 8009 8010 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)8011 public Builder mergeFrom( 8012 com.google.protobuf.CodedInputStream input, 8013 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 8014 throws java.io.IOException { 8015 if (extensionRegistry == null) { 8016 throw new java.lang.NullPointerException(); 8017 } 8018 try { 8019 boolean done = false; 8020 while (!done) { 8021 int tag = input.readTag(); 8022 switch (tag) { 8023 case 0: 8024 done = true; 8025 break; 8026 case 10: 8027 { 8028 com.google.cloud.retail.v2.SearchResponse.SearchResult m = 8029 input.readMessage( 8030 com.google.cloud.retail.v2.SearchResponse.SearchResult.parser(), 8031 extensionRegistry); 8032 if (resultsBuilder_ == null) { 8033 ensureResultsIsMutable(); 8034 results_.add(m); 8035 } else { 8036 resultsBuilder_.addMessage(m); 8037 } 8038 break; 8039 } // case 10 8040 case 18: 8041 { 8042 com.google.cloud.retail.v2.SearchResponse.Facet m = 8043 input.readMessage( 8044 com.google.cloud.retail.v2.SearchResponse.Facet.parser(), 8045 extensionRegistry); 8046 if (facetsBuilder_ == null) { 8047 ensureFacetsIsMutable(); 8048 facets_.add(m); 8049 } else { 8050 facetsBuilder_.addMessage(m); 8051 } 8052 break; 8053 } // case 18 8054 case 24: 8055 { 8056 totalSize_ = input.readInt32(); 8057 bitField0_ |= 0x00000004; 8058 break; 8059 } // case 24 8060 case 34: 8061 { 8062 correctedQuery_ = input.readStringRequireUtf8(); 8063 bitField0_ |= 0x00000008; 8064 break; 8065 } // case 34 8066 case 42: 8067 { 8068 attributionToken_ = input.readStringRequireUtf8(); 8069 bitField0_ |= 0x00000010; 8070 break; 8071 } // case 42 8072 case 50: 8073 { 8074 nextPageToken_ = input.readStringRequireUtf8(); 8075 bitField0_ |= 0x00000020; 8076 break; 8077 } // case 50 8078 case 58: 8079 { 8080 input.readMessage( 8081 getQueryExpansionInfoFieldBuilder().getBuilder(), extensionRegistry); 8082 bitField0_ |= 0x00000040; 8083 break; 8084 } // case 58 8085 case 82: 8086 { 8087 redirectUri_ = input.readStringRequireUtf8(); 8088 bitField0_ |= 0x00000080; 8089 break; 8090 } // case 82 8091 case 98: 8092 { 8093 java.lang.String s = input.readStringRequireUtf8(); 8094 ensureAppliedControlsIsMutable(); 8095 appliedControls_.add(s); 8096 break; 8097 } // case 98 8098 case 114: 8099 { 8100 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec m = 8101 input.readMessage( 8102 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec 8103 .parser(), 8104 extensionRegistry); 8105 if (invalidConditionBoostSpecsBuilder_ == null) { 8106 ensureInvalidConditionBoostSpecsIsMutable(); 8107 invalidConditionBoostSpecs_.add(m); 8108 } else { 8109 invalidConditionBoostSpecsBuilder_.addMessage(m); 8110 } 8111 break; 8112 } // case 114 8113 case 138: 8114 { 8115 com.google.cloud.retail.v2.ExperimentInfo m = 8116 input.readMessage( 8117 com.google.cloud.retail.v2.ExperimentInfo.parser(), extensionRegistry); 8118 if (experimentInfoBuilder_ == null) { 8119 ensureExperimentInfoIsMutable(); 8120 experimentInfo_.add(m); 8121 } else { 8122 experimentInfoBuilder_.addMessage(m); 8123 } 8124 break; 8125 } // case 138 8126 default: 8127 { 8128 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 8129 done = true; // was an endgroup tag 8130 } 8131 break; 8132 } // default: 8133 } // switch (tag) 8134 } // while (!done) 8135 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 8136 throw e.unwrapIOException(); 8137 } finally { 8138 onChanged(); 8139 } // finally 8140 return this; 8141 } 8142 8143 private int bitField0_; 8144 8145 private java.util.List<com.google.cloud.retail.v2.SearchResponse.SearchResult> results_ = 8146 java.util.Collections.emptyList(); 8147 ensureResultsIsMutable()8148 private void ensureResultsIsMutable() { 8149 if (!((bitField0_ & 0x00000001) != 0)) { 8150 results_ = 8151 new java.util.ArrayList<com.google.cloud.retail.v2.SearchResponse.SearchResult>( 8152 results_); 8153 bitField0_ |= 0x00000001; 8154 } 8155 } 8156 8157 private com.google.protobuf.RepeatedFieldBuilderV3< 8158 com.google.cloud.retail.v2.SearchResponse.SearchResult, 8159 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, 8160 com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> 8161 resultsBuilder_; 8162 8163 /** 8164 * 8165 * 8166 * <pre> 8167 * A list of matched items. The order represents the ranking. 8168 * </pre> 8169 * 8170 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8171 */ getResultsList()8172 public java.util.List<com.google.cloud.retail.v2.SearchResponse.SearchResult> getResultsList() { 8173 if (resultsBuilder_ == null) { 8174 return java.util.Collections.unmodifiableList(results_); 8175 } else { 8176 return resultsBuilder_.getMessageList(); 8177 } 8178 } 8179 /** 8180 * 8181 * 8182 * <pre> 8183 * A list of matched items. The order represents the ranking. 8184 * </pre> 8185 * 8186 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8187 */ getResultsCount()8188 public int getResultsCount() { 8189 if (resultsBuilder_ == null) { 8190 return results_.size(); 8191 } else { 8192 return resultsBuilder_.getCount(); 8193 } 8194 } 8195 /** 8196 * 8197 * 8198 * <pre> 8199 * A list of matched items. The order represents the ranking. 8200 * </pre> 8201 * 8202 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8203 */ getResults(int index)8204 public com.google.cloud.retail.v2.SearchResponse.SearchResult getResults(int index) { 8205 if (resultsBuilder_ == null) { 8206 return results_.get(index); 8207 } else { 8208 return resultsBuilder_.getMessage(index); 8209 } 8210 } 8211 /** 8212 * 8213 * 8214 * <pre> 8215 * A list of matched items. The order represents the ranking. 8216 * </pre> 8217 * 8218 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8219 */ setResults( int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value)8220 public Builder setResults( 8221 int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value) { 8222 if (resultsBuilder_ == null) { 8223 if (value == null) { 8224 throw new NullPointerException(); 8225 } 8226 ensureResultsIsMutable(); 8227 results_.set(index, value); 8228 onChanged(); 8229 } else { 8230 resultsBuilder_.setMessage(index, value); 8231 } 8232 return this; 8233 } 8234 /** 8235 * 8236 * 8237 * <pre> 8238 * A list of matched items. The order represents the ranking. 8239 * </pre> 8240 * 8241 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8242 */ setResults( int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue)8243 public Builder setResults( 8244 int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { 8245 if (resultsBuilder_ == null) { 8246 ensureResultsIsMutable(); 8247 results_.set(index, builderForValue.build()); 8248 onChanged(); 8249 } else { 8250 resultsBuilder_.setMessage(index, builderForValue.build()); 8251 } 8252 return this; 8253 } 8254 /** 8255 * 8256 * 8257 * <pre> 8258 * A list of matched items. The order represents the ranking. 8259 * </pre> 8260 * 8261 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8262 */ addResults(com.google.cloud.retail.v2.SearchResponse.SearchResult value)8263 public Builder addResults(com.google.cloud.retail.v2.SearchResponse.SearchResult value) { 8264 if (resultsBuilder_ == null) { 8265 if (value == null) { 8266 throw new NullPointerException(); 8267 } 8268 ensureResultsIsMutable(); 8269 results_.add(value); 8270 onChanged(); 8271 } else { 8272 resultsBuilder_.addMessage(value); 8273 } 8274 return this; 8275 } 8276 /** 8277 * 8278 * 8279 * <pre> 8280 * A list of matched items. The order represents the ranking. 8281 * </pre> 8282 * 8283 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8284 */ addResults( int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value)8285 public Builder addResults( 8286 int index, com.google.cloud.retail.v2.SearchResponse.SearchResult value) { 8287 if (resultsBuilder_ == null) { 8288 if (value == null) { 8289 throw new NullPointerException(); 8290 } 8291 ensureResultsIsMutable(); 8292 results_.add(index, value); 8293 onChanged(); 8294 } else { 8295 resultsBuilder_.addMessage(index, value); 8296 } 8297 return this; 8298 } 8299 /** 8300 * 8301 * 8302 * <pre> 8303 * A list of matched items. The order represents the ranking. 8304 * </pre> 8305 * 8306 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8307 */ addResults( com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue)8308 public Builder addResults( 8309 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { 8310 if (resultsBuilder_ == null) { 8311 ensureResultsIsMutable(); 8312 results_.add(builderForValue.build()); 8313 onChanged(); 8314 } else { 8315 resultsBuilder_.addMessage(builderForValue.build()); 8316 } 8317 return this; 8318 } 8319 /** 8320 * 8321 * 8322 * <pre> 8323 * A list of matched items. The order represents the ranking. 8324 * </pre> 8325 * 8326 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8327 */ addResults( int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue)8328 public Builder addResults( 8329 int index, com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder builderForValue) { 8330 if (resultsBuilder_ == null) { 8331 ensureResultsIsMutable(); 8332 results_.add(index, builderForValue.build()); 8333 onChanged(); 8334 } else { 8335 resultsBuilder_.addMessage(index, builderForValue.build()); 8336 } 8337 return this; 8338 } 8339 /** 8340 * 8341 * 8342 * <pre> 8343 * A list of matched items. The order represents the ranking. 8344 * </pre> 8345 * 8346 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8347 */ addAllResults( java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.SearchResult> values)8348 public Builder addAllResults( 8349 java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.SearchResult> 8350 values) { 8351 if (resultsBuilder_ == null) { 8352 ensureResultsIsMutable(); 8353 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); 8354 onChanged(); 8355 } else { 8356 resultsBuilder_.addAllMessages(values); 8357 } 8358 return this; 8359 } 8360 /** 8361 * 8362 * 8363 * <pre> 8364 * A list of matched items. The order represents the ranking. 8365 * </pre> 8366 * 8367 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8368 */ clearResults()8369 public Builder clearResults() { 8370 if (resultsBuilder_ == null) { 8371 results_ = java.util.Collections.emptyList(); 8372 bitField0_ = (bitField0_ & ~0x00000001); 8373 onChanged(); 8374 } else { 8375 resultsBuilder_.clear(); 8376 } 8377 return this; 8378 } 8379 /** 8380 * 8381 * 8382 * <pre> 8383 * A list of matched items. The order represents the ranking. 8384 * </pre> 8385 * 8386 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8387 */ removeResults(int index)8388 public Builder removeResults(int index) { 8389 if (resultsBuilder_ == null) { 8390 ensureResultsIsMutable(); 8391 results_.remove(index); 8392 onChanged(); 8393 } else { 8394 resultsBuilder_.remove(index); 8395 } 8396 return this; 8397 } 8398 /** 8399 * 8400 * 8401 * <pre> 8402 * A list of matched items. The order represents the ranking. 8403 * </pre> 8404 * 8405 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8406 */ getResultsBuilder( int index)8407 public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder getResultsBuilder( 8408 int index) { 8409 return getResultsFieldBuilder().getBuilder(index); 8410 } 8411 /** 8412 * 8413 * 8414 * <pre> 8415 * A list of matched items. The order represents the ranking. 8416 * </pre> 8417 * 8418 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8419 */ getResultsOrBuilder( int index)8420 public com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( 8421 int index) { 8422 if (resultsBuilder_ == null) { 8423 return results_.get(index); 8424 } else { 8425 return resultsBuilder_.getMessageOrBuilder(index); 8426 } 8427 } 8428 /** 8429 * 8430 * 8431 * <pre> 8432 * A list of matched items. The order represents the ranking. 8433 * </pre> 8434 * 8435 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8436 */ 8437 public java.util.List<? extends com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> getResultsOrBuilderList()8438 getResultsOrBuilderList() { 8439 if (resultsBuilder_ != null) { 8440 return resultsBuilder_.getMessageOrBuilderList(); 8441 } else { 8442 return java.util.Collections.unmodifiableList(results_); 8443 } 8444 } 8445 /** 8446 * 8447 * 8448 * <pre> 8449 * A list of matched items. The order represents the ranking. 8450 * </pre> 8451 * 8452 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8453 */ addResultsBuilder()8454 public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder addResultsBuilder() { 8455 return getResultsFieldBuilder() 8456 .addBuilder(com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()); 8457 } 8458 /** 8459 * 8460 * 8461 * <pre> 8462 * A list of matched items. The order represents the ranking. 8463 * </pre> 8464 * 8465 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8466 */ addResultsBuilder( int index)8467 public com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder addResultsBuilder( 8468 int index) { 8469 return getResultsFieldBuilder() 8470 .addBuilder( 8471 index, com.google.cloud.retail.v2.SearchResponse.SearchResult.getDefaultInstance()); 8472 } 8473 /** 8474 * 8475 * 8476 * <pre> 8477 * A list of matched items. The order represents the ranking. 8478 * </pre> 8479 * 8480 * <code>repeated .google.cloud.retail.v2.SearchResponse.SearchResult results = 1;</code> 8481 */ 8482 public java.util.List<com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder> getResultsBuilderList()8483 getResultsBuilderList() { 8484 return getResultsFieldBuilder().getBuilderList(); 8485 } 8486 8487 private com.google.protobuf.RepeatedFieldBuilderV3< 8488 com.google.cloud.retail.v2.SearchResponse.SearchResult, 8489 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, 8490 com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder> getResultsFieldBuilder()8491 getResultsFieldBuilder() { 8492 if (resultsBuilder_ == null) { 8493 resultsBuilder_ = 8494 new com.google.protobuf.RepeatedFieldBuilderV3< 8495 com.google.cloud.retail.v2.SearchResponse.SearchResult, 8496 com.google.cloud.retail.v2.SearchResponse.SearchResult.Builder, 8497 com.google.cloud.retail.v2.SearchResponse.SearchResultOrBuilder>( 8498 results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); 8499 results_ = null; 8500 } 8501 return resultsBuilder_; 8502 } 8503 8504 private java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet> facets_ = 8505 java.util.Collections.emptyList(); 8506 ensureFacetsIsMutable()8507 private void ensureFacetsIsMutable() { 8508 if (!((bitField0_ & 0x00000002) != 0)) { 8509 facets_ = new java.util.ArrayList<com.google.cloud.retail.v2.SearchResponse.Facet>(facets_); 8510 bitField0_ |= 0x00000002; 8511 } 8512 } 8513 8514 private com.google.protobuf.RepeatedFieldBuilderV3< 8515 com.google.cloud.retail.v2.SearchResponse.Facet, 8516 com.google.cloud.retail.v2.SearchResponse.Facet.Builder, 8517 com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> 8518 facetsBuilder_; 8519 8520 /** 8521 * 8522 * 8523 * <pre> 8524 * Results of facets requested by user. 8525 * </pre> 8526 * 8527 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8528 */ getFacetsList()8529 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet> getFacetsList() { 8530 if (facetsBuilder_ == null) { 8531 return java.util.Collections.unmodifiableList(facets_); 8532 } else { 8533 return facetsBuilder_.getMessageList(); 8534 } 8535 } 8536 /** 8537 * 8538 * 8539 * <pre> 8540 * Results of facets requested by user. 8541 * </pre> 8542 * 8543 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8544 */ getFacetsCount()8545 public int getFacetsCount() { 8546 if (facetsBuilder_ == null) { 8547 return facets_.size(); 8548 } else { 8549 return facetsBuilder_.getCount(); 8550 } 8551 } 8552 /** 8553 * 8554 * 8555 * <pre> 8556 * Results of facets requested by user. 8557 * </pre> 8558 * 8559 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8560 */ getFacets(int index)8561 public com.google.cloud.retail.v2.SearchResponse.Facet getFacets(int index) { 8562 if (facetsBuilder_ == null) { 8563 return facets_.get(index); 8564 } else { 8565 return facetsBuilder_.getMessage(index); 8566 } 8567 } 8568 /** 8569 * 8570 * 8571 * <pre> 8572 * Results of facets requested by user. 8573 * </pre> 8574 * 8575 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8576 */ setFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value)8577 public Builder setFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value) { 8578 if (facetsBuilder_ == null) { 8579 if (value == null) { 8580 throw new NullPointerException(); 8581 } 8582 ensureFacetsIsMutable(); 8583 facets_.set(index, value); 8584 onChanged(); 8585 } else { 8586 facetsBuilder_.setMessage(index, value); 8587 } 8588 return this; 8589 } 8590 /** 8591 * 8592 * 8593 * <pre> 8594 * Results of facets requested by user. 8595 * </pre> 8596 * 8597 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8598 */ setFacets( int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue)8599 public Builder setFacets( 8600 int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { 8601 if (facetsBuilder_ == null) { 8602 ensureFacetsIsMutable(); 8603 facets_.set(index, builderForValue.build()); 8604 onChanged(); 8605 } else { 8606 facetsBuilder_.setMessage(index, builderForValue.build()); 8607 } 8608 return this; 8609 } 8610 /** 8611 * 8612 * 8613 * <pre> 8614 * Results of facets requested by user. 8615 * </pre> 8616 * 8617 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8618 */ addFacets(com.google.cloud.retail.v2.SearchResponse.Facet value)8619 public Builder addFacets(com.google.cloud.retail.v2.SearchResponse.Facet value) { 8620 if (facetsBuilder_ == null) { 8621 if (value == null) { 8622 throw new NullPointerException(); 8623 } 8624 ensureFacetsIsMutable(); 8625 facets_.add(value); 8626 onChanged(); 8627 } else { 8628 facetsBuilder_.addMessage(value); 8629 } 8630 return this; 8631 } 8632 /** 8633 * 8634 * 8635 * <pre> 8636 * Results of facets requested by user. 8637 * </pre> 8638 * 8639 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8640 */ addFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value)8641 public Builder addFacets(int index, com.google.cloud.retail.v2.SearchResponse.Facet value) { 8642 if (facetsBuilder_ == null) { 8643 if (value == null) { 8644 throw new NullPointerException(); 8645 } 8646 ensureFacetsIsMutable(); 8647 facets_.add(index, value); 8648 onChanged(); 8649 } else { 8650 facetsBuilder_.addMessage(index, value); 8651 } 8652 return this; 8653 } 8654 /** 8655 * 8656 * 8657 * <pre> 8658 * Results of facets requested by user. 8659 * </pre> 8660 * 8661 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8662 */ addFacets( com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue)8663 public Builder addFacets( 8664 com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { 8665 if (facetsBuilder_ == null) { 8666 ensureFacetsIsMutable(); 8667 facets_.add(builderForValue.build()); 8668 onChanged(); 8669 } else { 8670 facetsBuilder_.addMessage(builderForValue.build()); 8671 } 8672 return this; 8673 } 8674 /** 8675 * 8676 * 8677 * <pre> 8678 * Results of facets requested by user. 8679 * </pre> 8680 * 8681 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8682 */ addFacets( int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue)8683 public Builder addFacets( 8684 int index, com.google.cloud.retail.v2.SearchResponse.Facet.Builder builderForValue) { 8685 if (facetsBuilder_ == null) { 8686 ensureFacetsIsMutable(); 8687 facets_.add(index, builderForValue.build()); 8688 onChanged(); 8689 } else { 8690 facetsBuilder_.addMessage(index, builderForValue.build()); 8691 } 8692 return this; 8693 } 8694 /** 8695 * 8696 * 8697 * <pre> 8698 * Results of facets requested by user. 8699 * </pre> 8700 * 8701 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8702 */ addAllFacets( java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.Facet> values)8703 public Builder addAllFacets( 8704 java.lang.Iterable<? extends com.google.cloud.retail.v2.SearchResponse.Facet> values) { 8705 if (facetsBuilder_ == null) { 8706 ensureFacetsIsMutable(); 8707 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facets_); 8708 onChanged(); 8709 } else { 8710 facetsBuilder_.addAllMessages(values); 8711 } 8712 return this; 8713 } 8714 /** 8715 * 8716 * 8717 * <pre> 8718 * Results of facets requested by user. 8719 * </pre> 8720 * 8721 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8722 */ clearFacets()8723 public Builder clearFacets() { 8724 if (facetsBuilder_ == null) { 8725 facets_ = java.util.Collections.emptyList(); 8726 bitField0_ = (bitField0_ & ~0x00000002); 8727 onChanged(); 8728 } else { 8729 facetsBuilder_.clear(); 8730 } 8731 return this; 8732 } 8733 /** 8734 * 8735 * 8736 * <pre> 8737 * Results of facets requested by user. 8738 * </pre> 8739 * 8740 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8741 */ removeFacets(int index)8742 public Builder removeFacets(int index) { 8743 if (facetsBuilder_ == null) { 8744 ensureFacetsIsMutable(); 8745 facets_.remove(index); 8746 onChanged(); 8747 } else { 8748 facetsBuilder_.remove(index); 8749 } 8750 return this; 8751 } 8752 /** 8753 * 8754 * 8755 * <pre> 8756 * Results of facets requested by user. 8757 * </pre> 8758 * 8759 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8760 */ getFacetsBuilder(int index)8761 public com.google.cloud.retail.v2.SearchResponse.Facet.Builder getFacetsBuilder(int index) { 8762 return getFacetsFieldBuilder().getBuilder(index); 8763 } 8764 /** 8765 * 8766 * 8767 * <pre> 8768 * Results of facets requested by user. 8769 * </pre> 8770 * 8771 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8772 */ getFacetsOrBuilder(int index)8773 public com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index) { 8774 if (facetsBuilder_ == null) { 8775 return facets_.get(index); 8776 } else { 8777 return facetsBuilder_.getMessageOrBuilder(index); 8778 } 8779 } 8780 /** 8781 * 8782 * 8783 * <pre> 8784 * Results of facets requested by user. 8785 * </pre> 8786 * 8787 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8788 */ 8789 public java.util.List<? extends com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> getFacetsOrBuilderList()8790 getFacetsOrBuilderList() { 8791 if (facetsBuilder_ != null) { 8792 return facetsBuilder_.getMessageOrBuilderList(); 8793 } else { 8794 return java.util.Collections.unmodifiableList(facets_); 8795 } 8796 } 8797 /** 8798 * 8799 * 8800 * <pre> 8801 * Results of facets requested by user. 8802 * </pre> 8803 * 8804 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8805 */ addFacetsBuilder()8806 public com.google.cloud.retail.v2.SearchResponse.Facet.Builder addFacetsBuilder() { 8807 return getFacetsFieldBuilder() 8808 .addBuilder(com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()); 8809 } 8810 /** 8811 * 8812 * 8813 * <pre> 8814 * Results of facets requested by user. 8815 * </pre> 8816 * 8817 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8818 */ addFacetsBuilder(int index)8819 public com.google.cloud.retail.v2.SearchResponse.Facet.Builder addFacetsBuilder(int index) { 8820 return getFacetsFieldBuilder() 8821 .addBuilder(index, com.google.cloud.retail.v2.SearchResponse.Facet.getDefaultInstance()); 8822 } 8823 /** 8824 * 8825 * 8826 * <pre> 8827 * Results of facets requested by user. 8828 * </pre> 8829 * 8830 * <code>repeated .google.cloud.retail.v2.SearchResponse.Facet facets = 2;</code> 8831 */ 8832 public java.util.List<com.google.cloud.retail.v2.SearchResponse.Facet.Builder> getFacetsBuilderList()8833 getFacetsBuilderList() { 8834 return getFacetsFieldBuilder().getBuilderList(); 8835 } 8836 8837 private com.google.protobuf.RepeatedFieldBuilderV3< 8838 com.google.cloud.retail.v2.SearchResponse.Facet, 8839 com.google.cloud.retail.v2.SearchResponse.Facet.Builder, 8840 com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder> getFacetsFieldBuilder()8841 getFacetsFieldBuilder() { 8842 if (facetsBuilder_ == null) { 8843 facetsBuilder_ = 8844 new com.google.protobuf.RepeatedFieldBuilderV3< 8845 com.google.cloud.retail.v2.SearchResponse.Facet, 8846 com.google.cloud.retail.v2.SearchResponse.Facet.Builder, 8847 com.google.cloud.retail.v2.SearchResponse.FacetOrBuilder>( 8848 facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); 8849 facets_ = null; 8850 } 8851 return facetsBuilder_; 8852 } 8853 8854 private int totalSize_; 8855 /** 8856 * 8857 * 8858 * <pre> 8859 * The estimated total count of matched items irrespective of pagination. The 8860 * count of [results][google.cloud.retail.v2.SearchResponse.results] returned 8861 * by pagination may be less than the 8862 * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that 8863 * matches. 8864 * </pre> 8865 * 8866 * <code>int32 total_size = 3;</code> 8867 * 8868 * @return The totalSize. 8869 */ 8870 @java.lang.Override getTotalSize()8871 public int getTotalSize() { 8872 return totalSize_; 8873 } 8874 /** 8875 * 8876 * 8877 * <pre> 8878 * The estimated total count of matched items irrespective of pagination. The 8879 * count of [results][google.cloud.retail.v2.SearchResponse.results] returned 8880 * by pagination may be less than the 8881 * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that 8882 * matches. 8883 * </pre> 8884 * 8885 * <code>int32 total_size = 3;</code> 8886 * 8887 * @param value The totalSize to set. 8888 * @return This builder for chaining. 8889 */ setTotalSize(int value)8890 public Builder setTotalSize(int value) { 8891 8892 totalSize_ = value; 8893 bitField0_ |= 0x00000004; 8894 onChanged(); 8895 return this; 8896 } 8897 /** 8898 * 8899 * 8900 * <pre> 8901 * The estimated total count of matched items irrespective of pagination. The 8902 * count of [results][google.cloud.retail.v2.SearchResponse.results] returned 8903 * by pagination may be less than the 8904 * [total_size][google.cloud.retail.v2.SearchResponse.total_size] that 8905 * matches. 8906 * </pre> 8907 * 8908 * <code>int32 total_size = 3;</code> 8909 * 8910 * @return This builder for chaining. 8911 */ clearTotalSize()8912 public Builder clearTotalSize() { 8913 bitField0_ = (bitField0_ & ~0x00000004); 8914 totalSize_ = 0; 8915 onChanged(); 8916 return this; 8917 } 8918 8919 private java.lang.Object correctedQuery_ = ""; 8920 /** 8921 * 8922 * 8923 * <pre> 8924 * Contains the spell corrected query, if found. If the spell correction type 8925 * is AUTOMATIC, then the search results are based on corrected_query. 8926 * Otherwise the original query is used for search. 8927 * </pre> 8928 * 8929 * <code>string corrected_query = 4;</code> 8930 * 8931 * @return The correctedQuery. 8932 */ getCorrectedQuery()8933 public java.lang.String getCorrectedQuery() { 8934 java.lang.Object ref = correctedQuery_; 8935 if (!(ref instanceof java.lang.String)) { 8936 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 8937 java.lang.String s = bs.toStringUtf8(); 8938 correctedQuery_ = s; 8939 return s; 8940 } else { 8941 return (java.lang.String) ref; 8942 } 8943 } 8944 /** 8945 * 8946 * 8947 * <pre> 8948 * Contains the spell corrected query, if found. If the spell correction type 8949 * is AUTOMATIC, then the search results are based on corrected_query. 8950 * Otherwise the original query is used for search. 8951 * </pre> 8952 * 8953 * <code>string corrected_query = 4;</code> 8954 * 8955 * @return The bytes for correctedQuery. 8956 */ getCorrectedQueryBytes()8957 public com.google.protobuf.ByteString getCorrectedQueryBytes() { 8958 java.lang.Object ref = correctedQuery_; 8959 if (ref instanceof String) { 8960 com.google.protobuf.ByteString b = 8961 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 8962 correctedQuery_ = b; 8963 return b; 8964 } else { 8965 return (com.google.protobuf.ByteString) ref; 8966 } 8967 } 8968 /** 8969 * 8970 * 8971 * <pre> 8972 * Contains the spell corrected query, if found. If the spell correction type 8973 * is AUTOMATIC, then the search results are based on corrected_query. 8974 * Otherwise the original query is used for search. 8975 * </pre> 8976 * 8977 * <code>string corrected_query = 4;</code> 8978 * 8979 * @param value The correctedQuery to set. 8980 * @return This builder for chaining. 8981 */ setCorrectedQuery(java.lang.String value)8982 public Builder setCorrectedQuery(java.lang.String value) { 8983 if (value == null) { 8984 throw new NullPointerException(); 8985 } 8986 correctedQuery_ = value; 8987 bitField0_ |= 0x00000008; 8988 onChanged(); 8989 return this; 8990 } 8991 /** 8992 * 8993 * 8994 * <pre> 8995 * Contains the spell corrected query, if found. If the spell correction type 8996 * is AUTOMATIC, then the search results are based on corrected_query. 8997 * Otherwise the original query is used for search. 8998 * </pre> 8999 * 9000 * <code>string corrected_query = 4;</code> 9001 * 9002 * @return This builder for chaining. 9003 */ clearCorrectedQuery()9004 public Builder clearCorrectedQuery() { 9005 correctedQuery_ = getDefaultInstance().getCorrectedQuery(); 9006 bitField0_ = (bitField0_ & ~0x00000008); 9007 onChanged(); 9008 return this; 9009 } 9010 /** 9011 * 9012 * 9013 * <pre> 9014 * Contains the spell corrected query, if found. If the spell correction type 9015 * is AUTOMATIC, then the search results are based on corrected_query. 9016 * Otherwise the original query is used for search. 9017 * </pre> 9018 * 9019 * <code>string corrected_query = 4;</code> 9020 * 9021 * @param value The bytes for correctedQuery to set. 9022 * @return This builder for chaining. 9023 */ setCorrectedQueryBytes(com.google.protobuf.ByteString value)9024 public Builder setCorrectedQueryBytes(com.google.protobuf.ByteString value) { 9025 if (value == null) { 9026 throw new NullPointerException(); 9027 } 9028 checkByteStringIsUtf8(value); 9029 correctedQuery_ = value; 9030 bitField0_ |= 0x00000008; 9031 onChanged(); 9032 return this; 9033 } 9034 9035 private java.lang.Object attributionToken_ = ""; 9036 /** 9037 * 9038 * 9039 * <pre> 9040 * A unique search token. This should be included in the 9041 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 9042 * search, which enables accurate attribution of search model performance. 9043 * </pre> 9044 * 9045 * <code>string attribution_token = 5;</code> 9046 * 9047 * @return The attributionToken. 9048 */ getAttributionToken()9049 public java.lang.String getAttributionToken() { 9050 java.lang.Object ref = attributionToken_; 9051 if (!(ref instanceof java.lang.String)) { 9052 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 9053 java.lang.String s = bs.toStringUtf8(); 9054 attributionToken_ = s; 9055 return s; 9056 } else { 9057 return (java.lang.String) ref; 9058 } 9059 } 9060 /** 9061 * 9062 * 9063 * <pre> 9064 * A unique search token. This should be included in the 9065 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 9066 * search, which enables accurate attribution of search model performance. 9067 * </pre> 9068 * 9069 * <code>string attribution_token = 5;</code> 9070 * 9071 * @return The bytes for attributionToken. 9072 */ getAttributionTokenBytes()9073 public com.google.protobuf.ByteString getAttributionTokenBytes() { 9074 java.lang.Object ref = attributionToken_; 9075 if (ref instanceof String) { 9076 com.google.protobuf.ByteString b = 9077 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 9078 attributionToken_ = b; 9079 return b; 9080 } else { 9081 return (com.google.protobuf.ByteString) ref; 9082 } 9083 } 9084 /** 9085 * 9086 * 9087 * <pre> 9088 * A unique search token. This should be included in the 9089 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 9090 * search, which enables accurate attribution of search model performance. 9091 * </pre> 9092 * 9093 * <code>string attribution_token = 5;</code> 9094 * 9095 * @param value The attributionToken to set. 9096 * @return This builder for chaining. 9097 */ setAttributionToken(java.lang.String value)9098 public Builder setAttributionToken(java.lang.String value) { 9099 if (value == null) { 9100 throw new NullPointerException(); 9101 } 9102 attributionToken_ = value; 9103 bitField0_ |= 0x00000010; 9104 onChanged(); 9105 return this; 9106 } 9107 /** 9108 * 9109 * 9110 * <pre> 9111 * A unique search token. This should be included in the 9112 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 9113 * search, which enables accurate attribution of search model performance. 9114 * </pre> 9115 * 9116 * <code>string attribution_token = 5;</code> 9117 * 9118 * @return This builder for chaining. 9119 */ clearAttributionToken()9120 public Builder clearAttributionToken() { 9121 attributionToken_ = getDefaultInstance().getAttributionToken(); 9122 bitField0_ = (bitField0_ & ~0x00000010); 9123 onChanged(); 9124 return this; 9125 } 9126 /** 9127 * 9128 * 9129 * <pre> 9130 * A unique search token. This should be included in the 9131 * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this 9132 * search, which enables accurate attribution of search model performance. 9133 * </pre> 9134 * 9135 * <code>string attribution_token = 5;</code> 9136 * 9137 * @param value The bytes for attributionToken to set. 9138 * @return This builder for chaining. 9139 */ setAttributionTokenBytes(com.google.protobuf.ByteString value)9140 public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { 9141 if (value == null) { 9142 throw new NullPointerException(); 9143 } 9144 checkByteStringIsUtf8(value); 9145 attributionToken_ = value; 9146 bitField0_ |= 0x00000010; 9147 onChanged(); 9148 return this; 9149 } 9150 9151 private java.lang.Object nextPageToken_ = ""; 9152 /** 9153 * 9154 * 9155 * <pre> 9156 * A token that can be sent as 9157 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 9158 * to retrieve the next page. If this field is omitted, there are no 9159 * subsequent pages. 9160 * </pre> 9161 * 9162 * <code>string next_page_token = 6;</code> 9163 * 9164 * @return The nextPageToken. 9165 */ getNextPageToken()9166 public java.lang.String getNextPageToken() { 9167 java.lang.Object ref = nextPageToken_; 9168 if (!(ref instanceof java.lang.String)) { 9169 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 9170 java.lang.String s = bs.toStringUtf8(); 9171 nextPageToken_ = s; 9172 return s; 9173 } else { 9174 return (java.lang.String) ref; 9175 } 9176 } 9177 /** 9178 * 9179 * 9180 * <pre> 9181 * A token that can be sent as 9182 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 9183 * to retrieve the next page. If this field is omitted, there are no 9184 * subsequent pages. 9185 * </pre> 9186 * 9187 * <code>string next_page_token = 6;</code> 9188 * 9189 * @return The bytes for nextPageToken. 9190 */ getNextPageTokenBytes()9191 public com.google.protobuf.ByteString getNextPageTokenBytes() { 9192 java.lang.Object ref = nextPageToken_; 9193 if (ref instanceof String) { 9194 com.google.protobuf.ByteString b = 9195 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 9196 nextPageToken_ = b; 9197 return b; 9198 } else { 9199 return (com.google.protobuf.ByteString) ref; 9200 } 9201 } 9202 /** 9203 * 9204 * 9205 * <pre> 9206 * A token that can be sent as 9207 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 9208 * to retrieve the next page. If this field is omitted, there are no 9209 * subsequent pages. 9210 * </pre> 9211 * 9212 * <code>string next_page_token = 6;</code> 9213 * 9214 * @param value The nextPageToken to set. 9215 * @return This builder for chaining. 9216 */ setNextPageToken(java.lang.String value)9217 public Builder setNextPageToken(java.lang.String value) { 9218 if (value == null) { 9219 throw new NullPointerException(); 9220 } 9221 nextPageToken_ = value; 9222 bitField0_ |= 0x00000020; 9223 onChanged(); 9224 return this; 9225 } 9226 /** 9227 * 9228 * 9229 * <pre> 9230 * A token that can be sent as 9231 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 9232 * to retrieve the next page. If this field is omitted, there are no 9233 * subsequent pages. 9234 * </pre> 9235 * 9236 * <code>string next_page_token = 6;</code> 9237 * 9238 * @return This builder for chaining. 9239 */ clearNextPageToken()9240 public Builder clearNextPageToken() { 9241 nextPageToken_ = getDefaultInstance().getNextPageToken(); 9242 bitField0_ = (bitField0_ & ~0x00000020); 9243 onChanged(); 9244 return this; 9245 } 9246 /** 9247 * 9248 * 9249 * <pre> 9250 * A token that can be sent as 9251 * [SearchRequest.page_token][google.cloud.retail.v2.SearchRequest.page_token] 9252 * to retrieve the next page. If this field is omitted, there are no 9253 * subsequent pages. 9254 * </pre> 9255 * 9256 * <code>string next_page_token = 6;</code> 9257 * 9258 * @param value The bytes for nextPageToken to set. 9259 * @return This builder for chaining. 9260 */ setNextPageTokenBytes(com.google.protobuf.ByteString value)9261 public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { 9262 if (value == null) { 9263 throw new NullPointerException(); 9264 } 9265 checkByteStringIsUtf8(value); 9266 nextPageToken_ = value; 9267 bitField0_ |= 0x00000020; 9268 onChanged(); 9269 return this; 9270 } 9271 9272 private com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo queryExpansionInfo_; 9273 private com.google.protobuf.SingleFieldBuilderV3< 9274 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, 9275 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, 9276 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder> 9277 queryExpansionInfoBuilder_; 9278 /** 9279 * 9280 * 9281 * <pre> 9282 * Query expansion information for the returned results. 9283 * </pre> 9284 * 9285 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9286 * </code> 9287 * 9288 * @return Whether the queryExpansionInfo field is set. 9289 */ hasQueryExpansionInfo()9290 public boolean hasQueryExpansionInfo() { 9291 return ((bitField0_ & 0x00000040) != 0); 9292 } 9293 /** 9294 * 9295 * 9296 * <pre> 9297 * Query expansion information for the returned results. 9298 * </pre> 9299 * 9300 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9301 * </code> 9302 * 9303 * @return The queryExpansionInfo. 9304 */ getQueryExpansionInfo()9305 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo getQueryExpansionInfo() { 9306 if (queryExpansionInfoBuilder_ == null) { 9307 return queryExpansionInfo_ == null 9308 ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() 9309 : queryExpansionInfo_; 9310 } else { 9311 return queryExpansionInfoBuilder_.getMessage(); 9312 } 9313 } 9314 /** 9315 * 9316 * 9317 * <pre> 9318 * Query expansion information for the returned results. 9319 * </pre> 9320 * 9321 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9322 * </code> 9323 */ setQueryExpansionInfo( com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value)9324 public Builder setQueryExpansionInfo( 9325 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value) { 9326 if (queryExpansionInfoBuilder_ == null) { 9327 if (value == null) { 9328 throw new NullPointerException(); 9329 } 9330 queryExpansionInfo_ = value; 9331 } else { 9332 queryExpansionInfoBuilder_.setMessage(value); 9333 } 9334 bitField0_ |= 0x00000040; 9335 onChanged(); 9336 return this; 9337 } 9338 /** 9339 * 9340 * 9341 * <pre> 9342 * Query expansion information for the returned results. 9343 * </pre> 9344 * 9345 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9346 * </code> 9347 */ setQueryExpansionInfo( com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder builderForValue)9348 public Builder setQueryExpansionInfo( 9349 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder builderForValue) { 9350 if (queryExpansionInfoBuilder_ == null) { 9351 queryExpansionInfo_ = builderForValue.build(); 9352 } else { 9353 queryExpansionInfoBuilder_.setMessage(builderForValue.build()); 9354 } 9355 bitField0_ |= 0x00000040; 9356 onChanged(); 9357 return this; 9358 } 9359 /** 9360 * 9361 * 9362 * <pre> 9363 * Query expansion information for the returned results. 9364 * </pre> 9365 * 9366 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9367 * </code> 9368 */ mergeQueryExpansionInfo( com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value)9369 public Builder mergeQueryExpansionInfo( 9370 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo value) { 9371 if (queryExpansionInfoBuilder_ == null) { 9372 if (((bitField0_ & 0x00000040) != 0) 9373 && queryExpansionInfo_ != null 9374 && queryExpansionInfo_ 9375 != com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo 9376 .getDefaultInstance()) { 9377 getQueryExpansionInfoBuilder().mergeFrom(value); 9378 } else { 9379 queryExpansionInfo_ = value; 9380 } 9381 } else { 9382 queryExpansionInfoBuilder_.mergeFrom(value); 9383 } 9384 bitField0_ |= 0x00000040; 9385 onChanged(); 9386 return this; 9387 } 9388 /** 9389 * 9390 * 9391 * <pre> 9392 * Query expansion information for the returned results. 9393 * </pre> 9394 * 9395 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9396 * </code> 9397 */ clearQueryExpansionInfo()9398 public Builder clearQueryExpansionInfo() { 9399 bitField0_ = (bitField0_ & ~0x00000040); 9400 queryExpansionInfo_ = null; 9401 if (queryExpansionInfoBuilder_ != null) { 9402 queryExpansionInfoBuilder_.dispose(); 9403 queryExpansionInfoBuilder_ = null; 9404 } 9405 onChanged(); 9406 return this; 9407 } 9408 /** 9409 * 9410 * 9411 * <pre> 9412 * Query expansion information for the returned results. 9413 * </pre> 9414 * 9415 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9416 * </code> 9417 */ 9418 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder getQueryExpansionInfoBuilder()9419 getQueryExpansionInfoBuilder() { 9420 bitField0_ |= 0x00000040; 9421 onChanged(); 9422 return getQueryExpansionInfoFieldBuilder().getBuilder(); 9423 } 9424 /** 9425 * 9426 * 9427 * <pre> 9428 * Query expansion information for the returned results. 9429 * </pre> 9430 * 9431 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9432 * </code> 9433 */ 9434 public com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder getQueryExpansionInfoOrBuilder()9435 getQueryExpansionInfoOrBuilder() { 9436 if (queryExpansionInfoBuilder_ != null) { 9437 return queryExpansionInfoBuilder_.getMessageOrBuilder(); 9438 } else { 9439 return queryExpansionInfo_ == null 9440 ? com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.getDefaultInstance() 9441 : queryExpansionInfo_; 9442 } 9443 } 9444 /** 9445 * 9446 * 9447 * <pre> 9448 * Query expansion information for the returned results. 9449 * </pre> 9450 * 9451 * <code>.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo query_expansion_info = 7; 9452 * </code> 9453 */ 9454 private com.google.protobuf.SingleFieldBuilderV3< 9455 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, 9456 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, 9457 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder> getQueryExpansionInfoFieldBuilder()9458 getQueryExpansionInfoFieldBuilder() { 9459 if (queryExpansionInfoBuilder_ == null) { 9460 queryExpansionInfoBuilder_ = 9461 new com.google.protobuf.SingleFieldBuilderV3< 9462 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo, 9463 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo.Builder, 9464 com.google.cloud.retail.v2.SearchResponse.QueryExpansionInfoOrBuilder>( 9465 getQueryExpansionInfo(), getParentForChildren(), isClean()); 9466 queryExpansionInfo_ = null; 9467 } 9468 return queryExpansionInfoBuilder_; 9469 } 9470 9471 private java.lang.Object redirectUri_ = ""; 9472 /** 9473 * 9474 * 9475 * <pre> 9476 * The URI of a customer-defined redirect page. If redirect action is 9477 * triggered, no search is performed, and only 9478 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 9479 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 9480 * are set in the response. 9481 * </pre> 9482 * 9483 * <code>string redirect_uri = 10;</code> 9484 * 9485 * @return The redirectUri. 9486 */ getRedirectUri()9487 public java.lang.String getRedirectUri() { 9488 java.lang.Object ref = redirectUri_; 9489 if (!(ref instanceof java.lang.String)) { 9490 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 9491 java.lang.String s = bs.toStringUtf8(); 9492 redirectUri_ = s; 9493 return s; 9494 } else { 9495 return (java.lang.String) ref; 9496 } 9497 } 9498 /** 9499 * 9500 * 9501 * <pre> 9502 * The URI of a customer-defined redirect page. If redirect action is 9503 * triggered, no search is performed, and only 9504 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 9505 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 9506 * are set in the response. 9507 * </pre> 9508 * 9509 * <code>string redirect_uri = 10;</code> 9510 * 9511 * @return The bytes for redirectUri. 9512 */ getRedirectUriBytes()9513 public com.google.protobuf.ByteString getRedirectUriBytes() { 9514 java.lang.Object ref = redirectUri_; 9515 if (ref instanceof String) { 9516 com.google.protobuf.ByteString b = 9517 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 9518 redirectUri_ = b; 9519 return b; 9520 } else { 9521 return (com.google.protobuf.ByteString) ref; 9522 } 9523 } 9524 /** 9525 * 9526 * 9527 * <pre> 9528 * The URI of a customer-defined redirect page. If redirect action is 9529 * triggered, no search is performed, and only 9530 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 9531 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 9532 * are set in the response. 9533 * </pre> 9534 * 9535 * <code>string redirect_uri = 10;</code> 9536 * 9537 * @param value The redirectUri to set. 9538 * @return This builder for chaining. 9539 */ setRedirectUri(java.lang.String value)9540 public Builder setRedirectUri(java.lang.String value) { 9541 if (value == null) { 9542 throw new NullPointerException(); 9543 } 9544 redirectUri_ = value; 9545 bitField0_ |= 0x00000080; 9546 onChanged(); 9547 return this; 9548 } 9549 /** 9550 * 9551 * 9552 * <pre> 9553 * The URI of a customer-defined redirect page. If redirect action is 9554 * triggered, no search is performed, and only 9555 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 9556 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 9557 * are set in the response. 9558 * </pre> 9559 * 9560 * <code>string redirect_uri = 10;</code> 9561 * 9562 * @return This builder for chaining. 9563 */ clearRedirectUri()9564 public Builder clearRedirectUri() { 9565 redirectUri_ = getDefaultInstance().getRedirectUri(); 9566 bitField0_ = (bitField0_ & ~0x00000080); 9567 onChanged(); 9568 return this; 9569 } 9570 /** 9571 * 9572 * 9573 * <pre> 9574 * The URI of a customer-defined redirect page. If redirect action is 9575 * triggered, no search is performed, and only 9576 * [redirect_uri][google.cloud.retail.v2.SearchResponse.redirect_uri] and 9577 * [attribution_token][google.cloud.retail.v2.SearchResponse.attribution_token] 9578 * are set in the response. 9579 * </pre> 9580 * 9581 * <code>string redirect_uri = 10;</code> 9582 * 9583 * @param value The bytes for redirectUri to set. 9584 * @return This builder for chaining. 9585 */ setRedirectUriBytes(com.google.protobuf.ByteString value)9586 public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { 9587 if (value == null) { 9588 throw new NullPointerException(); 9589 } 9590 checkByteStringIsUtf8(value); 9591 redirectUri_ = value; 9592 bitField0_ |= 0x00000080; 9593 onChanged(); 9594 return this; 9595 } 9596 9597 private com.google.protobuf.LazyStringList appliedControls_ = 9598 com.google.protobuf.LazyStringArrayList.EMPTY; 9599 ensureAppliedControlsIsMutable()9600 private void ensureAppliedControlsIsMutable() { 9601 if (!((bitField0_ & 0x00000100) != 0)) { 9602 appliedControls_ = new com.google.protobuf.LazyStringArrayList(appliedControls_); 9603 bitField0_ |= 0x00000100; 9604 } 9605 } 9606 /** 9607 * 9608 * 9609 * <pre> 9610 * The fully qualified resource name of applied 9611 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9612 * </pre> 9613 * 9614 * <code>repeated string applied_controls = 12;</code> 9615 * 9616 * @return A list containing the appliedControls. 9617 */ getAppliedControlsList()9618 public com.google.protobuf.ProtocolStringList getAppliedControlsList() { 9619 return appliedControls_.getUnmodifiableView(); 9620 } 9621 /** 9622 * 9623 * 9624 * <pre> 9625 * The fully qualified resource name of applied 9626 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9627 * </pre> 9628 * 9629 * <code>repeated string applied_controls = 12;</code> 9630 * 9631 * @return The count of appliedControls. 9632 */ getAppliedControlsCount()9633 public int getAppliedControlsCount() { 9634 return appliedControls_.size(); 9635 } 9636 /** 9637 * 9638 * 9639 * <pre> 9640 * The fully qualified resource name of applied 9641 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9642 * </pre> 9643 * 9644 * <code>repeated string applied_controls = 12;</code> 9645 * 9646 * @param index The index of the element to return. 9647 * @return The appliedControls at the given index. 9648 */ getAppliedControls(int index)9649 public java.lang.String getAppliedControls(int index) { 9650 return appliedControls_.get(index); 9651 } 9652 /** 9653 * 9654 * 9655 * <pre> 9656 * The fully qualified resource name of applied 9657 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9658 * </pre> 9659 * 9660 * <code>repeated string applied_controls = 12;</code> 9661 * 9662 * @param index The index of the value to return. 9663 * @return The bytes of the appliedControls at the given index. 9664 */ getAppliedControlsBytes(int index)9665 public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { 9666 return appliedControls_.getByteString(index); 9667 } 9668 /** 9669 * 9670 * 9671 * <pre> 9672 * The fully qualified resource name of applied 9673 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9674 * </pre> 9675 * 9676 * <code>repeated string applied_controls = 12;</code> 9677 * 9678 * @param index The index to set the value at. 9679 * @param value The appliedControls to set. 9680 * @return This builder for chaining. 9681 */ setAppliedControls(int index, java.lang.String value)9682 public Builder setAppliedControls(int index, java.lang.String value) { 9683 if (value == null) { 9684 throw new NullPointerException(); 9685 } 9686 ensureAppliedControlsIsMutable(); 9687 appliedControls_.set(index, value); 9688 onChanged(); 9689 return this; 9690 } 9691 /** 9692 * 9693 * 9694 * <pre> 9695 * The fully qualified resource name of applied 9696 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9697 * </pre> 9698 * 9699 * <code>repeated string applied_controls = 12;</code> 9700 * 9701 * @param value The appliedControls to add. 9702 * @return This builder for chaining. 9703 */ addAppliedControls(java.lang.String value)9704 public Builder addAppliedControls(java.lang.String value) { 9705 if (value == null) { 9706 throw new NullPointerException(); 9707 } 9708 ensureAppliedControlsIsMutable(); 9709 appliedControls_.add(value); 9710 onChanged(); 9711 return this; 9712 } 9713 /** 9714 * 9715 * 9716 * <pre> 9717 * The fully qualified resource name of applied 9718 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9719 * </pre> 9720 * 9721 * <code>repeated string applied_controls = 12;</code> 9722 * 9723 * @param values The appliedControls to add. 9724 * @return This builder for chaining. 9725 */ addAllAppliedControls(java.lang.Iterable<java.lang.String> values)9726 public Builder addAllAppliedControls(java.lang.Iterable<java.lang.String> values) { 9727 ensureAppliedControlsIsMutable(); 9728 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appliedControls_); 9729 onChanged(); 9730 return this; 9731 } 9732 /** 9733 * 9734 * 9735 * <pre> 9736 * The fully qualified resource name of applied 9737 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9738 * </pre> 9739 * 9740 * <code>repeated string applied_controls = 12;</code> 9741 * 9742 * @return This builder for chaining. 9743 */ clearAppliedControls()9744 public Builder clearAppliedControls() { 9745 appliedControls_ = com.google.protobuf.LazyStringArrayList.EMPTY; 9746 bitField0_ = (bitField0_ & ~0x00000100); 9747 onChanged(); 9748 return this; 9749 } 9750 /** 9751 * 9752 * 9753 * <pre> 9754 * The fully qualified resource name of applied 9755 * [controls](https://cloud.google.com/retail/docs/serving-control-rules). 9756 * </pre> 9757 * 9758 * <code>repeated string applied_controls = 12;</code> 9759 * 9760 * @param value The bytes of the appliedControls to add. 9761 * @return This builder for chaining. 9762 */ addAppliedControlsBytes(com.google.protobuf.ByteString value)9763 public Builder addAppliedControlsBytes(com.google.protobuf.ByteString value) { 9764 if (value == null) { 9765 throw new NullPointerException(); 9766 } 9767 checkByteStringIsUtf8(value); 9768 ensureAppliedControlsIsMutable(); 9769 appliedControls_.add(value); 9770 onChanged(); 9771 return this; 9772 } 9773 9774 private java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> 9775 invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); 9776 ensureInvalidConditionBoostSpecsIsMutable()9777 private void ensureInvalidConditionBoostSpecsIsMutable() { 9778 if (!((bitField0_ & 0x00000200) != 0)) { 9779 invalidConditionBoostSpecs_ = 9780 new java.util.ArrayList< 9781 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec>( 9782 invalidConditionBoostSpecs_); 9783 bitField0_ |= 0x00000200; 9784 } 9785 } 9786 9787 private com.google.protobuf.RepeatedFieldBuilderV3< 9788 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, 9789 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, 9790 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> 9791 invalidConditionBoostSpecsBuilder_; 9792 9793 /** 9794 * 9795 * 9796 * <pre> 9797 * The invalid 9798 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9799 * that are not applied during serving. 9800 * </pre> 9801 * 9802 * <code> 9803 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9804 * </code> 9805 */ 9806 public java.util.List<com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> getInvalidConditionBoostSpecsList()9807 getInvalidConditionBoostSpecsList() { 9808 if (invalidConditionBoostSpecsBuilder_ == null) { 9809 return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); 9810 } else { 9811 return invalidConditionBoostSpecsBuilder_.getMessageList(); 9812 } 9813 } 9814 /** 9815 * 9816 * 9817 * <pre> 9818 * The invalid 9819 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9820 * that are not applied during serving. 9821 * </pre> 9822 * 9823 * <code> 9824 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9825 * </code> 9826 */ getInvalidConditionBoostSpecsCount()9827 public int getInvalidConditionBoostSpecsCount() { 9828 if (invalidConditionBoostSpecsBuilder_ == null) { 9829 return invalidConditionBoostSpecs_.size(); 9830 } else { 9831 return invalidConditionBoostSpecsBuilder_.getCount(); 9832 } 9833 } 9834 /** 9835 * 9836 * 9837 * <pre> 9838 * The invalid 9839 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9840 * that are not applied during serving. 9841 * </pre> 9842 * 9843 * <code> 9844 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9845 * </code> 9846 */ 9847 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec getInvalidConditionBoostSpecs(int index)9848 getInvalidConditionBoostSpecs(int index) { 9849 if (invalidConditionBoostSpecsBuilder_ == null) { 9850 return invalidConditionBoostSpecs_.get(index); 9851 } else { 9852 return invalidConditionBoostSpecsBuilder_.getMessage(index); 9853 } 9854 } 9855 /** 9856 * 9857 * 9858 * <pre> 9859 * The invalid 9860 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9861 * that are not applied during serving. 9862 * </pre> 9863 * 9864 * <code> 9865 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9866 * </code> 9867 */ setInvalidConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)9868 public Builder setInvalidConditionBoostSpecs( 9869 int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { 9870 if (invalidConditionBoostSpecsBuilder_ == null) { 9871 if (value == null) { 9872 throw new NullPointerException(); 9873 } 9874 ensureInvalidConditionBoostSpecsIsMutable(); 9875 invalidConditionBoostSpecs_.set(index, value); 9876 onChanged(); 9877 } else { 9878 invalidConditionBoostSpecsBuilder_.setMessage(index, value); 9879 } 9880 return this; 9881 } 9882 /** 9883 * 9884 * 9885 * <pre> 9886 * The invalid 9887 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9888 * that are not applied during serving. 9889 * </pre> 9890 * 9891 * <code> 9892 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9893 * </code> 9894 */ setInvalidConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)9895 public Builder setInvalidConditionBoostSpecs( 9896 int index, 9897 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder 9898 builderForValue) { 9899 if (invalidConditionBoostSpecsBuilder_ == null) { 9900 ensureInvalidConditionBoostSpecsIsMutable(); 9901 invalidConditionBoostSpecs_.set(index, builderForValue.build()); 9902 onChanged(); 9903 } else { 9904 invalidConditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); 9905 } 9906 return this; 9907 } 9908 /** 9909 * 9910 * 9911 * <pre> 9912 * The invalid 9913 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9914 * that are not applied during serving. 9915 * </pre> 9916 * 9917 * <code> 9918 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9919 * </code> 9920 */ addInvalidConditionBoostSpecs( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)9921 public Builder addInvalidConditionBoostSpecs( 9922 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { 9923 if (invalidConditionBoostSpecsBuilder_ == null) { 9924 if (value == null) { 9925 throw new NullPointerException(); 9926 } 9927 ensureInvalidConditionBoostSpecsIsMutable(); 9928 invalidConditionBoostSpecs_.add(value); 9929 onChanged(); 9930 } else { 9931 invalidConditionBoostSpecsBuilder_.addMessage(value); 9932 } 9933 return this; 9934 } 9935 /** 9936 * 9937 * 9938 * <pre> 9939 * The invalid 9940 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9941 * that are not applied during serving. 9942 * </pre> 9943 * 9944 * <code> 9945 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9946 * </code> 9947 */ addInvalidConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value)9948 public Builder addInvalidConditionBoostSpecs( 9949 int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec value) { 9950 if (invalidConditionBoostSpecsBuilder_ == null) { 9951 if (value == null) { 9952 throw new NullPointerException(); 9953 } 9954 ensureInvalidConditionBoostSpecsIsMutable(); 9955 invalidConditionBoostSpecs_.add(index, value); 9956 onChanged(); 9957 } else { 9958 invalidConditionBoostSpecsBuilder_.addMessage(index, value); 9959 } 9960 return this; 9961 } 9962 /** 9963 * 9964 * 9965 * <pre> 9966 * The invalid 9967 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9968 * that are not applied during serving. 9969 * </pre> 9970 * 9971 * <code> 9972 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9973 * </code> 9974 */ addInvalidConditionBoostSpecs( com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)9975 public Builder addInvalidConditionBoostSpecs( 9976 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder 9977 builderForValue) { 9978 if (invalidConditionBoostSpecsBuilder_ == null) { 9979 ensureInvalidConditionBoostSpecsIsMutable(); 9980 invalidConditionBoostSpecs_.add(builderForValue.build()); 9981 onChanged(); 9982 } else { 9983 invalidConditionBoostSpecsBuilder_.addMessage(builderForValue.build()); 9984 } 9985 return this; 9986 } 9987 /** 9988 * 9989 * 9990 * <pre> 9991 * The invalid 9992 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 9993 * that are not applied during serving. 9994 * </pre> 9995 * 9996 * <code> 9997 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 9998 * </code> 9999 */ addInvalidConditionBoostSpecs( int index, com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder builderForValue)10000 public Builder addInvalidConditionBoostSpecs( 10001 int index, 10002 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder 10003 builderForValue) { 10004 if (invalidConditionBoostSpecsBuilder_ == null) { 10005 ensureInvalidConditionBoostSpecsIsMutable(); 10006 invalidConditionBoostSpecs_.add(index, builderForValue.build()); 10007 onChanged(); 10008 } else { 10009 invalidConditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); 10010 } 10011 return this; 10012 } 10013 /** 10014 * 10015 * 10016 * <pre> 10017 * The invalid 10018 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10019 * that are not applied during serving. 10020 * </pre> 10021 * 10022 * <code> 10023 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10024 * </code> 10025 */ addAllInvalidConditionBoostSpecs( java.lang.Iterable< ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> values)10026 public Builder addAllInvalidConditionBoostSpecs( 10027 java.lang.Iterable< 10028 ? extends com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec> 10029 values) { 10030 if (invalidConditionBoostSpecsBuilder_ == null) { 10031 ensureInvalidConditionBoostSpecsIsMutable(); 10032 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidConditionBoostSpecs_); 10033 onChanged(); 10034 } else { 10035 invalidConditionBoostSpecsBuilder_.addAllMessages(values); 10036 } 10037 return this; 10038 } 10039 /** 10040 * 10041 * 10042 * <pre> 10043 * The invalid 10044 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10045 * that are not applied during serving. 10046 * </pre> 10047 * 10048 * <code> 10049 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10050 * </code> 10051 */ clearInvalidConditionBoostSpecs()10052 public Builder clearInvalidConditionBoostSpecs() { 10053 if (invalidConditionBoostSpecsBuilder_ == null) { 10054 invalidConditionBoostSpecs_ = java.util.Collections.emptyList(); 10055 bitField0_ = (bitField0_ & ~0x00000200); 10056 onChanged(); 10057 } else { 10058 invalidConditionBoostSpecsBuilder_.clear(); 10059 } 10060 return this; 10061 } 10062 /** 10063 * 10064 * 10065 * <pre> 10066 * The invalid 10067 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10068 * that are not applied during serving. 10069 * </pre> 10070 * 10071 * <code> 10072 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10073 * </code> 10074 */ removeInvalidConditionBoostSpecs(int index)10075 public Builder removeInvalidConditionBoostSpecs(int index) { 10076 if (invalidConditionBoostSpecsBuilder_ == null) { 10077 ensureInvalidConditionBoostSpecsIsMutable(); 10078 invalidConditionBoostSpecs_.remove(index); 10079 onChanged(); 10080 } else { 10081 invalidConditionBoostSpecsBuilder_.remove(index); 10082 } 10083 return this; 10084 } 10085 /** 10086 * 10087 * 10088 * <pre> 10089 * The invalid 10090 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10091 * that are not applied during serving. 10092 * </pre> 10093 * 10094 * <code> 10095 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10096 * </code> 10097 */ 10098 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder getInvalidConditionBoostSpecsBuilder(int index)10099 getInvalidConditionBoostSpecsBuilder(int index) { 10100 return getInvalidConditionBoostSpecsFieldBuilder().getBuilder(index); 10101 } 10102 /** 10103 * 10104 * 10105 * <pre> 10106 * The invalid 10107 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10108 * that are not applied during serving. 10109 * </pre> 10110 * 10111 * <code> 10112 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10113 * </code> 10114 */ 10115 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder getInvalidConditionBoostSpecsOrBuilder(int index)10116 getInvalidConditionBoostSpecsOrBuilder(int index) { 10117 if (invalidConditionBoostSpecsBuilder_ == null) { 10118 return invalidConditionBoostSpecs_.get(index); 10119 } else { 10120 return invalidConditionBoostSpecsBuilder_.getMessageOrBuilder(index); 10121 } 10122 } 10123 /** 10124 * 10125 * 10126 * <pre> 10127 * The invalid 10128 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10129 * that are not applied during serving. 10130 * </pre> 10131 * 10132 * <code> 10133 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10134 * </code> 10135 */ 10136 public java.util.List< 10137 ? extends 10138 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> getInvalidConditionBoostSpecsOrBuilderList()10139 getInvalidConditionBoostSpecsOrBuilderList() { 10140 if (invalidConditionBoostSpecsBuilder_ != null) { 10141 return invalidConditionBoostSpecsBuilder_.getMessageOrBuilderList(); 10142 } else { 10143 return java.util.Collections.unmodifiableList(invalidConditionBoostSpecs_); 10144 } 10145 } 10146 /** 10147 * 10148 * 10149 * <pre> 10150 * The invalid 10151 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10152 * that are not applied during serving. 10153 * </pre> 10154 * 10155 * <code> 10156 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10157 * </code> 10158 */ 10159 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder addInvalidConditionBoostSpecsBuilder()10160 addInvalidConditionBoostSpecsBuilder() { 10161 return getInvalidConditionBoostSpecsFieldBuilder() 10162 .addBuilder( 10163 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec 10164 .getDefaultInstance()); 10165 } 10166 /** 10167 * 10168 * 10169 * <pre> 10170 * The invalid 10171 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10172 * that are not applied during serving. 10173 * </pre> 10174 * 10175 * <code> 10176 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10177 * </code> 10178 */ 10179 public com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder addInvalidConditionBoostSpecsBuilder(int index)10180 addInvalidConditionBoostSpecsBuilder(int index) { 10181 return getInvalidConditionBoostSpecsFieldBuilder() 10182 .addBuilder( 10183 index, 10184 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec 10185 .getDefaultInstance()); 10186 } 10187 /** 10188 * 10189 * 10190 * <pre> 10191 * The invalid 10192 * [SearchRequest.BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs] 10193 * that are not applied during serving. 10194 * </pre> 10195 * 10196 * <code> 10197 * repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec invalid_condition_boost_specs = 14; 10198 * </code> 10199 */ 10200 public java.util.List< 10201 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder> getInvalidConditionBoostSpecsBuilderList()10202 getInvalidConditionBoostSpecsBuilderList() { 10203 return getInvalidConditionBoostSpecsFieldBuilder().getBuilderList(); 10204 } 10205 10206 private com.google.protobuf.RepeatedFieldBuilderV3< 10207 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, 10208 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, 10209 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder> getInvalidConditionBoostSpecsFieldBuilder()10210 getInvalidConditionBoostSpecsFieldBuilder() { 10211 if (invalidConditionBoostSpecsBuilder_ == null) { 10212 invalidConditionBoostSpecsBuilder_ = 10213 new com.google.protobuf.RepeatedFieldBuilderV3< 10214 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec, 10215 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec.Builder, 10216 com.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder>( 10217 invalidConditionBoostSpecs_, 10218 ((bitField0_ & 0x00000200) != 0), 10219 getParentForChildren(), 10220 isClean()); 10221 invalidConditionBoostSpecs_ = null; 10222 } 10223 return invalidConditionBoostSpecsBuilder_; 10224 } 10225 10226 private java.util.List<com.google.cloud.retail.v2.ExperimentInfo> experimentInfo_ = 10227 java.util.Collections.emptyList(); 10228 ensureExperimentInfoIsMutable()10229 private void ensureExperimentInfoIsMutable() { 10230 if (!((bitField0_ & 0x00000400) != 0)) { 10231 experimentInfo_ = 10232 new java.util.ArrayList<com.google.cloud.retail.v2.ExperimentInfo>(experimentInfo_); 10233 bitField0_ |= 0x00000400; 10234 } 10235 } 10236 10237 private com.google.protobuf.RepeatedFieldBuilderV3< 10238 com.google.cloud.retail.v2.ExperimentInfo, 10239 com.google.cloud.retail.v2.ExperimentInfo.Builder, 10240 com.google.cloud.retail.v2.ExperimentInfoOrBuilder> 10241 experimentInfoBuilder_; 10242 10243 /** 10244 * 10245 * 10246 * <pre> 10247 * Metadata related to A/B testing [Experiment][] associated with this 10248 * response. Only exists when an experiment is triggered. 10249 * </pre> 10250 * 10251 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10252 */ getExperimentInfoList()10253 public java.util.List<com.google.cloud.retail.v2.ExperimentInfo> getExperimentInfoList() { 10254 if (experimentInfoBuilder_ == null) { 10255 return java.util.Collections.unmodifiableList(experimentInfo_); 10256 } else { 10257 return experimentInfoBuilder_.getMessageList(); 10258 } 10259 } 10260 /** 10261 * 10262 * 10263 * <pre> 10264 * Metadata related to A/B testing [Experiment][] associated with this 10265 * response. Only exists when an experiment is triggered. 10266 * </pre> 10267 * 10268 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10269 */ getExperimentInfoCount()10270 public int getExperimentInfoCount() { 10271 if (experimentInfoBuilder_ == null) { 10272 return experimentInfo_.size(); 10273 } else { 10274 return experimentInfoBuilder_.getCount(); 10275 } 10276 } 10277 /** 10278 * 10279 * 10280 * <pre> 10281 * Metadata related to A/B testing [Experiment][] associated with this 10282 * response. Only exists when an experiment is triggered. 10283 * </pre> 10284 * 10285 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10286 */ getExperimentInfo(int index)10287 public com.google.cloud.retail.v2.ExperimentInfo getExperimentInfo(int index) { 10288 if (experimentInfoBuilder_ == null) { 10289 return experimentInfo_.get(index); 10290 } else { 10291 return experimentInfoBuilder_.getMessage(index); 10292 } 10293 } 10294 /** 10295 * 10296 * 10297 * <pre> 10298 * Metadata related to A/B testing [Experiment][] associated with this 10299 * response. Only exists when an experiment is triggered. 10300 * </pre> 10301 * 10302 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10303 */ setExperimentInfo(int index, com.google.cloud.retail.v2.ExperimentInfo value)10304 public Builder setExperimentInfo(int index, com.google.cloud.retail.v2.ExperimentInfo value) { 10305 if (experimentInfoBuilder_ == null) { 10306 if (value == null) { 10307 throw new NullPointerException(); 10308 } 10309 ensureExperimentInfoIsMutable(); 10310 experimentInfo_.set(index, value); 10311 onChanged(); 10312 } else { 10313 experimentInfoBuilder_.setMessage(index, value); 10314 } 10315 return this; 10316 } 10317 /** 10318 * 10319 * 10320 * <pre> 10321 * Metadata related to A/B testing [Experiment][] associated with this 10322 * response. Only exists when an experiment is triggered. 10323 * </pre> 10324 * 10325 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10326 */ setExperimentInfo( int index, com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue)10327 public Builder setExperimentInfo( 10328 int index, com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue) { 10329 if (experimentInfoBuilder_ == null) { 10330 ensureExperimentInfoIsMutable(); 10331 experimentInfo_.set(index, builderForValue.build()); 10332 onChanged(); 10333 } else { 10334 experimentInfoBuilder_.setMessage(index, builderForValue.build()); 10335 } 10336 return this; 10337 } 10338 /** 10339 * 10340 * 10341 * <pre> 10342 * Metadata related to A/B testing [Experiment][] associated with this 10343 * response. Only exists when an experiment is triggered. 10344 * </pre> 10345 * 10346 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10347 */ addExperimentInfo(com.google.cloud.retail.v2.ExperimentInfo value)10348 public Builder addExperimentInfo(com.google.cloud.retail.v2.ExperimentInfo value) { 10349 if (experimentInfoBuilder_ == null) { 10350 if (value == null) { 10351 throw new NullPointerException(); 10352 } 10353 ensureExperimentInfoIsMutable(); 10354 experimentInfo_.add(value); 10355 onChanged(); 10356 } else { 10357 experimentInfoBuilder_.addMessage(value); 10358 } 10359 return this; 10360 } 10361 /** 10362 * 10363 * 10364 * <pre> 10365 * Metadata related to A/B testing [Experiment][] associated with this 10366 * response. Only exists when an experiment is triggered. 10367 * </pre> 10368 * 10369 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10370 */ addExperimentInfo(int index, com.google.cloud.retail.v2.ExperimentInfo value)10371 public Builder addExperimentInfo(int index, com.google.cloud.retail.v2.ExperimentInfo value) { 10372 if (experimentInfoBuilder_ == null) { 10373 if (value == null) { 10374 throw new NullPointerException(); 10375 } 10376 ensureExperimentInfoIsMutable(); 10377 experimentInfo_.add(index, value); 10378 onChanged(); 10379 } else { 10380 experimentInfoBuilder_.addMessage(index, value); 10381 } 10382 return this; 10383 } 10384 /** 10385 * 10386 * 10387 * <pre> 10388 * Metadata related to A/B testing [Experiment][] associated with this 10389 * response. Only exists when an experiment is triggered. 10390 * </pre> 10391 * 10392 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10393 */ addExperimentInfo( com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue)10394 public Builder addExperimentInfo( 10395 com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue) { 10396 if (experimentInfoBuilder_ == null) { 10397 ensureExperimentInfoIsMutable(); 10398 experimentInfo_.add(builderForValue.build()); 10399 onChanged(); 10400 } else { 10401 experimentInfoBuilder_.addMessage(builderForValue.build()); 10402 } 10403 return this; 10404 } 10405 /** 10406 * 10407 * 10408 * <pre> 10409 * Metadata related to A/B testing [Experiment][] associated with this 10410 * response. Only exists when an experiment is triggered. 10411 * </pre> 10412 * 10413 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10414 */ addExperimentInfo( int index, com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue)10415 public Builder addExperimentInfo( 10416 int index, com.google.cloud.retail.v2.ExperimentInfo.Builder builderForValue) { 10417 if (experimentInfoBuilder_ == null) { 10418 ensureExperimentInfoIsMutable(); 10419 experimentInfo_.add(index, builderForValue.build()); 10420 onChanged(); 10421 } else { 10422 experimentInfoBuilder_.addMessage(index, builderForValue.build()); 10423 } 10424 return this; 10425 } 10426 /** 10427 * 10428 * 10429 * <pre> 10430 * Metadata related to A/B testing [Experiment][] associated with this 10431 * response. Only exists when an experiment is triggered. 10432 * </pre> 10433 * 10434 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10435 */ addAllExperimentInfo( java.lang.Iterable<? extends com.google.cloud.retail.v2.ExperimentInfo> values)10436 public Builder addAllExperimentInfo( 10437 java.lang.Iterable<? extends com.google.cloud.retail.v2.ExperimentInfo> values) { 10438 if (experimentInfoBuilder_ == null) { 10439 ensureExperimentInfoIsMutable(); 10440 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, experimentInfo_); 10441 onChanged(); 10442 } else { 10443 experimentInfoBuilder_.addAllMessages(values); 10444 } 10445 return this; 10446 } 10447 /** 10448 * 10449 * 10450 * <pre> 10451 * Metadata related to A/B testing [Experiment][] associated with this 10452 * response. Only exists when an experiment is triggered. 10453 * </pre> 10454 * 10455 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10456 */ clearExperimentInfo()10457 public Builder clearExperimentInfo() { 10458 if (experimentInfoBuilder_ == null) { 10459 experimentInfo_ = java.util.Collections.emptyList(); 10460 bitField0_ = (bitField0_ & ~0x00000400); 10461 onChanged(); 10462 } else { 10463 experimentInfoBuilder_.clear(); 10464 } 10465 return this; 10466 } 10467 /** 10468 * 10469 * 10470 * <pre> 10471 * Metadata related to A/B testing [Experiment][] associated with this 10472 * response. Only exists when an experiment is triggered. 10473 * </pre> 10474 * 10475 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10476 */ removeExperimentInfo(int index)10477 public Builder removeExperimentInfo(int index) { 10478 if (experimentInfoBuilder_ == null) { 10479 ensureExperimentInfoIsMutable(); 10480 experimentInfo_.remove(index); 10481 onChanged(); 10482 } else { 10483 experimentInfoBuilder_.remove(index); 10484 } 10485 return this; 10486 } 10487 /** 10488 * 10489 * 10490 * <pre> 10491 * Metadata related to A/B testing [Experiment][] associated with this 10492 * response. Only exists when an experiment is triggered. 10493 * </pre> 10494 * 10495 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10496 */ getExperimentInfoBuilder(int index)10497 public com.google.cloud.retail.v2.ExperimentInfo.Builder getExperimentInfoBuilder(int index) { 10498 return getExperimentInfoFieldBuilder().getBuilder(index); 10499 } 10500 /** 10501 * 10502 * 10503 * <pre> 10504 * Metadata related to A/B testing [Experiment][] associated with this 10505 * response. Only exists when an experiment is triggered. 10506 * </pre> 10507 * 10508 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10509 */ getExperimentInfoOrBuilder( int index)10510 public com.google.cloud.retail.v2.ExperimentInfoOrBuilder getExperimentInfoOrBuilder( 10511 int index) { 10512 if (experimentInfoBuilder_ == null) { 10513 return experimentInfo_.get(index); 10514 } else { 10515 return experimentInfoBuilder_.getMessageOrBuilder(index); 10516 } 10517 } 10518 /** 10519 * 10520 * 10521 * <pre> 10522 * Metadata related to A/B testing [Experiment][] associated with this 10523 * response. Only exists when an experiment is triggered. 10524 * </pre> 10525 * 10526 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10527 */ 10528 public java.util.List<? extends com.google.cloud.retail.v2.ExperimentInfoOrBuilder> getExperimentInfoOrBuilderList()10529 getExperimentInfoOrBuilderList() { 10530 if (experimentInfoBuilder_ != null) { 10531 return experimentInfoBuilder_.getMessageOrBuilderList(); 10532 } else { 10533 return java.util.Collections.unmodifiableList(experimentInfo_); 10534 } 10535 } 10536 /** 10537 * 10538 * 10539 * <pre> 10540 * Metadata related to A/B testing [Experiment][] associated with this 10541 * response. Only exists when an experiment is triggered. 10542 * </pre> 10543 * 10544 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10545 */ addExperimentInfoBuilder()10546 public com.google.cloud.retail.v2.ExperimentInfo.Builder addExperimentInfoBuilder() { 10547 return getExperimentInfoFieldBuilder() 10548 .addBuilder(com.google.cloud.retail.v2.ExperimentInfo.getDefaultInstance()); 10549 } 10550 /** 10551 * 10552 * 10553 * <pre> 10554 * Metadata related to A/B testing [Experiment][] associated with this 10555 * response. Only exists when an experiment is triggered. 10556 * </pre> 10557 * 10558 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10559 */ addExperimentInfoBuilder(int index)10560 public com.google.cloud.retail.v2.ExperimentInfo.Builder addExperimentInfoBuilder(int index) { 10561 return getExperimentInfoFieldBuilder() 10562 .addBuilder(index, com.google.cloud.retail.v2.ExperimentInfo.getDefaultInstance()); 10563 } 10564 /** 10565 * 10566 * 10567 * <pre> 10568 * Metadata related to A/B testing [Experiment][] associated with this 10569 * response. Only exists when an experiment is triggered. 10570 * </pre> 10571 * 10572 * <code>repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17;</code> 10573 */ 10574 public java.util.List<com.google.cloud.retail.v2.ExperimentInfo.Builder> getExperimentInfoBuilderList()10575 getExperimentInfoBuilderList() { 10576 return getExperimentInfoFieldBuilder().getBuilderList(); 10577 } 10578 10579 private com.google.protobuf.RepeatedFieldBuilderV3< 10580 com.google.cloud.retail.v2.ExperimentInfo, 10581 com.google.cloud.retail.v2.ExperimentInfo.Builder, 10582 com.google.cloud.retail.v2.ExperimentInfoOrBuilder> getExperimentInfoFieldBuilder()10583 getExperimentInfoFieldBuilder() { 10584 if (experimentInfoBuilder_ == null) { 10585 experimentInfoBuilder_ = 10586 new com.google.protobuf.RepeatedFieldBuilderV3< 10587 com.google.cloud.retail.v2.ExperimentInfo, 10588 com.google.cloud.retail.v2.ExperimentInfo.Builder, 10589 com.google.cloud.retail.v2.ExperimentInfoOrBuilder>( 10590 experimentInfo_, 10591 ((bitField0_ & 0x00000400) != 0), 10592 getParentForChildren(), 10593 isClean()); 10594 experimentInfo_ = null; 10595 } 10596 return experimentInfoBuilder_; 10597 } 10598 10599 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)10600 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 10601 return super.setUnknownFields(unknownFields); 10602 } 10603 10604 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)10605 public final Builder mergeUnknownFields( 10606 final com.google.protobuf.UnknownFieldSet unknownFields) { 10607 return super.mergeUnknownFields(unknownFields); 10608 } 10609 10610 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.SearchResponse) 10611 } 10612 10613 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.SearchResponse) 10614 private static final com.google.cloud.retail.v2.SearchResponse DEFAULT_INSTANCE; 10615 10616 static { 10617 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.SearchResponse(); 10618 } 10619 getDefaultInstance()10620 public static com.google.cloud.retail.v2.SearchResponse getDefaultInstance() { 10621 return DEFAULT_INSTANCE; 10622 } 10623 10624 private static final com.google.protobuf.Parser<SearchResponse> PARSER = 10625 new com.google.protobuf.AbstractParser<SearchResponse>() { 10626 @java.lang.Override 10627 public SearchResponse parsePartialFrom( 10628 com.google.protobuf.CodedInputStream input, 10629 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 10630 throws com.google.protobuf.InvalidProtocolBufferException { 10631 Builder builder = newBuilder(); 10632 try { 10633 builder.mergeFrom(input, extensionRegistry); 10634 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 10635 throw e.setUnfinishedMessage(builder.buildPartial()); 10636 } catch (com.google.protobuf.UninitializedMessageException e) { 10637 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 10638 } catch (java.io.IOException e) { 10639 throw new com.google.protobuf.InvalidProtocolBufferException(e) 10640 .setUnfinishedMessage(builder.buildPartial()); 10641 } 10642 return builder.buildPartial(); 10643 } 10644 }; 10645 parser()10646 public static com.google.protobuf.Parser<SearchResponse> parser() { 10647 return PARSER; 10648 } 10649 10650 @java.lang.Override getParserForType()10651 public com.google.protobuf.Parser<SearchResponse> getParserForType() { 10652 return PARSER; 10653 } 10654 10655 @java.lang.Override getDefaultInstanceForType()10656 public com.google.cloud.retail.v2.SearchResponse getDefaultInstanceForType() { 10657 return DEFAULT_INSTANCE; 10658 } 10659 } 10660