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/iot/v1/resources.proto 18 19 package com.google.cloud.iot.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A public key format and data. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.iot.v1.PublicKeyCredential} 29 */ 30 public final class PublicKeyCredential extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.PublicKeyCredential) 33 PublicKeyCredentialOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use PublicKeyCredential.newBuilder() to construct. PublicKeyCredential(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private PublicKeyCredential(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 PublicKeyCredential()40 private PublicKeyCredential() { 41 format_ = 0; 42 key_ = ""; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new PublicKeyCredential(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.iot.v1.ResourcesProto 58 .internal_static_google_cloud_iot_v1_PublicKeyCredential_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.iot.v1.ResourcesProto 65 .internal_static_google_cloud_iot_v1_PublicKeyCredential_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.iot.v1.PublicKeyCredential.class, 68 com.google.cloud.iot.v1.PublicKeyCredential.Builder.class); 69 } 70 71 public static final int FORMAT_FIELD_NUMBER = 1; 72 private int format_ = 0; 73 /** 74 * 75 * 76 * <pre> 77 * The format of the key. 78 * </pre> 79 * 80 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 81 * 82 * @return The enum numeric value on the wire for format. 83 */ 84 @java.lang.Override getFormatValue()85 public int getFormatValue() { 86 return format_; 87 } 88 /** 89 * 90 * 91 * <pre> 92 * The format of the key. 93 * </pre> 94 * 95 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 96 * 97 * @return The format. 98 */ 99 @java.lang.Override getFormat()100 public com.google.cloud.iot.v1.PublicKeyFormat getFormat() { 101 com.google.cloud.iot.v1.PublicKeyFormat result = 102 com.google.cloud.iot.v1.PublicKeyFormat.forNumber(format_); 103 return result == null ? com.google.cloud.iot.v1.PublicKeyFormat.UNRECOGNIZED : result; 104 } 105 106 public static final int KEY_FIELD_NUMBER = 2; 107 108 @SuppressWarnings("serial") 109 private volatile java.lang.Object key_ = ""; 110 /** 111 * 112 * 113 * <pre> 114 * The key data. 115 * </pre> 116 * 117 * <code>string key = 2;</code> 118 * 119 * @return The key. 120 */ 121 @java.lang.Override getKey()122 public java.lang.String getKey() { 123 java.lang.Object ref = key_; 124 if (ref instanceof java.lang.String) { 125 return (java.lang.String) ref; 126 } else { 127 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 128 java.lang.String s = bs.toStringUtf8(); 129 key_ = s; 130 return s; 131 } 132 } 133 /** 134 * 135 * 136 * <pre> 137 * The key data. 138 * </pre> 139 * 140 * <code>string key = 2;</code> 141 * 142 * @return The bytes for key. 143 */ 144 @java.lang.Override getKeyBytes()145 public com.google.protobuf.ByteString getKeyBytes() { 146 java.lang.Object ref = key_; 147 if (ref instanceof java.lang.String) { 148 com.google.protobuf.ByteString b = 149 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 150 key_ = b; 151 return b; 152 } else { 153 return (com.google.protobuf.ByteString) ref; 154 } 155 } 156 157 private byte memoizedIsInitialized = -1; 158 159 @java.lang.Override isInitialized()160 public final boolean isInitialized() { 161 byte isInitialized = memoizedIsInitialized; 162 if (isInitialized == 1) return true; 163 if (isInitialized == 0) return false; 164 165 memoizedIsInitialized = 1; 166 return true; 167 } 168 169 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)170 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 171 if (format_ 172 != com.google.cloud.iot.v1.PublicKeyFormat.UNSPECIFIED_PUBLIC_KEY_FORMAT.getNumber()) { 173 output.writeEnum(1, format_); 174 } 175 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { 176 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); 177 } 178 getUnknownFields().writeTo(output); 179 } 180 181 @java.lang.Override getSerializedSize()182 public int getSerializedSize() { 183 int size = memoizedSize; 184 if (size != -1) return size; 185 186 size = 0; 187 if (format_ 188 != com.google.cloud.iot.v1.PublicKeyFormat.UNSPECIFIED_PUBLIC_KEY_FORMAT.getNumber()) { 189 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, format_); 190 } 191 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { 192 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); 193 } 194 size += getUnknownFields().getSerializedSize(); 195 memoizedSize = size; 196 return size; 197 } 198 199 @java.lang.Override equals(final java.lang.Object obj)200 public boolean equals(final java.lang.Object obj) { 201 if (obj == this) { 202 return true; 203 } 204 if (!(obj instanceof com.google.cloud.iot.v1.PublicKeyCredential)) { 205 return super.equals(obj); 206 } 207 com.google.cloud.iot.v1.PublicKeyCredential other = 208 (com.google.cloud.iot.v1.PublicKeyCredential) obj; 209 210 if (format_ != other.format_) return false; 211 if (!getKey().equals(other.getKey())) return false; 212 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 213 return true; 214 } 215 216 @java.lang.Override hashCode()217 public int hashCode() { 218 if (memoizedHashCode != 0) { 219 return memoizedHashCode; 220 } 221 int hash = 41; 222 hash = (19 * hash) + getDescriptor().hashCode(); 223 hash = (37 * hash) + FORMAT_FIELD_NUMBER; 224 hash = (53 * hash) + format_; 225 hash = (37 * hash) + KEY_FIELD_NUMBER; 226 hash = (53 * hash) + getKey().hashCode(); 227 hash = (29 * hash) + getUnknownFields().hashCode(); 228 memoizedHashCode = hash; 229 return hash; 230 } 231 parseFrom(java.nio.ByteBuffer data)232 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom(java.nio.ByteBuffer data) 233 throws com.google.protobuf.InvalidProtocolBufferException { 234 return PARSER.parseFrom(data); 235 } 236 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)237 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 238 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 239 throws com.google.protobuf.InvalidProtocolBufferException { 240 return PARSER.parseFrom(data, extensionRegistry); 241 } 242 parseFrom( com.google.protobuf.ByteString data)243 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 244 com.google.protobuf.ByteString data) 245 throws com.google.protobuf.InvalidProtocolBufferException { 246 return PARSER.parseFrom(data); 247 } 248 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)249 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 250 com.google.protobuf.ByteString data, 251 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 252 throws com.google.protobuf.InvalidProtocolBufferException { 253 return PARSER.parseFrom(data, extensionRegistry); 254 } 255 parseFrom(byte[] data)256 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom(byte[] data) 257 throws com.google.protobuf.InvalidProtocolBufferException { 258 return PARSER.parseFrom(data); 259 } 260 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)261 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 262 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 263 throws com.google.protobuf.InvalidProtocolBufferException { 264 return PARSER.parseFrom(data, extensionRegistry); 265 } 266 parseFrom(java.io.InputStream input)267 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom(java.io.InputStream input) 268 throws java.io.IOException { 269 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 270 } 271 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)272 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 273 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 274 throws java.io.IOException { 275 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 276 PARSER, input, extensionRegistry); 277 } 278 parseDelimitedFrom( java.io.InputStream input)279 public static com.google.cloud.iot.v1.PublicKeyCredential parseDelimitedFrom( 280 java.io.InputStream input) throws java.io.IOException { 281 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 282 } 283 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)284 public static com.google.cloud.iot.v1.PublicKeyCredential parseDelimitedFrom( 285 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 286 throws java.io.IOException { 287 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 288 PARSER, input, extensionRegistry); 289 } 290 parseFrom( com.google.protobuf.CodedInputStream input)291 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 292 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 293 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 294 } 295 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)296 public static com.google.cloud.iot.v1.PublicKeyCredential parseFrom( 297 com.google.protobuf.CodedInputStream input, 298 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 299 throws java.io.IOException { 300 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 301 PARSER, input, extensionRegistry); 302 } 303 304 @java.lang.Override newBuilderForType()305 public Builder newBuilderForType() { 306 return newBuilder(); 307 } 308 newBuilder()309 public static Builder newBuilder() { 310 return DEFAULT_INSTANCE.toBuilder(); 311 } 312 newBuilder(com.google.cloud.iot.v1.PublicKeyCredential prototype)313 public static Builder newBuilder(com.google.cloud.iot.v1.PublicKeyCredential prototype) { 314 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 315 } 316 317 @java.lang.Override toBuilder()318 public Builder toBuilder() { 319 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 320 } 321 322 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)323 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 324 Builder builder = new Builder(parent); 325 return builder; 326 } 327 /** 328 * 329 * 330 * <pre> 331 * A public key format and data. 332 * </pre> 333 * 334 * Protobuf type {@code google.cloud.iot.v1.PublicKeyCredential} 335 */ 336 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 337 implements 338 // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.PublicKeyCredential) 339 com.google.cloud.iot.v1.PublicKeyCredentialOrBuilder { getDescriptor()340 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 341 return com.google.cloud.iot.v1.ResourcesProto 342 .internal_static_google_cloud_iot_v1_PublicKeyCredential_descriptor; 343 } 344 345 @java.lang.Override 346 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()347 internalGetFieldAccessorTable() { 348 return com.google.cloud.iot.v1.ResourcesProto 349 .internal_static_google_cloud_iot_v1_PublicKeyCredential_fieldAccessorTable 350 .ensureFieldAccessorsInitialized( 351 com.google.cloud.iot.v1.PublicKeyCredential.class, 352 com.google.cloud.iot.v1.PublicKeyCredential.Builder.class); 353 } 354 355 // Construct using com.google.cloud.iot.v1.PublicKeyCredential.newBuilder() Builder()356 private Builder() {} 357 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)358 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 359 super(parent); 360 } 361 362 @java.lang.Override clear()363 public Builder clear() { 364 super.clear(); 365 bitField0_ = 0; 366 format_ = 0; 367 key_ = ""; 368 return this; 369 } 370 371 @java.lang.Override getDescriptorForType()372 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 373 return com.google.cloud.iot.v1.ResourcesProto 374 .internal_static_google_cloud_iot_v1_PublicKeyCredential_descriptor; 375 } 376 377 @java.lang.Override getDefaultInstanceForType()378 public com.google.cloud.iot.v1.PublicKeyCredential getDefaultInstanceForType() { 379 return com.google.cloud.iot.v1.PublicKeyCredential.getDefaultInstance(); 380 } 381 382 @java.lang.Override build()383 public com.google.cloud.iot.v1.PublicKeyCredential build() { 384 com.google.cloud.iot.v1.PublicKeyCredential result = buildPartial(); 385 if (!result.isInitialized()) { 386 throw newUninitializedMessageException(result); 387 } 388 return result; 389 } 390 391 @java.lang.Override buildPartial()392 public com.google.cloud.iot.v1.PublicKeyCredential buildPartial() { 393 com.google.cloud.iot.v1.PublicKeyCredential result = 394 new com.google.cloud.iot.v1.PublicKeyCredential(this); 395 if (bitField0_ != 0) { 396 buildPartial0(result); 397 } 398 onBuilt(); 399 return result; 400 } 401 buildPartial0(com.google.cloud.iot.v1.PublicKeyCredential result)402 private void buildPartial0(com.google.cloud.iot.v1.PublicKeyCredential result) { 403 int from_bitField0_ = bitField0_; 404 if (((from_bitField0_ & 0x00000001) != 0)) { 405 result.format_ = format_; 406 } 407 if (((from_bitField0_ & 0x00000002) != 0)) { 408 result.key_ = key_; 409 } 410 } 411 412 @java.lang.Override clone()413 public Builder clone() { 414 return super.clone(); 415 } 416 417 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)418 public Builder setField( 419 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 420 return super.setField(field, value); 421 } 422 423 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)424 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 425 return super.clearField(field); 426 } 427 428 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)429 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 430 return super.clearOneof(oneof); 431 } 432 433 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)434 public Builder setRepeatedField( 435 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 436 return super.setRepeatedField(field, index, value); 437 } 438 439 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)440 public Builder addRepeatedField( 441 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 442 return super.addRepeatedField(field, value); 443 } 444 445 @java.lang.Override mergeFrom(com.google.protobuf.Message other)446 public Builder mergeFrom(com.google.protobuf.Message other) { 447 if (other instanceof com.google.cloud.iot.v1.PublicKeyCredential) { 448 return mergeFrom((com.google.cloud.iot.v1.PublicKeyCredential) other); 449 } else { 450 super.mergeFrom(other); 451 return this; 452 } 453 } 454 mergeFrom(com.google.cloud.iot.v1.PublicKeyCredential other)455 public Builder mergeFrom(com.google.cloud.iot.v1.PublicKeyCredential other) { 456 if (other == com.google.cloud.iot.v1.PublicKeyCredential.getDefaultInstance()) return this; 457 if (other.format_ != 0) { 458 setFormatValue(other.getFormatValue()); 459 } 460 if (!other.getKey().isEmpty()) { 461 key_ = other.key_; 462 bitField0_ |= 0x00000002; 463 onChanged(); 464 } 465 this.mergeUnknownFields(other.getUnknownFields()); 466 onChanged(); 467 return this; 468 } 469 470 @java.lang.Override isInitialized()471 public final boolean isInitialized() { 472 return true; 473 } 474 475 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)476 public Builder mergeFrom( 477 com.google.protobuf.CodedInputStream input, 478 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 479 throws java.io.IOException { 480 if (extensionRegistry == null) { 481 throw new java.lang.NullPointerException(); 482 } 483 try { 484 boolean done = false; 485 while (!done) { 486 int tag = input.readTag(); 487 switch (tag) { 488 case 0: 489 done = true; 490 break; 491 case 8: 492 { 493 format_ = input.readEnum(); 494 bitField0_ |= 0x00000001; 495 break; 496 } // case 8 497 case 18: 498 { 499 key_ = input.readStringRequireUtf8(); 500 bitField0_ |= 0x00000002; 501 break; 502 } // case 18 503 default: 504 { 505 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 506 done = true; // was an endgroup tag 507 } 508 break; 509 } // default: 510 } // switch (tag) 511 } // while (!done) 512 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 513 throw e.unwrapIOException(); 514 } finally { 515 onChanged(); 516 } // finally 517 return this; 518 } 519 520 private int bitField0_; 521 522 private int format_ = 0; 523 /** 524 * 525 * 526 * <pre> 527 * The format of the key. 528 * </pre> 529 * 530 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 531 * 532 * @return The enum numeric value on the wire for format. 533 */ 534 @java.lang.Override getFormatValue()535 public int getFormatValue() { 536 return format_; 537 } 538 /** 539 * 540 * 541 * <pre> 542 * The format of the key. 543 * </pre> 544 * 545 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 546 * 547 * @param value The enum numeric value on the wire for format to set. 548 * @return This builder for chaining. 549 */ setFormatValue(int value)550 public Builder setFormatValue(int value) { 551 format_ = value; 552 bitField0_ |= 0x00000001; 553 onChanged(); 554 return this; 555 } 556 /** 557 * 558 * 559 * <pre> 560 * The format of the key. 561 * </pre> 562 * 563 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 564 * 565 * @return The format. 566 */ 567 @java.lang.Override getFormat()568 public com.google.cloud.iot.v1.PublicKeyFormat getFormat() { 569 com.google.cloud.iot.v1.PublicKeyFormat result = 570 com.google.cloud.iot.v1.PublicKeyFormat.forNumber(format_); 571 return result == null ? com.google.cloud.iot.v1.PublicKeyFormat.UNRECOGNIZED : result; 572 } 573 /** 574 * 575 * 576 * <pre> 577 * The format of the key. 578 * </pre> 579 * 580 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 581 * 582 * @param value The format to set. 583 * @return This builder for chaining. 584 */ setFormat(com.google.cloud.iot.v1.PublicKeyFormat value)585 public Builder setFormat(com.google.cloud.iot.v1.PublicKeyFormat value) { 586 if (value == null) { 587 throw new NullPointerException(); 588 } 589 bitField0_ |= 0x00000001; 590 format_ = value.getNumber(); 591 onChanged(); 592 return this; 593 } 594 /** 595 * 596 * 597 * <pre> 598 * The format of the key. 599 * </pre> 600 * 601 * <code>.google.cloud.iot.v1.PublicKeyFormat format = 1;</code> 602 * 603 * @return This builder for chaining. 604 */ clearFormat()605 public Builder clearFormat() { 606 bitField0_ = (bitField0_ & ~0x00000001); 607 format_ = 0; 608 onChanged(); 609 return this; 610 } 611 612 private java.lang.Object key_ = ""; 613 /** 614 * 615 * 616 * <pre> 617 * The key data. 618 * </pre> 619 * 620 * <code>string key = 2;</code> 621 * 622 * @return The key. 623 */ getKey()624 public java.lang.String getKey() { 625 java.lang.Object ref = key_; 626 if (!(ref instanceof java.lang.String)) { 627 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 628 java.lang.String s = bs.toStringUtf8(); 629 key_ = s; 630 return s; 631 } else { 632 return (java.lang.String) ref; 633 } 634 } 635 /** 636 * 637 * 638 * <pre> 639 * The key data. 640 * </pre> 641 * 642 * <code>string key = 2;</code> 643 * 644 * @return The bytes for key. 645 */ getKeyBytes()646 public com.google.protobuf.ByteString getKeyBytes() { 647 java.lang.Object ref = key_; 648 if (ref instanceof String) { 649 com.google.protobuf.ByteString b = 650 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 651 key_ = b; 652 return b; 653 } else { 654 return (com.google.protobuf.ByteString) ref; 655 } 656 } 657 /** 658 * 659 * 660 * <pre> 661 * The key data. 662 * </pre> 663 * 664 * <code>string key = 2;</code> 665 * 666 * @param value The key to set. 667 * @return This builder for chaining. 668 */ setKey(java.lang.String value)669 public Builder setKey(java.lang.String value) { 670 if (value == null) { 671 throw new NullPointerException(); 672 } 673 key_ = value; 674 bitField0_ |= 0x00000002; 675 onChanged(); 676 return this; 677 } 678 /** 679 * 680 * 681 * <pre> 682 * The key data. 683 * </pre> 684 * 685 * <code>string key = 2;</code> 686 * 687 * @return This builder for chaining. 688 */ clearKey()689 public Builder clearKey() { 690 key_ = getDefaultInstance().getKey(); 691 bitField0_ = (bitField0_ & ~0x00000002); 692 onChanged(); 693 return this; 694 } 695 /** 696 * 697 * 698 * <pre> 699 * The key data. 700 * </pre> 701 * 702 * <code>string key = 2;</code> 703 * 704 * @param value The bytes for key to set. 705 * @return This builder for chaining. 706 */ setKeyBytes(com.google.protobuf.ByteString value)707 public Builder setKeyBytes(com.google.protobuf.ByteString value) { 708 if (value == null) { 709 throw new NullPointerException(); 710 } 711 checkByteStringIsUtf8(value); 712 key_ = value; 713 bitField0_ |= 0x00000002; 714 onChanged(); 715 return this; 716 } 717 718 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)719 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 720 return super.setUnknownFields(unknownFields); 721 } 722 723 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)724 public final Builder mergeUnknownFields( 725 final com.google.protobuf.UnknownFieldSet unknownFields) { 726 return super.mergeUnknownFields(unknownFields); 727 } 728 729 // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.PublicKeyCredential) 730 } 731 732 // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.PublicKeyCredential) 733 private static final com.google.cloud.iot.v1.PublicKeyCredential DEFAULT_INSTANCE; 734 735 static { 736 DEFAULT_INSTANCE = new com.google.cloud.iot.v1.PublicKeyCredential(); 737 } 738 getDefaultInstance()739 public static com.google.cloud.iot.v1.PublicKeyCredential getDefaultInstance() { 740 return DEFAULT_INSTANCE; 741 } 742 743 private static final com.google.protobuf.Parser<PublicKeyCredential> PARSER = 744 new com.google.protobuf.AbstractParser<PublicKeyCredential>() { 745 @java.lang.Override 746 public PublicKeyCredential parsePartialFrom( 747 com.google.protobuf.CodedInputStream input, 748 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 749 throws com.google.protobuf.InvalidProtocolBufferException { 750 Builder builder = newBuilder(); 751 try { 752 builder.mergeFrom(input, extensionRegistry); 753 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 754 throw e.setUnfinishedMessage(builder.buildPartial()); 755 } catch (com.google.protobuf.UninitializedMessageException e) { 756 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 757 } catch (java.io.IOException e) { 758 throw new com.google.protobuf.InvalidProtocolBufferException(e) 759 .setUnfinishedMessage(builder.buildPartial()); 760 } 761 return builder.buildPartial(); 762 } 763 }; 764 parser()765 public static com.google.protobuf.Parser<PublicKeyCredential> parser() { 766 return PARSER; 767 } 768 769 @java.lang.Override getParserForType()770 public com.google.protobuf.Parser<PublicKeyCredential> getParserForType() { 771 return PARSER; 772 } 773 774 @java.lang.Override getDefaultInstanceForType()775 public com.google.cloud.iot.v1.PublicKeyCredential getDefaultInstanceForType() { 776 return DEFAULT_INSTANCE; 777 } 778 } 779