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/devtools/source/v1/source_context.proto 18 19 package com.google.devtools.source.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * An alias to a repo revision. 26 * </pre> 27 * 28 * Protobuf type {@code google.devtools.source.v1.AliasContext} 29 */ 30 public final class AliasContext extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.devtools.source.v1.AliasContext) 33 AliasContextOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use AliasContext.newBuilder() to construct. AliasContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private AliasContext(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 AliasContext()40 private AliasContext() { 41 kind_ = 0; 42 name_ = ""; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new AliasContext(); 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.devtools.source.v1.SourceContextProto 58 .internal_static_google_devtools_source_v1_AliasContext_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.devtools.source.v1.SourceContextProto 65 .internal_static_google_devtools_source_v1_AliasContext_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.devtools.source.v1.AliasContext.class, 68 com.google.devtools.source.v1.AliasContext.Builder.class); 69 } 70 71 /** 72 * 73 * 74 * <pre> 75 * The type of an Alias. 76 * </pre> 77 * 78 * Protobuf enum {@code google.devtools.source.v1.AliasContext.Kind} 79 */ 80 public enum Kind implements com.google.protobuf.ProtocolMessageEnum { 81 /** 82 * 83 * 84 * <pre> 85 * Do not use. 86 * </pre> 87 * 88 * <code>ANY = 0;</code> 89 */ 90 ANY(0), 91 /** 92 * 93 * 94 * <pre> 95 * Git tag 96 * </pre> 97 * 98 * <code>FIXED = 1;</code> 99 */ 100 FIXED(1), 101 /** 102 * 103 * 104 * <pre> 105 * Git branch 106 * </pre> 107 * 108 * <code>MOVABLE = 2;</code> 109 */ 110 MOVABLE(2), 111 /** 112 * 113 * 114 * <pre> 115 * OTHER is used to specify non-standard aliases, those not of the kinds 116 * above. For example, if a Git repo has a ref named "refs/foo/bar", it 117 * is considered to be of kind OTHER. 118 * </pre> 119 * 120 * <code>OTHER = 4;</code> 121 */ 122 OTHER(4), 123 UNRECOGNIZED(-1), 124 ; 125 126 /** 127 * 128 * 129 * <pre> 130 * Do not use. 131 * </pre> 132 * 133 * <code>ANY = 0;</code> 134 */ 135 public static final int ANY_VALUE = 0; 136 /** 137 * 138 * 139 * <pre> 140 * Git tag 141 * </pre> 142 * 143 * <code>FIXED = 1;</code> 144 */ 145 public static final int FIXED_VALUE = 1; 146 /** 147 * 148 * 149 * <pre> 150 * Git branch 151 * </pre> 152 * 153 * <code>MOVABLE = 2;</code> 154 */ 155 public static final int MOVABLE_VALUE = 2; 156 /** 157 * 158 * 159 * <pre> 160 * OTHER is used to specify non-standard aliases, those not of the kinds 161 * above. For example, if a Git repo has a ref named "refs/foo/bar", it 162 * is considered to be of kind OTHER. 163 * </pre> 164 * 165 * <code>OTHER = 4;</code> 166 */ 167 public static final int OTHER_VALUE = 4; 168 getNumber()169 public final int getNumber() { 170 if (this == UNRECOGNIZED) { 171 throw new java.lang.IllegalArgumentException( 172 "Can't get the number of an unknown enum value."); 173 } 174 return value; 175 } 176 177 /** 178 * @param value The numeric wire value of the corresponding enum entry. 179 * @return The enum associated with the given numeric wire value. 180 * @deprecated Use {@link #forNumber(int)} instead. 181 */ 182 @java.lang.Deprecated valueOf(int value)183 public static Kind valueOf(int value) { 184 return forNumber(value); 185 } 186 187 /** 188 * @param value The numeric wire value of the corresponding enum entry. 189 * @return The enum associated with the given numeric wire value. 190 */ forNumber(int value)191 public static Kind forNumber(int value) { 192 switch (value) { 193 case 0: 194 return ANY; 195 case 1: 196 return FIXED; 197 case 2: 198 return MOVABLE; 199 case 4: 200 return OTHER; 201 default: 202 return null; 203 } 204 } 205 internalGetValueMap()206 public static com.google.protobuf.Internal.EnumLiteMap<Kind> internalGetValueMap() { 207 return internalValueMap; 208 } 209 210 private static final com.google.protobuf.Internal.EnumLiteMap<Kind> internalValueMap = 211 new com.google.protobuf.Internal.EnumLiteMap<Kind>() { 212 public Kind findValueByNumber(int number) { 213 return Kind.forNumber(number); 214 } 215 }; 216 getValueDescriptor()217 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 218 if (this == UNRECOGNIZED) { 219 throw new java.lang.IllegalStateException( 220 "Can't get the descriptor of an unrecognized enum value."); 221 } 222 return getDescriptor().getValues().get(ordinal()); 223 } 224 getDescriptorForType()225 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 226 return getDescriptor(); 227 } 228 getDescriptor()229 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 230 return com.google.devtools.source.v1.AliasContext.getDescriptor().getEnumTypes().get(0); 231 } 232 233 private static final Kind[] VALUES = values(); 234 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)235 public static Kind valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 236 if (desc.getType() != getDescriptor()) { 237 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 238 } 239 if (desc.getIndex() == -1) { 240 return UNRECOGNIZED; 241 } 242 return VALUES[desc.getIndex()]; 243 } 244 245 private final int value; 246 Kind(int value)247 private Kind(int value) { 248 this.value = value; 249 } 250 251 // @@protoc_insertion_point(enum_scope:google.devtools.source.v1.AliasContext.Kind) 252 } 253 254 public static final int KIND_FIELD_NUMBER = 1; 255 private int kind_ = 0; 256 /** 257 * 258 * 259 * <pre> 260 * The alias kind. 261 * </pre> 262 * 263 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 264 * 265 * @return The enum numeric value on the wire for kind. 266 */ 267 @java.lang.Override getKindValue()268 public int getKindValue() { 269 return kind_; 270 } 271 /** 272 * 273 * 274 * <pre> 275 * The alias kind. 276 * </pre> 277 * 278 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 279 * 280 * @return The kind. 281 */ 282 @java.lang.Override getKind()283 public com.google.devtools.source.v1.AliasContext.Kind getKind() { 284 com.google.devtools.source.v1.AliasContext.Kind result = 285 com.google.devtools.source.v1.AliasContext.Kind.forNumber(kind_); 286 return result == null ? com.google.devtools.source.v1.AliasContext.Kind.UNRECOGNIZED : result; 287 } 288 289 public static final int NAME_FIELD_NUMBER = 2; 290 291 @SuppressWarnings("serial") 292 private volatile java.lang.Object name_ = ""; 293 /** 294 * 295 * 296 * <pre> 297 * The alias name. 298 * </pre> 299 * 300 * <code>string name = 2;</code> 301 * 302 * @return The name. 303 */ 304 @java.lang.Override getName()305 public java.lang.String getName() { 306 java.lang.Object ref = name_; 307 if (ref instanceof java.lang.String) { 308 return (java.lang.String) ref; 309 } else { 310 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 311 java.lang.String s = bs.toStringUtf8(); 312 name_ = s; 313 return s; 314 } 315 } 316 /** 317 * 318 * 319 * <pre> 320 * The alias name. 321 * </pre> 322 * 323 * <code>string name = 2;</code> 324 * 325 * @return The bytes for name. 326 */ 327 @java.lang.Override getNameBytes()328 public com.google.protobuf.ByteString getNameBytes() { 329 java.lang.Object ref = name_; 330 if (ref instanceof java.lang.String) { 331 com.google.protobuf.ByteString b = 332 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 333 name_ = b; 334 return b; 335 } else { 336 return (com.google.protobuf.ByteString) ref; 337 } 338 } 339 340 private byte memoizedIsInitialized = -1; 341 342 @java.lang.Override isInitialized()343 public final boolean isInitialized() { 344 byte isInitialized = memoizedIsInitialized; 345 if (isInitialized == 1) return true; 346 if (isInitialized == 0) return false; 347 348 memoizedIsInitialized = 1; 349 return true; 350 } 351 352 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)353 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 354 if (kind_ != com.google.devtools.source.v1.AliasContext.Kind.ANY.getNumber()) { 355 output.writeEnum(1, kind_); 356 } 357 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 358 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); 359 } 360 getUnknownFields().writeTo(output); 361 } 362 363 @java.lang.Override getSerializedSize()364 public int getSerializedSize() { 365 int size = memoizedSize; 366 if (size != -1) return size; 367 368 size = 0; 369 if (kind_ != com.google.devtools.source.v1.AliasContext.Kind.ANY.getNumber()) { 370 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, kind_); 371 } 372 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 373 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); 374 } 375 size += getUnknownFields().getSerializedSize(); 376 memoizedSize = size; 377 return size; 378 } 379 380 @java.lang.Override equals(final java.lang.Object obj)381 public boolean equals(final java.lang.Object obj) { 382 if (obj == this) { 383 return true; 384 } 385 if (!(obj instanceof com.google.devtools.source.v1.AliasContext)) { 386 return super.equals(obj); 387 } 388 com.google.devtools.source.v1.AliasContext other = 389 (com.google.devtools.source.v1.AliasContext) obj; 390 391 if (kind_ != other.kind_) return false; 392 if (!getName().equals(other.getName())) return false; 393 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 394 return true; 395 } 396 397 @java.lang.Override hashCode()398 public int hashCode() { 399 if (memoizedHashCode != 0) { 400 return memoizedHashCode; 401 } 402 int hash = 41; 403 hash = (19 * hash) + getDescriptor().hashCode(); 404 hash = (37 * hash) + KIND_FIELD_NUMBER; 405 hash = (53 * hash) + kind_; 406 hash = (37 * hash) + NAME_FIELD_NUMBER; 407 hash = (53 * hash) + getName().hashCode(); 408 hash = (29 * hash) + getUnknownFields().hashCode(); 409 memoizedHashCode = hash; 410 return hash; 411 } 412 parseFrom(java.nio.ByteBuffer data)413 public static com.google.devtools.source.v1.AliasContext parseFrom(java.nio.ByteBuffer data) 414 throws com.google.protobuf.InvalidProtocolBufferException { 415 return PARSER.parseFrom(data); 416 } 417 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)418 public static com.google.devtools.source.v1.AliasContext parseFrom( 419 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 420 throws com.google.protobuf.InvalidProtocolBufferException { 421 return PARSER.parseFrom(data, extensionRegistry); 422 } 423 parseFrom( com.google.protobuf.ByteString data)424 public static com.google.devtools.source.v1.AliasContext parseFrom( 425 com.google.protobuf.ByteString data) 426 throws com.google.protobuf.InvalidProtocolBufferException { 427 return PARSER.parseFrom(data); 428 } 429 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)430 public static com.google.devtools.source.v1.AliasContext parseFrom( 431 com.google.protobuf.ByteString data, 432 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 433 throws com.google.protobuf.InvalidProtocolBufferException { 434 return PARSER.parseFrom(data, extensionRegistry); 435 } 436 parseFrom(byte[] data)437 public static com.google.devtools.source.v1.AliasContext parseFrom(byte[] data) 438 throws com.google.protobuf.InvalidProtocolBufferException { 439 return PARSER.parseFrom(data); 440 } 441 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)442 public static com.google.devtools.source.v1.AliasContext parseFrom( 443 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 444 throws com.google.protobuf.InvalidProtocolBufferException { 445 return PARSER.parseFrom(data, extensionRegistry); 446 } 447 parseFrom(java.io.InputStream input)448 public static com.google.devtools.source.v1.AliasContext parseFrom(java.io.InputStream input) 449 throws java.io.IOException { 450 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 451 } 452 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)453 public static com.google.devtools.source.v1.AliasContext parseFrom( 454 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 455 throws java.io.IOException { 456 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 457 PARSER, input, extensionRegistry); 458 } 459 parseDelimitedFrom( java.io.InputStream input)460 public static com.google.devtools.source.v1.AliasContext parseDelimitedFrom( 461 java.io.InputStream input) throws java.io.IOException { 462 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 463 } 464 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)465 public static com.google.devtools.source.v1.AliasContext parseDelimitedFrom( 466 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 467 throws java.io.IOException { 468 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 469 PARSER, input, extensionRegistry); 470 } 471 parseFrom( com.google.protobuf.CodedInputStream input)472 public static com.google.devtools.source.v1.AliasContext parseFrom( 473 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 474 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 475 } 476 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)477 public static com.google.devtools.source.v1.AliasContext parseFrom( 478 com.google.protobuf.CodedInputStream input, 479 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 480 throws java.io.IOException { 481 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 482 PARSER, input, extensionRegistry); 483 } 484 485 @java.lang.Override newBuilderForType()486 public Builder newBuilderForType() { 487 return newBuilder(); 488 } 489 newBuilder()490 public static Builder newBuilder() { 491 return DEFAULT_INSTANCE.toBuilder(); 492 } 493 newBuilder(com.google.devtools.source.v1.AliasContext prototype)494 public static Builder newBuilder(com.google.devtools.source.v1.AliasContext prototype) { 495 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 496 } 497 498 @java.lang.Override toBuilder()499 public Builder toBuilder() { 500 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 501 } 502 503 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)504 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 505 Builder builder = new Builder(parent); 506 return builder; 507 } 508 /** 509 * 510 * 511 * <pre> 512 * An alias to a repo revision. 513 * </pre> 514 * 515 * Protobuf type {@code google.devtools.source.v1.AliasContext} 516 */ 517 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 518 implements 519 // @@protoc_insertion_point(builder_implements:google.devtools.source.v1.AliasContext) 520 com.google.devtools.source.v1.AliasContextOrBuilder { getDescriptor()521 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 522 return com.google.devtools.source.v1.SourceContextProto 523 .internal_static_google_devtools_source_v1_AliasContext_descriptor; 524 } 525 526 @java.lang.Override 527 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()528 internalGetFieldAccessorTable() { 529 return com.google.devtools.source.v1.SourceContextProto 530 .internal_static_google_devtools_source_v1_AliasContext_fieldAccessorTable 531 .ensureFieldAccessorsInitialized( 532 com.google.devtools.source.v1.AliasContext.class, 533 com.google.devtools.source.v1.AliasContext.Builder.class); 534 } 535 536 // Construct using com.google.devtools.source.v1.AliasContext.newBuilder() Builder()537 private Builder() {} 538 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)539 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 540 super(parent); 541 } 542 543 @java.lang.Override clear()544 public Builder clear() { 545 super.clear(); 546 bitField0_ = 0; 547 kind_ = 0; 548 name_ = ""; 549 return this; 550 } 551 552 @java.lang.Override getDescriptorForType()553 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 554 return com.google.devtools.source.v1.SourceContextProto 555 .internal_static_google_devtools_source_v1_AliasContext_descriptor; 556 } 557 558 @java.lang.Override getDefaultInstanceForType()559 public com.google.devtools.source.v1.AliasContext getDefaultInstanceForType() { 560 return com.google.devtools.source.v1.AliasContext.getDefaultInstance(); 561 } 562 563 @java.lang.Override build()564 public com.google.devtools.source.v1.AliasContext build() { 565 com.google.devtools.source.v1.AliasContext result = buildPartial(); 566 if (!result.isInitialized()) { 567 throw newUninitializedMessageException(result); 568 } 569 return result; 570 } 571 572 @java.lang.Override buildPartial()573 public com.google.devtools.source.v1.AliasContext buildPartial() { 574 com.google.devtools.source.v1.AliasContext result = 575 new com.google.devtools.source.v1.AliasContext(this); 576 if (bitField0_ != 0) { 577 buildPartial0(result); 578 } 579 onBuilt(); 580 return result; 581 } 582 buildPartial0(com.google.devtools.source.v1.AliasContext result)583 private void buildPartial0(com.google.devtools.source.v1.AliasContext result) { 584 int from_bitField0_ = bitField0_; 585 if (((from_bitField0_ & 0x00000001) != 0)) { 586 result.kind_ = kind_; 587 } 588 if (((from_bitField0_ & 0x00000002) != 0)) { 589 result.name_ = name_; 590 } 591 } 592 593 @java.lang.Override clone()594 public Builder clone() { 595 return super.clone(); 596 } 597 598 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)599 public Builder setField( 600 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 601 return super.setField(field, value); 602 } 603 604 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)605 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 606 return super.clearField(field); 607 } 608 609 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)610 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 611 return super.clearOneof(oneof); 612 } 613 614 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)615 public Builder setRepeatedField( 616 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 617 return super.setRepeatedField(field, index, value); 618 } 619 620 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)621 public Builder addRepeatedField( 622 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 623 return super.addRepeatedField(field, value); 624 } 625 626 @java.lang.Override mergeFrom(com.google.protobuf.Message other)627 public Builder mergeFrom(com.google.protobuf.Message other) { 628 if (other instanceof com.google.devtools.source.v1.AliasContext) { 629 return mergeFrom((com.google.devtools.source.v1.AliasContext) other); 630 } else { 631 super.mergeFrom(other); 632 return this; 633 } 634 } 635 mergeFrom(com.google.devtools.source.v1.AliasContext other)636 public Builder mergeFrom(com.google.devtools.source.v1.AliasContext other) { 637 if (other == com.google.devtools.source.v1.AliasContext.getDefaultInstance()) return this; 638 if (other.kind_ != 0) { 639 setKindValue(other.getKindValue()); 640 } 641 if (!other.getName().isEmpty()) { 642 name_ = other.name_; 643 bitField0_ |= 0x00000002; 644 onChanged(); 645 } 646 this.mergeUnknownFields(other.getUnknownFields()); 647 onChanged(); 648 return this; 649 } 650 651 @java.lang.Override isInitialized()652 public final boolean isInitialized() { 653 return true; 654 } 655 656 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)657 public Builder mergeFrom( 658 com.google.protobuf.CodedInputStream input, 659 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 660 throws java.io.IOException { 661 if (extensionRegistry == null) { 662 throw new java.lang.NullPointerException(); 663 } 664 try { 665 boolean done = false; 666 while (!done) { 667 int tag = input.readTag(); 668 switch (tag) { 669 case 0: 670 done = true; 671 break; 672 case 8: 673 { 674 kind_ = input.readEnum(); 675 bitField0_ |= 0x00000001; 676 break; 677 } // case 8 678 case 18: 679 { 680 name_ = input.readStringRequireUtf8(); 681 bitField0_ |= 0x00000002; 682 break; 683 } // case 18 684 default: 685 { 686 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 687 done = true; // was an endgroup tag 688 } 689 break; 690 } // default: 691 } // switch (tag) 692 } // while (!done) 693 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 694 throw e.unwrapIOException(); 695 } finally { 696 onChanged(); 697 } // finally 698 return this; 699 } 700 701 private int bitField0_; 702 703 private int kind_ = 0; 704 /** 705 * 706 * 707 * <pre> 708 * The alias kind. 709 * </pre> 710 * 711 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 712 * 713 * @return The enum numeric value on the wire for kind. 714 */ 715 @java.lang.Override getKindValue()716 public int getKindValue() { 717 return kind_; 718 } 719 /** 720 * 721 * 722 * <pre> 723 * The alias kind. 724 * </pre> 725 * 726 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 727 * 728 * @param value The enum numeric value on the wire for kind to set. 729 * @return This builder for chaining. 730 */ setKindValue(int value)731 public Builder setKindValue(int value) { 732 kind_ = value; 733 bitField0_ |= 0x00000001; 734 onChanged(); 735 return this; 736 } 737 /** 738 * 739 * 740 * <pre> 741 * The alias kind. 742 * </pre> 743 * 744 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 745 * 746 * @return The kind. 747 */ 748 @java.lang.Override getKind()749 public com.google.devtools.source.v1.AliasContext.Kind getKind() { 750 com.google.devtools.source.v1.AliasContext.Kind result = 751 com.google.devtools.source.v1.AliasContext.Kind.forNumber(kind_); 752 return result == null ? com.google.devtools.source.v1.AliasContext.Kind.UNRECOGNIZED : result; 753 } 754 /** 755 * 756 * 757 * <pre> 758 * The alias kind. 759 * </pre> 760 * 761 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 762 * 763 * @param value The kind to set. 764 * @return This builder for chaining. 765 */ setKind(com.google.devtools.source.v1.AliasContext.Kind value)766 public Builder setKind(com.google.devtools.source.v1.AliasContext.Kind value) { 767 if (value == null) { 768 throw new NullPointerException(); 769 } 770 bitField0_ |= 0x00000001; 771 kind_ = value.getNumber(); 772 onChanged(); 773 return this; 774 } 775 /** 776 * 777 * 778 * <pre> 779 * The alias kind. 780 * </pre> 781 * 782 * <code>.google.devtools.source.v1.AliasContext.Kind kind = 1;</code> 783 * 784 * @return This builder for chaining. 785 */ clearKind()786 public Builder clearKind() { 787 bitField0_ = (bitField0_ & ~0x00000001); 788 kind_ = 0; 789 onChanged(); 790 return this; 791 } 792 793 private java.lang.Object name_ = ""; 794 /** 795 * 796 * 797 * <pre> 798 * The alias name. 799 * </pre> 800 * 801 * <code>string name = 2;</code> 802 * 803 * @return The name. 804 */ getName()805 public java.lang.String getName() { 806 java.lang.Object ref = name_; 807 if (!(ref instanceof java.lang.String)) { 808 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 809 java.lang.String s = bs.toStringUtf8(); 810 name_ = s; 811 return s; 812 } else { 813 return (java.lang.String) ref; 814 } 815 } 816 /** 817 * 818 * 819 * <pre> 820 * The alias name. 821 * </pre> 822 * 823 * <code>string name = 2;</code> 824 * 825 * @return The bytes for name. 826 */ getNameBytes()827 public com.google.protobuf.ByteString getNameBytes() { 828 java.lang.Object ref = name_; 829 if (ref instanceof String) { 830 com.google.protobuf.ByteString b = 831 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 832 name_ = b; 833 return b; 834 } else { 835 return (com.google.protobuf.ByteString) ref; 836 } 837 } 838 /** 839 * 840 * 841 * <pre> 842 * The alias name. 843 * </pre> 844 * 845 * <code>string name = 2;</code> 846 * 847 * @param value The name to set. 848 * @return This builder for chaining. 849 */ setName(java.lang.String value)850 public Builder setName(java.lang.String value) { 851 if (value == null) { 852 throw new NullPointerException(); 853 } 854 name_ = value; 855 bitField0_ |= 0x00000002; 856 onChanged(); 857 return this; 858 } 859 /** 860 * 861 * 862 * <pre> 863 * The alias name. 864 * </pre> 865 * 866 * <code>string name = 2;</code> 867 * 868 * @return This builder for chaining. 869 */ clearName()870 public Builder clearName() { 871 name_ = getDefaultInstance().getName(); 872 bitField0_ = (bitField0_ & ~0x00000002); 873 onChanged(); 874 return this; 875 } 876 /** 877 * 878 * 879 * <pre> 880 * The alias name. 881 * </pre> 882 * 883 * <code>string name = 2;</code> 884 * 885 * @param value The bytes for name to set. 886 * @return This builder for chaining. 887 */ setNameBytes(com.google.protobuf.ByteString value)888 public Builder setNameBytes(com.google.protobuf.ByteString value) { 889 if (value == null) { 890 throw new NullPointerException(); 891 } 892 checkByteStringIsUtf8(value); 893 name_ = value; 894 bitField0_ |= 0x00000002; 895 onChanged(); 896 return this; 897 } 898 899 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)900 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 901 return super.setUnknownFields(unknownFields); 902 } 903 904 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)905 public final Builder mergeUnknownFields( 906 final com.google.protobuf.UnknownFieldSet unknownFields) { 907 return super.mergeUnknownFields(unknownFields); 908 } 909 910 // @@protoc_insertion_point(builder_scope:google.devtools.source.v1.AliasContext) 911 } 912 913 // @@protoc_insertion_point(class_scope:google.devtools.source.v1.AliasContext) 914 private static final com.google.devtools.source.v1.AliasContext DEFAULT_INSTANCE; 915 916 static { 917 DEFAULT_INSTANCE = new com.google.devtools.source.v1.AliasContext(); 918 } 919 getDefaultInstance()920 public static com.google.devtools.source.v1.AliasContext getDefaultInstance() { 921 return DEFAULT_INSTANCE; 922 } 923 924 private static final com.google.protobuf.Parser<AliasContext> PARSER = 925 new com.google.protobuf.AbstractParser<AliasContext>() { 926 @java.lang.Override 927 public AliasContext parsePartialFrom( 928 com.google.protobuf.CodedInputStream input, 929 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 930 throws com.google.protobuf.InvalidProtocolBufferException { 931 Builder builder = newBuilder(); 932 try { 933 builder.mergeFrom(input, extensionRegistry); 934 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 935 throw e.setUnfinishedMessage(builder.buildPartial()); 936 } catch (com.google.protobuf.UninitializedMessageException e) { 937 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 938 } catch (java.io.IOException e) { 939 throw new com.google.protobuf.InvalidProtocolBufferException(e) 940 .setUnfinishedMessage(builder.buildPartial()); 941 } 942 return builder.buildPartial(); 943 } 944 }; 945 parser()946 public static com.google.protobuf.Parser<AliasContext> parser() { 947 return PARSER; 948 } 949 950 @java.lang.Override getParserForType()951 public com.google.protobuf.Parser<AliasContext> getParserForType() { 952 return PARSER; 953 } 954 955 @java.lang.Override getDefaultInstanceForType()956 public com.google.devtools.source.v1.AliasContext getDefaultInstanceForType() { 957 return DEFAULT_INSTANCE; 958 } 959 } 960