1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/retail/v2/common.proto 18 19 package com.google.cloud.retail.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * A floating point interval. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.retail.v2.Interval} 29 */ 30 public final class Interval extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.Interval) 33 IntervalOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Interval.newBuilder() to construct. Interval(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Interval(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Interval()40 private Interval() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new Interval(); 46 } 47 48 @java.lang.Override getUnknownFields()49 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 50 return this.unknownFields; 51 } 52 getDescriptor()53 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 54 return com.google.cloud.retail.v2.CommonProto 55 .internal_static_google_cloud_retail_v2_Interval_descriptor; 56 } 57 58 @java.lang.Override 59 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()60 internalGetFieldAccessorTable() { 61 return com.google.cloud.retail.v2.CommonProto 62 .internal_static_google_cloud_retail_v2_Interval_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.retail.v2.Interval.class, 65 com.google.cloud.retail.v2.Interval.Builder.class); 66 } 67 68 private int minCase_ = 0; 69 private java.lang.Object min_; 70 71 public enum MinCase 72 implements 73 com.google.protobuf.Internal.EnumLite, 74 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 75 MINIMUM(1), 76 EXCLUSIVE_MINIMUM(2), 77 MIN_NOT_SET(0); 78 private final int value; 79 MinCase(int value)80 private MinCase(int value) { 81 this.value = value; 82 } 83 /** 84 * @param value The number of the enum to look for. 85 * @return The enum associated with the given number. 86 * @deprecated Use {@link #forNumber(int)} instead. 87 */ 88 @java.lang.Deprecated valueOf(int value)89 public static MinCase valueOf(int value) { 90 return forNumber(value); 91 } 92 forNumber(int value)93 public static MinCase forNumber(int value) { 94 switch (value) { 95 case 1: 96 return MINIMUM; 97 case 2: 98 return EXCLUSIVE_MINIMUM; 99 case 0: 100 return MIN_NOT_SET; 101 default: 102 return null; 103 } 104 } 105 getNumber()106 public int getNumber() { 107 return this.value; 108 } 109 }; 110 getMinCase()111 public MinCase getMinCase() { 112 return MinCase.forNumber(minCase_); 113 } 114 115 private int maxCase_ = 0; 116 private java.lang.Object max_; 117 118 public enum MaxCase 119 implements 120 com.google.protobuf.Internal.EnumLite, 121 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 122 MAXIMUM(3), 123 EXCLUSIVE_MAXIMUM(4), 124 MAX_NOT_SET(0); 125 private final int value; 126 MaxCase(int value)127 private MaxCase(int value) { 128 this.value = value; 129 } 130 /** 131 * @param value The number of the enum to look for. 132 * @return The enum associated with the given number. 133 * @deprecated Use {@link #forNumber(int)} instead. 134 */ 135 @java.lang.Deprecated valueOf(int value)136 public static MaxCase valueOf(int value) { 137 return forNumber(value); 138 } 139 forNumber(int value)140 public static MaxCase forNumber(int value) { 141 switch (value) { 142 case 3: 143 return MAXIMUM; 144 case 4: 145 return EXCLUSIVE_MAXIMUM; 146 case 0: 147 return MAX_NOT_SET; 148 default: 149 return null; 150 } 151 } 152 getNumber()153 public int getNumber() { 154 return this.value; 155 } 156 }; 157 getMaxCase()158 public MaxCase getMaxCase() { 159 return MaxCase.forNumber(maxCase_); 160 } 161 162 public static final int MINIMUM_FIELD_NUMBER = 1; 163 /** 164 * 165 * 166 * <pre> 167 * Inclusive lower bound. 168 * </pre> 169 * 170 * <code>double minimum = 1;</code> 171 * 172 * @return Whether the minimum field is set. 173 */ 174 @java.lang.Override hasMinimum()175 public boolean hasMinimum() { 176 return minCase_ == 1; 177 } 178 /** 179 * 180 * 181 * <pre> 182 * Inclusive lower bound. 183 * </pre> 184 * 185 * <code>double minimum = 1;</code> 186 * 187 * @return The minimum. 188 */ 189 @java.lang.Override getMinimum()190 public double getMinimum() { 191 if (minCase_ == 1) { 192 return (java.lang.Double) min_; 193 } 194 return 0D; 195 } 196 197 public static final int EXCLUSIVE_MINIMUM_FIELD_NUMBER = 2; 198 /** 199 * 200 * 201 * <pre> 202 * Exclusive lower bound. 203 * </pre> 204 * 205 * <code>double exclusive_minimum = 2;</code> 206 * 207 * @return Whether the exclusiveMinimum field is set. 208 */ 209 @java.lang.Override hasExclusiveMinimum()210 public boolean hasExclusiveMinimum() { 211 return minCase_ == 2; 212 } 213 /** 214 * 215 * 216 * <pre> 217 * Exclusive lower bound. 218 * </pre> 219 * 220 * <code>double exclusive_minimum = 2;</code> 221 * 222 * @return The exclusiveMinimum. 223 */ 224 @java.lang.Override getExclusiveMinimum()225 public double getExclusiveMinimum() { 226 if (minCase_ == 2) { 227 return (java.lang.Double) min_; 228 } 229 return 0D; 230 } 231 232 public static final int MAXIMUM_FIELD_NUMBER = 3; 233 /** 234 * 235 * 236 * <pre> 237 * Inclusive upper bound. 238 * </pre> 239 * 240 * <code>double maximum = 3;</code> 241 * 242 * @return Whether the maximum field is set. 243 */ 244 @java.lang.Override hasMaximum()245 public boolean hasMaximum() { 246 return maxCase_ == 3; 247 } 248 /** 249 * 250 * 251 * <pre> 252 * Inclusive upper bound. 253 * </pre> 254 * 255 * <code>double maximum = 3;</code> 256 * 257 * @return The maximum. 258 */ 259 @java.lang.Override getMaximum()260 public double getMaximum() { 261 if (maxCase_ == 3) { 262 return (java.lang.Double) max_; 263 } 264 return 0D; 265 } 266 267 public static final int EXCLUSIVE_MAXIMUM_FIELD_NUMBER = 4; 268 /** 269 * 270 * 271 * <pre> 272 * Exclusive upper bound. 273 * </pre> 274 * 275 * <code>double exclusive_maximum = 4;</code> 276 * 277 * @return Whether the exclusiveMaximum field is set. 278 */ 279 @java.lang.Override hasExclusiveMaximum()280 public boolean hasExclusiveMaximum() { 281 return maxCase_ == 4; 282 } 283 /** 284 * 285 * 286 * <pre> 287 * Exclusive upper bound. 288 * </pre> 289 * 290 * <code>double exclusive_maximum = 4;</code> 291 * 292 * @return The exclusiveMaximum. 293 */ 294 @java.lang.Override getExclusiveMaximum()295 public double getExclusiveMaximum() { 296 if (maxCase_ == 4) { 297 return (java.lang.Double) max_; 298 } 299 return 0D; 300 } 301 302 private byte memoizedIsInitialized = -1; 303 304 @java.lang.Override isInitialized()305 public final boolean isInitialized() { 306 byte isInitialized = memoizedIsInitialized; 307 if (isInitialized == 1) return true; 308 if (isInitialized == 0) return false; 309 310 memoizedIsInitialized = 1; 311 return true; 312 } 313 314 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)315 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 316 if (minCase_ == 1) { 317 output.writeDouble(1, (double) ((java.lang.Double) min_)); 318 } 319 if (minCase_ == 2) { 320 output.writeDouble(2, (double) ((java.lang.Double) min_)); 321 } 322 if (maxCase_ == 3) { 323 output.writeDouble(3, (double) ((java.lang.Double) max_)); 324 } 325 if (maxCase_ == 4) { 326 output.writeDouble(4, (double) ((java.lang.Double) max_)); 327 } 328 getUnknownFields().writeTo(output); 329 } 330 331 @java.lang.Override getSerializedSize()332 public int getSerializedSize() { 333 int size = memoizedSize; 334 if (size != -1) return size; 335 336 size = 0; 337 if (minCase_ == 1) { 338 size += 339 com.google.protobuf.CodedOutputStream.computeDoubleSize( 340 1, (double) ((java.lang.Double) min_)); 341 } 342 if (minCase_ == 2) { 343 size += 344 com.google.protobuf.CodedOutputStream.computeDoubleSize( 345 2, (double) ((java.lang.Double) min_)); 346 } 347 if (maxCase_ == 3) { 348 size += 349 com.google.protobuf.CodedOutputStream.computeDoubleSize( 350 3, (double) ((java.lang.Double) max_)); 351 } 352 if (maxCase_ == 4) { 353 size += 354 com.google.protobuf.CodedOutputStream.computeDoubleSize( 355 4, (double) ((java.lang.Double) max_)); 356 } 357 size += getUnknownFields().getSerializedSize(); 358 memoizedSize = size; 359 return size; 360 } 361 362 @java.lang.Override equals(final java.lang.Object obj)363 public boolean equals(final java.lang.Object obj) { 364 if (obj == this) { 365 return true; 366 } 367 if (!(obj instanceof com.google.cloud.retail.v2.Interval)) { 368 return super.equals(obj); 369 } 370 com.google.cloud.retail.v2.Interval other = (com.google.cloud.retail.v2.Interval) obj; 371 372 if (!getMinCase().equals(other.getMinCase())) return false; 373 switch (minCase_) { 374 case 1: 375 if (java.lang.Double.doubleToLongBits(getMinimum()) 376 != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; 377 break; 378 case 2: 379 if (java.lang.Double.doubleToLongBits(getExclusiveMinimum()) 380 != java.lang.Double.doubleToLongBits(other.getExclusiveMinimum())) return false; 381 break; 382 case 0: 383 default: 384 } 385 if (!getMaxCase().equals(other.getMaxCase())) return false; 386 switch (maxCase_) { 387 case 3: 388 if (java.lang.Double.doubleToLongBits(getMaximum()) 389 != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; 390 break; 391 case 4: 392 if (java.lang.Double.doubleToLongBits(getExclusiveMaximum()) 393 != java.lang.Double.doubleToLongBits(other.getExclusiveMaximum())) return false; 394 break; 395 case 0: 396 default: 397 } 398 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 399 return true; 400 } 401 402 @java.lang.Override hashCode()403 public int hashCode() { 404 if (memoizedHashCode != 0) { 405 return memoizedHashCode; 406 } 407 int hash = 41; 408 hash = (19 * hash) + getDescriptor().hashCode(); 409 switch (minCase_) { 410 case 1: 411 hash = (37 * hash) + MINIMUM_FIELD_NUMBER; 412 hash = 413 (53 * hash) 414 + com.google.protobuf.Internal.hashLong( 415 java.lang.Double.doubleToLongBits(getMinimum())); 416 break; 417 case 2: 418 hash = (37 * hash) + EXCLUSIVE_MINIMUM_FIELD_NUMBER; 419 hash = 420 (53 * hash) 421 + com.google.protobuf.Internal.hashLong( 422 java.lang.Double.doubleToLongBits(getExclusiveMinimum())); 423 break; 424 case 0: 425 default: 426 } 427 switch (maxCase_) { 428 case 3: 429 hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; 430 hash = 431 (53 * hash) 432 + com.google.protobuf.Internal.hashLong( 433 java.lang.Double.doubleToLongBits(getMaximum())); 434 break; 435 case 4: 436 hash = (37 * hash) + EXCLUSIVE_MAXIMUM_FIELD_NUMBER; 437 hash = 438 (53 * hash) 439 + com.google.protobuf.Internal.hashLong( 440 java.lang.Double.doubleToLongBits(getExclusiveMaximum())); 441 break; 442 case 0: 443 default: 444 } 445 hash = (29 * hash) + getUnknownFields().hashCode(); 446 memoizedHashCode = hash; 447 return hash; 448 } 449 parseFrom(java.nio.ByteBuffer data)450 public static com.google.cloud.retail.v2.Interval parseFrom(java.nio.ByteBuffer data) 451 throws com.google.protobuf.InvalidProtocolBufferException { 452 return PARSER.parseFrom(data); 453 } 454 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)455 public static com.google.cloud.retail.v2.Interval parseFrom( 456 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 457 throws com.google.protobuf.InvalidProtocolBufferException { 458 return PARSER.parseFrom(data, extensionRegistry); 459 } 460 parseFrom(com.google.protobuf.ByteString data)461 public static com.google.cloud.retail.v2.Interval parseFrom(com.google.protobuf.ByteString data) 462 throws com.google.protobuf.InvalidProtocolBufferException { 463 return PARSER.parseFrom(data); 464 } 465 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)466 public static com.google.cloud.retail.v2.Interval parseFrom( 467 com.google.protobuf.ByteString data, 468 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 469 throws com.google.protobuf.InvalidProtocolBufferException { 470 return PARSER.parseFrom(data, extensionRegistry); 471 } 472 parseFrom(byte[] data)473 public static com.google.cloud.retail.v2.Interval parseFrom(byte[] data) 474 throws com.google.protobuf.InvalidProtocolBufferException { 475 return PARSER.parseFrom(data); 476 } 477 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)478 public static com.google.cloud.retail.v2.Interval parseFrom( 479 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 480 throws com.google.protobuf.InvalidProtocolBufferException { 481 return PARSER.parseFrom(data, extensionRegistry); 482 } 483 parseFrom(java.io.InputStream input)484 public static com.google.cloud.retail.v2.Interval parseFrom(java.io.InputStream input) 485 throws java.io.IOException { 486 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 487 } 488 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)489 public static com.google.cloud.retail.v2.Interval parseFrom( 490 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 491 throws java.io.IOException { 492 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 493 PARSER, input, extensionRegistry); 494 } 495 parseDelimitedFrom(java.io.InputStream input)496 public static com.google.cloud.retail.v2.Interval parseDelimitedFrom(java.io.InputStream input) 497 throws java.io.IOException { 498 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 499 } 500 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)501 public static com.google.cloud.retail.v2.Interval parseDelimitedFrom( 502 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 503 throws java.io.IOException { 504 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 505 PARSER, input, extensionRegistry); 506 } 507 parseFrom( com.google.protobuf.CodedInputStream input)508 public static com.google.cloud.retail.v2.Interval parseFrom( 509 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 510 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 511 } 512 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)513 public static com.google.cloud.retail.v2.Interval parseFrom( 514 com.google.protobuf.CodedInputStream input, 515 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 516 throws java.io.IOException { 517 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 518 PARSER, input, extensionRegistry); 519 } 520 521 @java.lang.Override newBuilderForType()522 public Builder newBuilderForType() { 523 return newBuilder(); 524 } 525 newBuilder()526 public static Builder newBuilder() { 527 return DEFAULT_INSTANCE.toBuilder(); 528 } 529 newBuilder(com.google.cloud.retail.v2.Interval prototype)530 public static Builder newBuilder(com.google.cloud.retail.v2.Interval prototype) { 531 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 532 } 533 534 @java.lang.Override toBuilder()535 public Builder toBuilder() { 536 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 537 } 538 539 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)540 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 541 Builder builder = new Builder(parent); 542 return builder; 543 } 544 /** 545 * 546 * 547 * <pre> 548 * A floating point interval. 549 * </pre> 550 * 551 * Protobuf type {@code google.cloud.retail.v2.Interval} 552 */ 553 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 554 implements 555 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.Interval) 556 com.google.cloud.retail.v2.IntervalOrBuilder { getDescriptor()557 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 558 return com.google.cloud.retail.v2.CommonProto 559 .internal_static_google_cloud_retail_v2_Interval_descriptor; 560 } 561 562 @java.lang.Override 563 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()564 internalGetFieldAccessorTable() { 565 return com.google.cloud.retail.v2.CommonProto 566 .internal_static_google_cloud_retail_v2_Interval_fieldAccessorTable 567 .ensureFieldAccessorsInitialized( 568 com.google.cloud.retail.v2.Interval.class, 569 com.google.cloud.retail.v2.Interval.Builder.class); 570 } 571 572 // Construct using com.google.cloud.retail.v2.Interval.newBuilder() Builder()573 private Builder() {} 574 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)575 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 576 super(parent); 577 } 578 579 @java.lang.Override clear()580 public Builder clear() { 581 super.clear(); 582 bitField0_ = 0; 583 minCase_ = 0; 584 min_ = null; 585 maxCase_ = 0; 586 max_ = null; 587 return this; 588 } 589 590 @java.lang.Override getDescriptorForType()591 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 592 return com.google.cloud.retail.v2.CommonProto 593 .internal_static_google_cloud_retail_v2_Interval_descriptor; 594 } 595 596 @java.lang.Override getDefaultInstanceForType()597 public com.google.cloud.retail.v2.Interval getDefaultInstanceForType() { 598 return com.google.cloud.retail.v2.Interval.getDefaultInstance(); 599 } 600 601 @java.lang.Override build()602 public com.google.cloud.retail.v2.Interval build() { 603 com.google.cloud.retail.v2.Interval result = buildPartial(); 604 if (!result.isInitialized()) { 605 throw newUninitializedMessageException(result); 606 } 607 return result; 608 } 609 610 @java.lang.Override buildPartial()611 public com.google.cloud.retail.v2.Interval buildPartial() { 612 com.google.cloud.retail.v2.Interval result = new com.google.cloud.retail.v2.Interval(this); 613 if (bitField0_ != 0) { 614 buildPartial0(result); 615 } 616 buildPartialOneofs(result); 617 onBuilt(); 618 return result; 619 } 620 buildPartial0(com.google.cloud.retail.v2.Interval result)621 private void buildPartial0(com.google.cloud.retail.v2.Interval result) { 622 int from_bitField0_ = bitField0_; 623 } 624 buildPartialOneofs(com.google.cloud.retail.v2.Interval result)625 private void buildPartialOneofs(com.google.cloud.retail.v2.Interval result) { 626 result.minCase_ = minCase_; 627 result.min_ = this.min_; 628 result.maxCase_ = maxCase_; 629 result.max_ = this.max_; 630 } 631 632 @java.lang.Override clone()633 public Builder clone() { 634 return super.clone(); 635 } 636 637 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)638 public Builder setField( 639 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 640 return super.setField(field, value); 641 } 642 643 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)644 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 645 return super.clearField(field); 646 } 647 648 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)649 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 650 return super.clearOneof(oneof); 651 } 652 653 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)654 public Builder setRepeatedField( 655 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 656 return super.setRepeatedField(field, index, value); 657 } 658 659 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)660 public Builder addRepeatedField( 661 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 662 return super.addRepeatedField(field, value); 663 } 664 665 @java.lang.Override mergeFrom(com.google.protobuf.Message other)666 public Builder mergeFrom(com.google.protobuf.Message other) { 667 if (other instanceof com.google.cloud.retail.v2.Interval) { 668 return mergeFrom((com.google.cloud.retail.v2.Interval) other); 669 } else { 670 super.mergeFrom(other); 671 return this; 672 } 673 } 674 mergeFrom(com.google.cloud.retail.v2.Interval other)675 public Builder mergeFrom(com.google.cloud.retail.v2.Interval other) { 676 if (other == com.google.cloud.retail.v2.Interval.getDefaultInstance()) return this; 677 switch (other.getMinCase()) { 678 case MINIMUM: 679 { 680 setMinimum(other.getMinimum()); 681 break; 682 } 683 case EXCLUSIVE_MINIMUM: 684 { 685 setExclusiveMinimum(other.getExclusiveMinimum()); 686 break; 687 } 688 case MIN_NOT_SET: 689 { 690 break; 691 } 692 } 693 switch (other.getMaxCase()) { 694 case MAXIMUM: 695 { 696 setMaximum(other.getMaximum()); 697 break; 698 } 699 case EXCLUSIVE_MAXIMUM: 700 { 701 setExclusiveMaximum(other.getExclusiveMaximum()); 702 break; 703 } 704 case MAX_NOT_SET: 705 { 706 break; 707 } 708 } 709 this.mergeUnknownFields(other.getUnknownFields()); 710 onChanged(); 711 return this; 712 } 713 714 @java.lang.Override isInitialized()715 public final boolean isInitialized() { 716 return true; 717 } 718 719 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)720 public Builder mergeFrom( 721 com.google.protobuf.CodedInputStream input, 722 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 723 throws java.io.IOException { 724 if (extensionRegistry == null) { 725 throw new java.lang.NullPointerException(); 726 } 727 try { 728 boolean done = false; 729 while (!done) { 730 int tag = input.readTag(); 731 switch (tag) { 732 case 0: 733 done = true; 734 break; 735 case 9: 736 { 737 min_ = input.readDouble(); 738 minCase_ = 1; 739 break; 740 } // case 9 741 case 17: 742 { 743 min_ = input.readDouble(); 744 minCase_ = 2; 745 break; 746 } // case 17 747 case 25: 748 { 749 max_ = input.readDouble(); 750 maxCase_ = 3; 751 break; 752 } // case 25 753 case 33: 754 { 755 max_ = input.readDouble(); 756 maxCase_ = 4; 757 break; 758 } // case 33 759 default: 760 { 761 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 762 done = true; // was an endgroup tag 763 } 764 break; 765 } // default: 766 } // switch (tag) 767 } // while (!done) 768 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 769 throw e.unwrapIOException(); 770 } finally { 771 onChanged(); 772 } // finally 773 return this; 774 } 775 776 private int minCase_ = 0; 777 private java.lang.Object min_; 778 getMinCase()779 public MinCase getMinCase() { 780 return MinCase.forNumber(minCase_); 781 } 782 clearMin()783 public Builder clearMin() { 784 minCase_ = 0; 785 min_ = null; 786 onChanged(); 787 return this; 788 } 789 790 private int maxCase_ = 0; 791 private java.lang.Object max_; 792 getMaxCase()793 public MaxCase getMaxCase() { 794 return MaxCase.forNumber(maxCase_); 795 } 796 clearMax()797 public Builder clearMax() { 798 maxCase_ = 0; 799 max_ = null; 800 onChanged(); 801 return this; 802 } 803 804 private int bitField0_; 805 806 /** 807 * 808 * 809 * <pre> 810 * Inclusive lower bound. 811 * </pre> 812 * 813 * <code>double minimum = 1;</code> 814 * 815 * @return Whether the minimum field is set. 816 */ hasMinimum()817 public boolean hasMinimum() { 818 return minCase_ == 1; 819 } 820 /** 821 * 822 * 823 * <pre> 824 * Inclusive lower bound. 825 * </pre> 826 * 827 * <code>double minimum = 1;</code> 828 * 829 * @return The minimum. 830 */ getMinimum()831 public double getMinimum() { 832 if (minCase_ == 1) { 833 return (java.lang.Double) min_; 834 } 835 return 0D; 836 } 837 /** 838 * 839 * 840 * <pre> 841 * Inclusive lower bound. 842 * </pre> 843 * 844 * <code>double minimum = 1;</code> 845 * 846 * @param value The minimum to set. 847 * @return This builder for chaining. 848 */ setMinimum(double value)849 public Builder setMinimum(double value) { 850 851 minCase_ = 1; 852 min_ = value; 853 onChanged(); 854 return this; 855 } 856 /** 857 * 858 * 859 * <pre> 860 * Inclusive lower bound. 861 * </pre> 862 * 863 * <code>double minimum = 1;</code> 864 * 865 * @return This builder for chaining. 866 */ clearMinimum()867 public Builder clearMinimum() { 868 if (minCase_ == 1) { 869 minCase_ = 0; 870 min_ = null; 871 onChanged(); 872 } 873 return this; 874 } 875 876 /** 877 * 878 * 879 * <pre> 880 * Exclusive lower bound. 881 * </pre> 882 * 883 * <code>double exclusive_minimum = 2;</code> 884 * 885 * @return Whether the exclusiveMinimum field is set. 886 */ hasExclusiveMinimum()887 public boolean hasExclusiveMinimum() { 888 return minCase_ == 2; 889 } 890 /** 891 * 892 * 893 * <pre> 894 * Exclusive lower bound. 895 * </pre> 896 * 897 * <code>double exclusive_minimum = 2;</code> 898 * 899 * @return The exclusiveMinimum. 900 */ getExclusiveMinimum()901 public double getExclusiveMinimum() { 902 if (minCase_ == 2) { 903 return (java.lang.Double) min_; 904 } 905 return 0D; 906 } 907 /** 908 * 909 * 910 * <pre> 911 * Exclusive lower bound. 912 * </pre> 913 * 914 * <code>double exclusive_minimum = 2;</code> 915 * 916 * @param value The exclusiveMinimum to set. 917 * @return This builder for chaining. 918 */ setExclusiveMinimum(double value)919 public Builder setExclusiveMinimum(double value) { 920 921 minCase_ = 2; 922 min_ = value; 923 onChanged(); 924 return this; 925 } 926 /** 927 * 928 * 929 * <pre> 930 * Exclusive lower bound. 931 * </pre> 932 * 933 * <code>double exclusive_minimum = 2;</code> 934 * 935 * @return This builder for chaining. 936 */ clearExclusiveMinimum()937 public Builder clearExclusiveMinimum() { 938 if (minCase_ == 2) { 939 minCase_ = 0; 940 min_ = null; 941 onChanged(); 942 } 943 return this; 944 } 945 946 /** 947 * 948 * 949 * <pre> 950 * Inclusive upper bound. 951 * </pre> 952 * 953 * <code>double maximum = 3;</code> 954 * 955 * @return Whether the maximum field is set. 956 */ hasMaximum()957 public boolean hasMaximum() { 958 return maxCase_ == 3; 959 } 960 /** 961 * 962 * 963 * <pre> 964 * Inclusive upper bound. 965 * </pre> 966 * 967 * <code>double maximum = 3;</code> 968 * 969 * @return The maximum. 970 */ getMaximum()971 public double getMaximum() { 972 if (maxCase_ == 3) { 973 return (java.lang.Double) max_; 974 } 975 return 0D; 976 } 977 /** 978 * 979 * 980 * <pre> 981 * Inclusive upper bound. 982 * </pre> 983 * 984 * <code>double maximum = 3;</code> 985 * 986 * @param value The maximum to set. 987 * @return This builder for chaining. 988 */ setMaximum(double value)989 public Builder setMaximum(double value) { 990 991 maxCase_ = 3; 992 max_ = value; 993 onChanged(); 994 return this; 995 } 996 /** 997 * 998 * 999 * <pre> 1000 * Inclusive upper bound. 1001 * </pre> 1002 * 1003 * <code>double maximum = 3;</code> 1004 * 1005 * @return This builder for chaining. 1006 */ clearMaximum()1007 public Builder clearMaximum() { 1008 if (maxCase_ == 3) { 1009 maxCase_ = 0; 1010 max_ = null; 1011 onChanged(); 1012 } 1013 return this; 1014 } 1015 1016 /** 1017 * 1018 * 1019 * <pre> 1020 * Exclusive upper bound. 1021 * </pre> 1022 * 1023 * <code>double exclusive_maximum = 4;</code> 1024 * 1025 * @return Whether the exclusiveMaximum field is set. 1026 */ hasExclusiveMaximum()1027 public boolean hasExclusiveMaximum() { 1028 return maxCase_ == 4; 1029 } 1030 /** 1031 * 1032 * 1033 * <pre> 1034 * Exclusive upper bound. 1035 * </pre> 1036 * 1037 * <code>double exclusive_maximum = 4;</code> 1038 * 1039 * @return The exclusiveMaximum. 1040 */ getExclusiveMaximum()1041 public double getExclusiveMaximum() { 1042 if (maxCase_ == 4) { 1043 return (java.lang.Double) max_; 1044 } 1045 return 0D; 1046 } 1047 /** 1048 * 1049 * 1050 * <pre> 1051 * Exclusive upper bound. 1052 * </pre> 1053 * 1054 * <code>double exclusive_maximum = 4;</code> 1055 * 1056 * @param value The exclusiveMaximum to set. 1057 * @return This builder for chaining. 1058 */ setExclusiveMaximum(double value)1059 public Builder setExclusiveMaximum(double value) { 1060 1061 maxCase_ = 4; 1062 max_ = value; 1063 onChanged(); 1064 return this; 1065 } 1066 /** 1067 * 1068 * 1069 * <pre> 1070 * Exclusive upper bound. 1071 * </pre> 1072 * 1073 * <code>double exclusive_maximum = 4;</code> 1074 * 1075 * @return This builder for chaining. 1076 */ clearExclusiveMaximum()1077 public Builder clearExclusiveMaximum() { 1078 if (maxCase_ == 4) { 1079 maxCase_ = 0; 1080 max_ = null; 1081 onChanged(); 1082 } 1083 return this; 1084 } 1085 1086 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1087 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1088 return super.setUnknownFields(unknownFields); 1089 } 1090 1091 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1092 public final Builder mergeUnknownFields( 1093 final com.google.protobuf.UnknownFieldSet unknownFields) { 1094 return super.mergeUnknownFields(unknownFields); 1095 } 1096 1097 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.Interval) 1098 } 1099 1100 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.Interval) 1101 private static final com.google.cloud.retail.v2.Interval DEFAULT_INSTANCE; 1102 1103 static { 1104 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.Interval(); 1105 } 1106 getDefaultInstance()1107 public static com.google.cloud.retail.v2.Interval getDefaultInstance() { 1108 return DEFAULT_INSTANCE; 1109 } 1110 1111 private static final com.google.protobuf.Parser<Interval> PARSER = 1112 new com.google.protobuf.AbstractParser<Interval>() { 1113 @java.lang.Override 1114 public Interval parsePartialFrom( 1115 com.google.protobuf.CodedInputStream input, 1116 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1117 throws com.google.protobuf.InvalidProtocolBufferException { 1118 Builder builder = newBuilder(); 1119 try { 1120 builder.mergeFrom(input, extensionRegistry); 1121 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1122 throw e.setUnfinishedMessage(builder.buildPartial()); 1123 } catch (com.google.protobuf.UninitializedMessageException e) { 1124 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1125 } catch (java.io.IOException e) { 1126 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1127 .setUnfinishedMessage(builder.buildPartial()); 1128 } 1129 return builder.buildPartial(); 1130 } 1131 }; 1132 parser()1133 public static com.google.protobuf.Parser<Interval> parser() { 1134 return PARSER; 1135 } 1136 1137 @java.lang.Override getParserForType()1138 public com.google.protobuf.Parser<Interval> getParserForType() { 1139 return PARSER; 1140 } 1141 1142 @java.lang.Override getDefaultInstanceForType()1143 public com.google.cloud.retail.v2.Interval getDefaultInstanceForType() { 1144 return DEFAULT_INSTANCE; 1145 } 1146 } 1147