1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: grpc/channelz/v1/channelz.proto 3 4 package io.grpc.channelz.v1; 5 6 /** 7 * <pre> 8 * ChannelRef is a reference to a Subchannel. 9 * </pre> 10 * 11 * Protobuf type {@code grpc.channelz.v1.SubchannelRef} 12 */ 13 public final class SubchannelRef extends 14 com.google.protobuf.GeneratedMessageV3 implements 15 // @@protoc_insertion_point(message_implements:grpc.channelz.v1.SubchannelRef) 16 SubchannelRefOrBuilder { 17 private static final long serialVersionUID = 0L; 18 // Use SubchannelRef.newBuilder() to construct. 19 private SubchannelRef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 20 super(builder); 21 } 22 private SubchannelRef() { 23 subchannelId_ = 0L; 24 name_ = ""; 25 } 26 27 @java.lang.Override 28 public final com.google.protobuf.UnknownFieldSet 29 getUnknownFields() { 30 return this.unknownFields; 31 } 32 private SubchannelRef( 33 com.google.protobuf.CodedInputStream input, 34 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 35 throws com.google.protobuf.InvalidProtocolBufferException { 36 this(); 37 if (extensionRegistry == null) { 38 throw new java.lang.NullPointerException(); 39 } 40 int mutable_bitField0_ = 0; 41 com.google.protobuf.UnknownFieldSet.Builder unknownFields = 42 com.google.protobuf.UnknownFieldSet.newBuilder(); 43 try { 44 boolean done = false; 45 while (!done) { 46 int tag = input.readTag(); 47 switch (tag) { 48 case 0: 49 done = true; 50 break; 51 default: { 52 if (!parseUnknownFieldProto3( 53 input, unknownFields, extensionRegistry, tag)) { 54 done = true; 55 } 56 break; 57 } 58 case 56: { 59 60 subchannelId_ = input.readInt64(); 61 break; 62 } 63 case 66: { 64 java.lang.String s = input.readStringRequireUtf8(); 65 66 name_ = s; 67 break; 68 } 69 } 70 } 71 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 72 throw e.setUnfinishedMessage(this); 73 } catch (java.io.IOException e) { 74 throw new com.google.protobuf.InvalidProtocolBufferException( 75 e).setUnfinishedMessage(this); 76 } finally { 77 this.unknownFields = unknownFields.build(); 78 makeExtensionsImmutable(); 79 } 80 } 81 public static final com.google.protobuf.Descriptors.Descriptor 82 getDescriptor() { 83 return io.grpc.channelz.v1.ChannelzProto.internal_static_grpc_channelz_v1_SubchannelRef_descriptor; 84 } 85 86 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 87 internalGetFieldAccessorTable() { 88 return io.grpc.channelz.v1.ChannelzProto.internal_static_grpc_channelz_v1_SubchannelRef_fieldAccessorTable 89 .ensureFieldAccessorsInitialized( 90 io.grpc.channelz.v1.SubchannelRef.class, io.grpc.channelz.v1.SubchannelRef.Builder.class); 91 } 92 93 public static final int SUBCHANNEL_ID_FIELD_NUMBER = 7; 94 private long subchannelId_; 95 /** 96 * <pre> 97 * The globally unique id for this subchannel. Must be a positive number. 98 * </pre> 99 * 100 * <code>int64 subchannel_id = 7;</code> 101 */ 102 public long getSubchannelId() { 103 return subchannelId_; 104 } 105 106 public static final int NAME_FIELD_NUMBER = 8; 107 private volatile java.lang.Object name_; 108 /** 109 * <pre> 110 * An optional name associated with the subchannel. 111 * </pre> 112 * 113 * <code>string name = 8;</code> 114 */ 115 public java.lang.String getName() { 116 java.lang.Object ref = name_; 117 if (ref instanceof java.lang.String) { 118 return (java.lang.String) ref; 119 } else { 120 com.google.protobuf.ByteString bs = 121 (com.google.protobuf.ByteString) ref; 122 java.lang.String s = bs.toStringUtf8(); 123 name_ = s; 124 return s; 125 } 126 } 127 /** 128 * <pre> 129 * An optional name associated with the subchannel. 130 * </pre> 131 * 132 * <code>string name = 8;</code> 133 */ 134 public com.google.protobuf.ByteString 135 getNameBytes() { 136 java.lang.Object ref = name_; 137 if (ref instanceof java.lang.String) { 138 com.google.protobuf.ByteString b = 139 com.google.protobuf.ByteString.copyFromUtf8( 140 (java.lang.String) ref); 141 name_ = b; 142 return b; 143 } else { 144 return (com.google.protobuf.ByteString) ref; 145 } 146 } 147 148 private byte memoizedIsInitialized = -1; 149 public final boolean isInitialized() { 150 byte isInitialized = memoizedIsInitialized; 151 if (isInitialized == 1) return true; 152 if (isInitialized == 0) return false; 153 154 memoizedIsInitialized = 1; 155 return true; 156 } 157 158 public void writeTo(com.google.protobuf.CodedOutputStream output) 159 throws java.io.IOException { 160 if (subchannelId_ != 0L) { 161 output.writeInt64(7, subchannelId_); 162 } 163 if (!getNameBytes().isEmpty()) { 164 com.google.protobuf.GeneratedMessageV3.writeString(output, 8, name_); 165 } 166 unknownFields.writeTo(output); 167 } 168 169 public int getSerializedSize() { 170 int size = memoizedSize; 171 if (size != -1) return size; 172 173 size = 0; 174 if (subchannelId_ != 0L) { 175 size += com.google.protobuf.CodedOutputStream 176 .computeInt64Size(7, subchannelId_); 177 } 178 if (!getNameBytes().isEmpty()) { 179 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, name_); 180 } 181 size += unknownFields.getSerializedSize(); 182 memoizedSize = size; 183 return size; 184 } 185 186 @java.lang.Override 187 public boolean equals(final java.lang.Object obj) { 188 if (obj == this) { 189 return true; 190 } 191 if (!(obj instanceof io.grpc.channelz.v1.SubchannelRef)) { 192 return super.equals(obj); 193 } 194 io.grpc.channelz.v1.SubchannelRef other = (io.grpc.channelz.v1.SubchannelRef) obj; 195 196 boolean result = true; 197 result = result && (getSubchannelId() 198 == other.getSubchannelId()); 199 result = result && getName() 200 .equals(other.getName()); 201 result = result && unknownFields.equals(other.unknownFields); 202 return result; 203 } 204 205 @java.lang.Override 206 public int hashCode() { 207 if (memoizedHashCode != 0) { 208 return memoizedHashCode; 209 } 210 int hash = 41; 211 hash = (19 * hash) + getDescriptor().hashCode(); 212 hash = (37 * hash) + SUBCHANNEL_ID_FIELD_NUMBER; 213 hash = (53 * hash) + com.google.protobuf.Internal.hashLong( 214 getSubchannelId()); 215 hash = (37 * hash) + NAME_FIELD_NUMBER; 216 hash = (53 * hash) + getName().hashCode(); 217 hash = (29 * hash) + unknownFields.hashCode(); 218 memoizedHashCode = hash; 219 return hash; 220 } 221 222 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 223 java.nio.ByteBuffer data) 224 throws com.google.protobuf.InvalidProtocolBufferException { 225 return PARSER.parseFrom(data); 226 } 227 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 228 java.nio.ByteBuffer data, 229 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 230 throws com.google.protobuf.InvalidProtocolBufferException { 231 return PARSER.parseFrom(data, extensionRegistry); 232 } 233 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 234 com.google.protobuf.ByteString data) 235 throws com.google.protobuf.InvalidProtocolBufferException { 236 return PARSER.parseFrom(data); 237 } 238 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 239 com.google.protobuf.ByteString data, 240 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 241 throws com.google.protobuf.InvalidProtocolBufferException { 242 return PARSER.parseFrom(data, extensionRegistry); 243 } 244 public static io.grpc.channelz.v1.SubchannelRef parseFrom(byte[] data) 245 throws com.google.protobuf.InvalidProtocolBufferException { 246 return PARSER.parseFrom(data); 247 } 248 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 249 byte[] data, 250 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 251 throws com.google.protobuf.InvalidProtocolBufferException { 252 return PARSER.parseFrom(data, extensionRegistry); 253 } 254 public static io.grpc.channelz.v1.SubchannelRef parseFrom(java.io.InputStream input) 255 throws java.io.IOException { 256 return com.google.protobuf.GeneratedMessageV3 257 .parseWithIOException(PARSER, input); 258 } 259 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 260 java.io.InputStream input, 261 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 262 throws java.io.IOException { 263 return com.google.protobuf.GeneratedMessageV3 264 .parseWithIOException(PARSER, input, extensionRegistry); 265 } 266 public static io.grpc.channelz.v1.SubchannelRef parseDelimitedFrom(java.io.InputStream input) 267 throws java.io.IOException { 268 return com.google.protobuf.GeneratedMessageV3 269 .parseDelimitedWithIOException(PARSER, input); 270 } 271 public static io.grpc.channelz.v1.SubchannelRef parseDelimitedFrom( 272 java.io.InputStream input, 273 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 274 throws java.io.IOException { 275 return com.google.protobuf.GeneratedMessageV3 276 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); 277 } 278 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 279 com.google.protobuf.CodedInputStream input) 280 throws java.io.IOException { 281 return com.google.protobuf.GeneratedMessageV3 282 .parseWithIOException(PARSER, input); 283 } 284 public static io.grpc.channelz.v1.SubchannelRef parseFrom( 285 com.google.protobuf.CodedInputStream input, 286 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 287 throws java.io.IOException { 288 return com.google.protobuf.GeneratedMessageV3 289 .parseWithIOException(PARSER, input, extensionRegistry); 290 } 291 292 public Builder newBuilderForType() { return newBuilder(); } 293 public static Builder newBuilder() { 294 return DEFAULT_INSTANCE.toBuilder(); 295 } 296 public static Builder newBuilder(io.grpc.channelz.v1.SubchannelRef prototype) { 297 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 298 } 299 public Builder toBuilder() { 300 return this == DEFAULT_INSTANCE 301 ? new Builder() : new Builder().mergeFrom(this); 302 } 303 304 @java.lang.Override 305 protected Builder newBuilderForType( 306 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 307 Builder builder = new Builder(parent); 308 return builder; 309 } 310 /** 311 * <pre> 312 * ChannelRef is a reference to a Subchannel. 313 * </pre> 314 * 315 * Protobuf type {@code grpc.channelz.v1.SubchannelRef} 316 */ 317 public static final class Builder extends 318 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements 319 // @@protoc_insertion_point(builder_implements:grpc.channelz.v1.SubchannelRef) 320 io.grpc.channelz.v1.SubchannelRefOrBuilder { 321 public static final com.google.protobuf.Descriptors.Descriptor 322 getDescriptor() { 323 return io.grpc.channelz.v1.ChannelzProto.internal_static_grpc_channelz_v1_SubchannelRef_descriptor; 324 } 325 326 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 327 internalGetFieldAccessorTable() { 328 return io.grpc.channelz.v1.ChannelzProto.internal_static_grpc_channelz_v1_SubchannelRef_fieldAccessorTable 329 .ensureFieldAccessorsInitialized( 330 io.grpc.channelz.v1.SubchannelRef.class, io.grpc.channelz.v1.SubchannelRef.Builder.class); 331 } 332 333 // Construct using io.grpc.channelz.v1.SubchannelRef.newBuilder() 334 private Builder() { 335 maybeForceBuilderInitialization(); 336 } 337 338 private Builder( 339 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 340 super(parent); 341 maybeForceBuilderInitialization(); 342 } 343 private void maybeForceBuilderInitialization() { 344 if (com.google.protobuf.GeneratedMessageV3 345 .alwaysUseFieldBuilders) { 346 } 347 } 348 public Builder clear() { 349 super.clear(); 350 subchannelId_ = 0L; 351 352 name_ = ""; 353 354 return this; 355 } 356 357 public com.google.protobuf.Descriptors.Descriptor 358 getDescriptorForType() { 359 return io.grpc.channelz.v1.ChannelzProto.internal_static_grpc_channelz_v1_SubchannelRef_descriptor; 360 } 361 362 public io.grpc.channelz.v1.SubchannelRef getDefaultInstanceForType() { 363 return io.grpc.channelz.v1.SubchannelRef.getDefaultInstance(); 364 } 365 366 public io.grpc.channelz.v1.SubchannelRef build() { 367 io.grpc.channelz.v1.SubchannelRef result = buildPartial(); 368 if (!result.isInitialized()) { 369 throw newUninitializedMessageException(result); 370 } 371 return result; 372 } 373 374 public io.grpc.channelz.v1.SubchannelRef buildPartial() { 375 io.grpc.channelz.v1.SubchannelRef result = new io.grpc.channelz.v1.SubchannelRef(this); 376 result.subchannelId_ = subchannelId_; 377 result.name_ = name_; 378 onBuilt(); 379 return result; 380 } 381 382 public Builder clone() { 383 return (Builder) super.clone(); 384 } 385 public Builder setField( 386 com.google.protobuf.Descriptors.FieldDescriptor field, 387 java.lang.Object value) { 388 return (Builder) super.setField(field, value); 389 } 390 public Builder clearField( 391 com.google.protobuf.Descriptors.FieldDescriptor field) { 392 return (Builder) super.clearField(field); 393 } 394 public Builder clearOneof( 395 com.google.protobuf.Descriptors.OneofDescriptor oneof) { 396 return (Builder) super.clearOneof(oneof); 397 } 398 public Builder setRepeatedField( 399 com.google.protobuf.Descriptors.FieldDescriptor field, 400 int index, java.lang.Object value) { 401 return (Builder) super.setRepeatedField(field, index, value); 402 } 403 public Builder addRepeatedField( 404 com.google.protobuf.Descriptors.FieldDescriptor field, 405 java.lang.Object value) { 406 return (Builder) super.addRepeatedField(field, value); 407 } 408 public Builder mergeFrom(com.google.protobuf.Message other) { 409 if (other instanceof io.grpc.channelz.v1.SubchannelRef) { 410 return mergeFrom((io.grpc.channelz.v1.SubchannelRef)other); 411 } else { 412 super.mergeFrom(other); 413 return this; 414 } 415 } 416 417 public Builder mergeFrom(io.grpc.channelz.v1.SubchannelRef other) { 418 if (other == io.grpc.channelz.v1.SubchannelRef.getDefaultInstance()) return this; 419 if (other.getSubchannelId() != 0L) { 420 setSubchannelId(other.getSubchannelId()); 421 } 422 if (!other.getName().isEmpty()) { 423 name_ = other.name_; 424 onChanged(); 425 } 426 this.mergeUnknownFields(other.unknownFields); 427 onChanged(); 428 return this; 429 } 430 431 public final boolean isInitialized() { 432 return true; 433 } 434 435 public Builder mergeFrom( 436 com.google.protobuf.CodedInputStream input, 437 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 438 throws java.io.IOException { 439 io.grpc.channelz.v1.SubchannelRef parsedMessage = null; 440 try { 441 parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); 442 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 443 parsedMessage = (io.grpc.channelz.v1.SubchannelRef) e.getUnfinishedMessage(); 444 throw e.unwrapIOException(); 445 } finally { 446 if (parsedMessage != null) { 447 mergeFrom(parsedMessage); 448 } 449 } 450 return this; 451 } 452 453 private long subchannelId_ ; 454 /** 455 * <pre> 456 * The globally unique id for this subchannel. Must be a positive number. 457 * </pre> 458 * 459 * <code>int64 subchannel_id = 7;</code> 460 */ 461 public long getSubchannelId() { 462 return subchannelId_; 463 } 464 /** 465 * <pre> 466 * The globally unique id for this subchannel. Must be a positive number. 467 * </pre> 468 * 469 * <code>int64 subchannel_id = 7;</code> 470 */ 471 public Builder setSubchannelId(long value) { 472 473 subchannelId_ = value; 474 onChanged(); 475 return this; 476 } 477 /** 478 * <pre> 479 * The globally unique id for this subchannel. Must be a positive number. 480 * </pre> 481 * 482 * <code>int64 subchannel_id = 7;</code> 483 */ 484 public Builder clearSubchannelId() { 485 486 subchannelId_ = 0L; 487 onChanged(); 488 return this; 489 } 490 491 private java.lang.Object name_ = ""; 492 /** 493 * <pre> 494 * An optional name associated with the subchannel. 495 * </pre> 496 * 497 * <code>string name = 8;</code> 498 */ 499 public java.lang.String getName() { 500 java.lang.Object ref = name_; 501 if (!(ref instanceof java.lang.String)) { 502 com.google.protobuf.ByteString bs = 503 (com.google.protobuf.ByteString) ref; 504 java.lang.String s = bs.toStringUtf8(); 505 name_ = s; 506 return s; 507 } else { 508 return (java.lang.String) ref; 509 } 510 } 511 /** 512 * <pre> 513 * An optional name associated with the subchannel. 514 * </pre> 515 * 516 * <code>string name = 8;</code> 517 */ 518 public com.google.protobuf.ByteString 519 getNameBytes() { 520 java.lang.Object ref = name_; 521 if (ref instanceof String) { 522 com.google.protobuf.ByteString b = 523 com.google.protobuf.ByteString.copyFromUtf8( 524 (java.lang.String) ref); 525 name_ = b; 526 return b; 527 } else { 528 return (com.google.protobuf.ByteString) ref; 529 } 530 } 531 /** 532 * <pre> 533 * An optional name associated with the subchannel. 534 * </pre> 535 * 536 * <code>string name = 8;</code> 537 */ 538 public Builder setName( 539 java.lang.String value) { 540 if (value == null) { 541 throw new NullPointerException(); 542 } 543 544 name_ = value; 545 onChanged(); 546 return this; 547 } 548 /** 549 * <pre> 550 * An optional name associated with the subchannel. 551 * </pre> 552 * 553 * <code>string name = 8;</code> 554 */ 555 public Builder clearName() { 556 557 name_ = getDefaultInstance().getName(); 558 onChanged(); 559 return this; 560 } 561 /** 562 * <pre> 563 * An optional name associated with the subchannel. 564 * </pre> 565 * 566 * <code>string name = 8;</code> 567 */ 568 public Builder setNameBytes( 569 com.google.protobuf.ByteString value) { 570 if (value == null) { 571 throw new NullPointerException(); 572 } 573 checkByteStringIsUtf8(value); 574 575 name_ = value; 576 onChanged(); 577 return this; 578 } 579 public final Builder setUnknownFields( 580 final com.google.protobuf.UnknownFieldSet unknownFields) { 581 return super.setUnknownFieldsProto3(unknownFields); 582 } 583 584 public final Builder mergeUnknownFields( 585 final com.google.protobuf.UnknownFieldSet unknownFields) { 586 return super.mergeUnknownFields(unknownFields); 587 } 588 589 590 // @@protoc_insertion_point(builder_scope:grpc.channelz.v1.SubchannelRef) 591 } 592 593 // @@protoc_insertion_point(class_scope:grpc.channelz.v1.SubchannelRef) 594 private static final io.grpc.channelz.v1.SubchannelRef DEFAULT_INSTANCE; 595 static { 596 DEFAULT_INSTANCE = new io.grpc.channelz.v1.SubchannelRef(); 597 } 598 599 public static io.grpc.channelz.v1.SubchannelRef getDefaultInstance() { 600 return DEFAULT_INSTANCE; 601 } 602 603 private static final com.google.protobuf.Parser<SubchannelRef> 604 PARSER = new com.google.protobuf.AbstractParser<SubchannelRef>() { 605 public SubchannelRef parsePartialFrom( 606 com.google.protobuf.CodedInputStream input, 607 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 608 throws com.google.protobuf.InvalidProtocolBufferException { 609 return new SubchannelRef(input, extensionRegistry); 610 } 611 }; 612 613 public static com.google.protobuf.Parser<SubchannelRef> parser() { 614 return PARSER; 615 } 616 617 @java.lang.Override 618 public com.google.protobuf.Parser<SubchannelRef> getParserForType() { 619 return PARSER; 620 } 621 622 public io.grpc.channelz.v1.SubchannelRef getDefaultInstanceForType() { 623 return DEFAULT_INSTANCE; 624 } 625 626 } 627 628