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/cloudtrace/v1/trace.proto 18 19 package com.google.devtools.cloudtrace.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A span represents a single timed event within a trace. Spans can be nested 26 * and form a trace tree. Often, a trace contains a root span that describes the 27 * end-to-end latency of an operation and, optionally, one or more subspans for 28 * its suboperations. Spans do not need to be contiguous. There may be gaps 29 * between spans in a trace. 30 * </pre> 31 * 32 * Protobuf type {@code google.devtools.cloudtrace.v1.TraceSpan} 33 */ 34 public final class TraceSpan extends com.google.protobuf.GeneratedMessageV3 35 implements 36 // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v1.TraceSpan) 37 TraceSpanOrBuilder { 38 private static final long serialVersionUID = 0L; 39 // Use TraceSpan.newBuilder() to construct. TraceSpan(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)40 private TraceSpan(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 41 super(builder); 42 } 43 TraceSpan()44 private TraceSpan() { 45 kind_ = 0; 46 name_ = ""; 47 } 48 49 @java.lang.Override 50 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)51 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 52 return new TraceSpan(); 53 } 54 55 @java.lang.Override getUnknownFields()56 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 57 return this.unknownFields; 58 } 59 getDescriptor()60 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 61 return com.google.devtools.cloudtrace.v1.TraceProto 62 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor; 63 } 64 65 @SuppressWarnings({"rawtypes"}) 66 @java.lang.Override internalGetMapField(int number)67 protected com.google.protobuf.MapField internalGetMapField(int number) { 68 switch (number) { 69 case 7: 70 return internalGetLabels(); 71 default: 72 throw new RuntimeException("Invalid map field number: " + number); 73 } 74 } 75 76 @java.lang.Override 77 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()78 internalGetFieldAccessorTable() { 79 return com.google.devtools.cloudtrace.v1.TraceProto 80 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_fieldAccessorTable 81 .ensureFieldAccessorsInitialized( 82 com.google.devtools.cloudtrace.v1.TraceSpan.class, 83 com.google.devtools.cloudtrace.v1.TraceSpan.Builder.class); 84 } 85 86 /** 87 * 88 * 89 * <pre> 90 * Type of span. Can be used to specify additional relationships between spans 91 * in addition to a parent/child relationship. 92 * </pre> 93 * 94 * Protobuf enum {@code google.devtools.cloudtrace.v1.TraceSpan.SpanKind} 95 */ 96 public enum SpanKind implements com.google.protobuf.ProtocolMessageEnum { 97 /** 98 * 99 * 100 * <pre> 101 * Unspecified. 102 * </pre> 103 * 104 * <code>SPAN_KIND_UNSPECIFIED = 0;</code> 105 */ 106 SPAN_KIND_UNSPECIFIED(0), 107 /** 108 * 109 * 110 * <pre> 111 * Indicates that the span covers server-side handling of an RPC or other 112 * remote network request. 113 * </pre> 114 * 115 * <code>RPC_SERVER = 1;</code> 116 */ 117 RPC_SERVER(1), 118 /** 119 * 120 * 121 * <pre> 122 * Indicates that the span covers the client-side wrapper around an RPC or 123 * other remote request. 124 * </pre> 125 * 126 * <code>RPC_CLIENT = 2;</code> 127 */ 128 RPC_CLIENT(2), 129 UNRECOGNIZED(-1), 130 ; 131 132 /** 133 * 134 * 135 * <pre> 136 * Unspecified. 137 * </pre> 138 * 139 * <code>SPAN_KIND_UNSPECIFIED = 0;</code> 140 */ 141 public static final int SPAN_KIND_UNSPECIFIED_VALUE = 0; 142 /** 143 * 144 * 145 * <pre> 146 * Indicates that the span covers server-side handling of an RPC or other 147 * remote network request. 148 * </pre> 149 * 150 * <code>RPC_SERVER = 1;</code> 151 */ 152 public static final int RPC_SERVER_VALUE = 1; 153 /** 154 * 155 * 156 * <pre> 157 * Indicates that the span covers the client-side wrapper around an RPC or 158 * other remote request. 159 * </pre> 160 * 161 * <code>RPC_CLIENT = 2;</code> 162 */ 163 public static final int RPC_CLIENT_VALUE = 2; 164 getNumber()165 public final int getNumber() { 166 if (this == UNRECOGNIZED) { 167 throw new java.lang.IllegalArgumentException( 168 "Can't get the number of an unknown enum value."); 169 } 170 return value; 171 } 172 173 /** 174 * @param value The numeric wire value of the corresponding enum entry. 175 * @return The enum associated with the given numeric wire value. 176 * @deprecated Use {@link #forNumber(int)} instead. 177 */ 178 @java.lang.Deprecated valueOf(int value)179 public static SpanKind valueOf(int value) { 180 return forNumber(value); 181 } 182 183 /** 184 * @param value The numeric wire value of the corresponding enum entry. 185 * @return The enum associated with the given numeric wire value. 186 */ forNumber(int value)187 public static SpanKind forNumber(int value) { 188 switch (value) { 189 case 0: 190 return SPAN_KIND_UNSPECIFIED; 191 case 1: 192 return RPC_SERVER; 193 case 2: 194 return RPC_CLIENT; 195 default: 196 return null; 197 } 198 } 199 internalGetValueMap()200 public static com.google.protobuf.Internal.EnumLiteMap<SpanKind> internalGetValueMap() { 201 return internalValueMap; 202 } 203 204 private static final com.google.protobuf.Internal.EnumLiteMap<SpanKind> internalValueMap = 205 new com.google.protobuf.Internal.EnumLiteMap<SpanKind>() { 206 public SpanKind findValueByNumber(int number) { 207 return SpanKind.forNumber(number); 208 } 209 }; 210 getValueDescriptor()211 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 212 if (this == UNRECOGNIZED) { 213 throw new java.lang.IllegalStateException( 214 "Can't get the descriptor of an unrecognized enum value."); 215 } 216 return getDescriptor().getValues().get(ordinal()); 217 } 218 getDescriptorForType()219 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 220 return getDescriptor(); 221 } 222 getDescriptor()223 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 224 return com.google.devtools.cloudtrace.v1.TraceSpan.getDescriptor().getEnumTypes().get(0); 225 } 226 227 private static final SpanKind[] VALUES = values(); 228 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)229 public static SpanKind valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 230 if (desc.getType() != getDescriptor()) { 231 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 232 } 233 if (desc.getIndex() == -1) { 234 return UNRECOGNIZED; 235 } 236 return VALUES[desc.getIndex()]; 237 } 238 239 private final int value; 240 SpanKind(int value)241 private SpanKind(int value) { 242 this.value = value; 243 } 244 245 // @@protoc_insertion_point(enum_scope:google.devtools.cloudtrace.v1.TraceSpan.SpanKind) 246 } 247 248 public static final int SPAN_ID_FIELD_NUMBER = 1; 249 private long spanId_ = 0L; 250 /** 251 * 252 * 253 * <pre> 254 * Identifier for the span. Must be a 64-bit integer other than 0 and 255 * unique within a trace. For example, `2205310701640571284`. 256 * </pre> 257 * 258 * <code>fixed64 span_id = 1;</code> 259 * 260 * @return The spanId. 261 */ 262 @java.lang.Override getSpanId()263 public long getSpanId() { 264 return spanId_; 265 } 266 267 public static final int KIND_FIELD_NUMBER = 2; 268 private int kind_ = 0; 269 /** 270 * 271 * 272 * <pre> 273 * Distinguishes between spans generated in a particular context. For example, 274 * two spans with the same name may be distinguished using `RPC_CLIENT` 275 * and `RPC_SERVER` to identify queueing latency associated with the span. 276 * </pre> 277 * 278 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 279 * 280 * @return The enum numeric value on the wire for kind. 281 */ 282 @java.lang.Override getKindValue()283 public int getKindValue() { 284 return kind_; 285 } 286 /** 287 * 288 * 289 * <pre> 290 * Distinguishes between spans generated in a particular context. For example, 291 * two spans with the same name may be distinguished using `RPC_CLIENT` 292 * and `RPC_SERVER` to identify queueing latency associated with the span. 293 * </pre> 294 * 295 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 296 * 297 * @return The kind. 298 */ 299 @java.lang.Override getKind()300 public com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind getKind() { 301 com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind result = 302 com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.forNumber(kind_); 303 return result == null 304 ? com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.UNRECOGNIZED 305 : result; 306 } 307 308 public static final int NAME_FIELD_NUMBER = 3; 309 310 @SuppressWarnings("serial") 311 private volatile java.lang.Object name_ = ""; 312 /** 313 * 314 * 315 * <pre> 316 * Name of the span. Must be less than 128 bytes. The span name is sanitized 317 * and displayed in the Stackdriver Trace tool in the 318 * Google Cloud Platform Console. 319 * The name may be a method name or some other per-call site name. 320 * For the same executable and the same call point, a best practice is 321 * to use a consistent name, which makes it easier to correlate 322 * cross-trace spans. 323 * </pre> 324 * 325 * <code>string name = 3;</code> 326 * 327 * @return The name. 328 */ 329 @java.lang.Override getName()330 public java.lang.String getName() { 331 java.lang.Object ref = name_; 332 if (ref instanceof java.lang.String) { 333 return (java.lang.String) ref; 334 } else { 335 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 336 java.lang.String s = bs.toStringUtf8(); 337 name_ = s; 338 return s; 339 } 340 } 341 /** 342 * 343 * 344 * <pre> 345 * Name of the span. Must be less than 128 bytes. The span name is sanitized 346 * and displayed in the Stackdriver Trace tool in the 347 * Google Cloud Platform Console. 348 * The name may be a method name or some other per-call site name. 349 * For the same executable and the same call point, a best practice is 350 * to use a consistent name, which makes it easier to correlate 351 * cross-trace spans. 352 * </pre> 353 * 354 * <code>string name = 3;</code> 355 * 356 * @return The bytes for name. 357 */ 358 @java.lang.Override getNameBytes()359 public com.google.protobuf.ByteString getNameBytes() { 360 java.lang.Object ref = name_; 361 if (ref instanceof java.lang.String) { 362 com.google.protobuf.ByteString b = 363 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 364 name_ = b; 365 return b; 366 } else { 367 return (com.google.protobuf.ByteString) ref; 368 } 369 } 370 371 public static final int START_TIME_FIELD_NUMBER = 4; 372 private com.google.protobuf.Timestamp startTime_; 373 /** 374 * 375 * 376 * <pre> 377 * Start time of the span in nanoseconds from the UNIX epoch. 378 * </pre> 379 * 380 * <code>.google.protobuf.Timestamp start_time = 4;</code> 381 * 382 * @return Whether the startTime field is set. 383 */ 384 @java.lang.Override hasStartTime()385 public boolean hasStartTime() { 386 return startTime_ != null; 387 } 388 /** 389 * 390 * 391 * <pre> 392 * Start time of the span in nanoseconds from the UNIX epoch. 393 * </pre> 394 * 395 * <code>.google.protobuf.Timestamp start_time = 4;</code> 396 * 397 * @return The startTime. 398 */ 399 @java.lang.Override getStartTime()400 public com.google.protobuf.Timestamp getStartTime() { 401 return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; 402 } 403 /** 404 * 405 * 406 * <pre> 407 * Start time of the span in nanoseconds from the UNIX epoch. 408 * </pre> 409 * 410 * <code>.google.protobuf.Timestamp start_time = 4;</code> 411 */ 412 @java.lang.Override getStartTimeOrBuilder()413 public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { 414 return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; 415 } 416 417 public static final int END_TIME_FIELD_NUMBER = 5; 418 private com.google.protobuf.Timestamp endTime_; 419 /** 420 * 421 * 422 * <pre> 423 * End time of the span in nanoseconds from the UNIX epoch. 424 * </pre> 425 * 426 * <code>.google.protobuf.Timestamp end_time = 5;</code> 427 * 428 * @return Whether the endTime field is set. 429 */ 430 @java.lang.Override hasEndTime()431 public boolean hasEndTime() { 432 return endTime_ != null; 433 } 434 /** 435 * 436 * 437 * <pre> 438 * End time of the span in nanoseconds from the UNIX epoch. 439 * </pre> 440 * 441 * <code>.google.protobuf.Timestamp end_time = 5;</code> 442 * 443 * @return The endTime. 444 */ 445 @java.lang.Override getEndTime()446 public com.google.protobuf.Timestamp getEndTime() { 447 return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; 448 } 449 /** 450 * 451 * 452 * <pre> 453 * End time of the span in nanoseconds from the UNIX epoch. 454 * </pre> 455 * 456 * <code>.google.protobuf.Timestamp end_time = 5;</code> 457 */ 458 @java.lang.Override getEndTimeOrBuilder()459 public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { 460 return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; 461 } 462 463 public static final int PARENT_SPAN_ID_FIELD_NUMBER = 6; 464 private long parentSpanId_ = 0L; 465 /** 466 * 467 * 468 * <pre> 469 * Optional. ID of the parent span, if any. 470 * </pre> 471 * 472 * <code>fixed64 parent_span_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code> 473 * 474 * @return The parentSpanId. 475 */ 476 @java.lang.Override getParentSpanId()477 public long getParentSpanId() { 478 return parentSpanId_; 479 } 480 481 public static final int LABELS_FIELD_NUMBER = 7; 482 483 private static final class LabelsDefaultEntryHolder { 484 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 485 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 486 com.google.devtools.cloudtrace.v1.TraceProto 487 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_LabelsEntry_descriptor, 488 com.google.protobuf.WireFormat.FieldType.STRING, 489 "", 490 com.google.protobuf.WireFormat.FieldType.STRING, 491 ""); 492 } 493 494 @SuppressWarnings("serial") 495 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 496 internalGetLabels()497 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 498 if (labels_ == null) { 499 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 500 } 501 return labels_; 502 } 503 getLabelsCount()504 public int getLabelsCount() { 505 return internalGetLabels().getMap().size(); 506 } 507 /** 508 * 509 * 510 * <pre> 511 * Collection of labels associated with the span. Label keys must be less than 512 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 513 * `/stacktrace` values). 514 * Some predefined label keys exist, or you may create your own. When creating 515 * your own, we recommend the following formats: 516 * * `/category/product/key` for agents of well-known products (e.g. 517 * `/db/mongodb/read_size`). 518 * * `short_host/path/key` for domain-specific keys (e.g. 519 * `foo.com/myproduct/bar`) 520 * Predefined labels include: 521 * * `/agent` 522 * * `/component` 523 * * `/error/message` 524 * * `/error/name` 525 * * `/http/client_city` 526 * * `/http/client_country` 527 * * `/http/client_protocol` 528 * * `/http/client_region` 529 * * `/http/host` 530 * * `/http/method` 531 * * `/http/path` 532 * * `/http/redirected_url` 533 * * `/http/request/size` 534 * * `/http/response/size` 535 * * `/http/route` 536 * * `/http/status_code` 537 * * `/http/url` 538 * * `/http/user_agent` 539 * * `/pid` 540 * * `/stacktrace` 541 * * `/tid` 542 * </pre> 543 * 544 * <code>map<string, string> labels = 7;</code> 545 */ 546 @java.lang.Override containsLabels(java.lang.String key)547 public boolean containsLabels(java.lang.String key) { 548 if (key == null) { 549 throw new NullPointerException("map key"); 550 } 551 return internalGetLabels().getMap().containsKey(key); 552 } 553 /** Use {@link #getLabelsMap()} instead. */ 554 @java.lang.Override 555 @java.lang.Deprecated getLabels()556 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 557 return getLabelsMap(); 558 } 559 /** 560 * 561 * 562 * <pre> 563 * Collection of labels associated with the span. Label keys must be less than 564 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 565 * `/stacktrace` values). 566 * Some predefined label keys exist, or you may create your own. When creating 567 * your own, we recommend the following formats: 568 * * `/category/product/key` for agents of well-known products (e.g. 569 * `/db/mongodb/read_size`). 570 * * `short_host/path/key` for domain-specific keys (e.g. 571 * `foo.com/myproduct/bar`) 572 * Predefined labels include: 573 * * `/agent` 574 * * `/component` 575 * * `/error/message` 576 * * `/error/name` 577 * * `/http/client_city` 578 * * `/http/client_country` 579 * * `/http/client_protocol` 580 * * `/http/client_region` 581 * * `/http/host` 582 * * `/http/method` 583 * * `/http/path` 584 * * `/http/redirected_url` 585 * * `/http/request/size` 586 * * `/http/response/size` 587 * * `/http/route` 588 * * `/http/status_code` 589 * * `/http/url` 590 * * `/http/user_agent` 591 * * `/pid` 592 * * `/stacktrace` 593 * * `/tid` 594 * </pre> 595 * 596 * <code>map<string, string> labels = 7;</code> 597 */ 598 @java.lang.Override getLabelsMap()599 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 600 return internalGetLabels().getMap(); 601 } 602 /** 603 * 604 * 605 * <pre> 606 * Collection of labels associated with the span. Label keys must be less than 607 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 608 * `/stacktrace` values). 609 * Some predefined label keys exist, or you may create your own. When creating 610 * your own, we recommend the following formats: 611 * * `/category/product/key` for agents of well-known products (e.g. 612 * `/db/mongodb/read_size`). 613 * * `short_host/path/key` for domain-specific keys (e.g. 614 * `foo.com/myproduct/bar`) 615 * Predefined labels include: 616 * * `/agent` 617 * * `/component` 618 * * `/error/message` 619 * * `/error/name` 620 * * `/http/client_city` 621 * * `/http/client_country` 622 * * `/http/client_protocol` 623 * * `/http/client_region` 624 * * `/http/host` 625 * * `/http/method` 626 * * `/http/path` 627 * * `/http/redirected_url` 628 * * `/http/request/size` 629 * * `/http/response/size` 630 * * `/http/route` 631 * * `/http/status_code` 632 * * `/http/url` 633 * * `/http/user_agent` 634 * * `/pid` 635 * * `/stacktrace` 636 * * `/tid` 637 * </pre> 638 * 639 * <code>map<string, string> labels = 7;</code> 640 */ 641 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)642 public /* nullable */ java.lang.String getLabelsOrDefault( 643 java.lang.String key, 644 /* nullable */ 645 java.lang.String defaultValue) { 646 if (key == null) { 647 throw new NullPointerException("map key"); 648 } 649 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 650 return map.containsKey(key) ? map.get(key) : defaultValue; 651 } 652 /** 653 * 654 * 655 * <pre> 656 * Collection of labels associated with the span. Label keys must be less than 657 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 658 * `/stacktrace` values). 659 * Some predefined label keys exist, or you may create your own. When creating 660 * your own, we recommend the following formats: 661 * * `/category/product/key` for agents of well-known products (e.g. 662 * `/db/mongodb/read_size`). 663 * * `short_host/path/key` for domain-specific keys (e.g. 664 * `foo.com/myproduct/bar`) 665 * Predefined labels include: 666 * * `/agent` 667 * * `/component` 668 * * `/error/message` 669 * * `/error/name` 670 * * `/http/client_city` 671 * * `/http/client_country` 672 * * `/http/client_protocol` 673 * * `/http/client_region` 674 * * `/http/host` 675 * * `/http/method` 676 * * `/http/path` 677 * * `/http/redirected_url` 678 * * `/http/request/size` 679 * * `/http/response/size` 680 * * `/http/route` 681 * * `/http/status_code` 682 * * `/http/url` 683 * * `/http/user_agent` 684 * * `/pid` 685 * * `/stacktrace` 686 * * `/tid` 687 * </pre> 688 * 689 * <code>map<string, string> labels = 7;</code> 690 */ 691 @java.lang.Override getLabelsOrThrow(java.lang.String key)692 public java.lang.String getLabelsOrThrow(java.lang.String key) { 693 if (key == null) { 694 throw new NullPointerException("map key"); 695 } 696 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 697 if (!map.containsKey(key)) { 698 throw new java.lang.IllegalArgumentException(); 699 } 700 return map.get(key); 701 } 702 703 private byte memoizedIsInitialized = -1; 704 705 @java.lang.Override isInitialized()706 public final boolean isInitialized() { 707 byte isInitialized = memoizedIsInitialized; 708 if (isInitialized == 1) return true; 709 if (isInitialized == 0) return false; 710 711 memoizedIsInitialized = 1; 712 return true; 713 } 714 715 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)716 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 717 if (spanId_ != 0L) { 718 output.writeFixed64(1, spanId_); 719 } 720 if (kind_ 721 != com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.SPAN_KIND_UNSPECIFIED.getNumber()) { 722 output.writeEnum(2, kind_); 723 } 724 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 725 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); 726 } 727 if (startTime_ != null) { 728 output.writeMessage(4, getStartTime()); 729 } 730 if (endTime_ != null) { 731 output.writeMessage(5, getEndTime()); 732 } 733 if (parentSpanId_ != 0L) { 734 output.writeFixed64(6, parentSpanId_); 735 } 736 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 737 output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); 738 getUnknownFields().writeTo(output); 739 } 740 741 @java.lang.Override getSerializedSize()742 public int getSerializedSize() { 743 int size = memoizedSize; 744 if (size != -1) return size; 745 746 size = 0; 747 if (spanId_ != 0L) { 748 size += com.google.protobuf.CodedOutputStream.computeFixed64Size(1, spanId_); 749 } 750 if (kind_ 751 != com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.SPAN_KIND_UNSPECIFIED.getNumber()) { 752 size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, kind_); 753 } 754 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 755 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); 756 } 757 if (startTime_ != null) { 758 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); 759 } 760 if (endTime_ != null) { 761 size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); 762 } 763 if (parentSpanId_ != 0L) { 764 size += com.google.protobuf.CodedOutputStream.computeFixed64Size(6, parentSpanId_); 765 } 766 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 767 internalGetLabels().getMap().entrySet()) { 768 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 769 LabelsDefaultEntryHolder.defaultEntry 770 .newBuilderForType() 771 .setKey(entry.getKey()) 772 .setValue(entry.getValue()) 773 .build(); 774 size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); 775 } 776 size += getUnknownFields().getSerializedSize(); 777 memoizedSize = size; 778 return size; 779 } 780 781 @java.lang.Override equals(final java.lang.Object obj)782 public boolean equals(final java.lang.Object obj) { 783 if (obj == this) { 784 return true; 785 } 786 if (!(obj instanceof com.google.devtools.cloudtrace.v1.TraceSpan)) { 787 return super.equals(obj); 788 } 789 com.google.devtools.cloudtrace.v1.TraceSpan other = 790 (com.google.devtools.cloudtrace.v1.TraceSpan) obj; 791 792 if (getSpanId() != other.getSpanId()) return false; 793 if (kind_ != other.kind_) return false; 794 if (!getName().equals(other.getName())) return false; 795 if (hasStartTime() != other.hasStartTime()) return false; 796 if (hasStartTime()) { 797 if (!getStartTime().equals(other.getStartTime())) return false; 798 } 799 if (hasEndTime() != other.hasEndTime()) return false; 800 if (hasEndTime()) { 801 if (!getEndTime().equals(other.getEndTime())) return false; 802 } 803 if (getParentSpanId() != other.getParentSpanId()) return false; 804 if (!internalGetLabels().equals(other.internalGetLabels())) return false; 805 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 806 return true; 807 } 808 809 @java.lang.Override hashCode()810 public int hashCode() { 811 if (memoizedHashCode != 0) { 812 return memoizedHashCode; 813 } 814 int hash = 41; 815 hash = (19 * hash) + getDescriptor().hashCode(); 816 hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; 817 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSpanId()); 818 hash = (37 * hash) + KIND_FIELD_NUMBER; 819 hash = (53 * hash) + kind_; 820 hash = (37 * hash) + NAME_FIELD_NUMBER; 821 hash = (53 * hash) + getName().hashCode(); 822 if (hasStartTime()) { 823 hash = (37 * hash) + START_TIME_FIELD_NUMBER; 824 hash = (53 * hash) + getStartTime().hashCode(); 825 } 826 if (hasEndTime()) { 827 hash = (37 * hash) + END_TIME_FIELD_NUMBER; 828 hash = (53 * hash) + getEndTime().hashCode(); 829 } 830 hash = (37 * hash) + PARENT_SPAN_ID_FIELD_NUMBER; 831 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getParentSpanId()); 832 if (!internalGetLabels().getMap().isEmpty()) { 833 hash = (37 * hash) + LABELS_FIELD_NUMBER; 834 hash = (53 * hash) + internalGetLabels().hashCode(); 835 } 836 hash = (29 * hash) + getUnknownFields().hashCode(); 837 memoizedHashCode = hash; 838 return hash; 839 } 840 parseFrom(java.nio.ByteBuffer data)841 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(java.nio.ByteBuffer data) 842 throws com.google.protobuf.InvalidProtocolBufferException { 843 return PARSER.parseFrom(data); 844 } 845 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)846 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 847 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 848 throws com.google.protobuf.InvalidProtocolBufferException { 849 return PARSER.parseFrom(data, extensionRegistry); 850 } 851 parseFrom( com.google.protobuf.ByteString data)852 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 853 com.google.protobuf.ByteString data) 854 throws com.google.protobuf.InvalidProtocolBufferException { 855 return PARSER.parseFrom(data); 856 } 857 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)858 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 859 com.google.protobuf.ByteString data, 860 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 861 throws com.google.protobuf.InvalidProtocolBufferException { 862 return PARSER.parseFrom(data, extensionRegistry); 863 } 864 parseFrom(byte[] data)865 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(byte[] data) 866 throws com.google.protobuf.InvalidProtocolBufferException { 867 return PARSER.parseFrom(data); 868 } 869 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)870 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 871 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 872 throws com.google.protobuf.InvalidProtocolBufferException { 873 return PARSER.parseFrom(data, extensionRegistry); 874 } 875 parseFrom(java.io.InputStream input)876 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(java.io.InputStream input) 877 throws java.io.IOException { 878 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 879 } 880 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)881 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 882 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 883 throws java.io.IOException { 884 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 885 PARSER, input, extensionRegistry); 886 } 887 parseDelimitedFrom( java.io.InputStream input)888 public static com.google.devtools.cloudtrace.v1.TraceSpan parseDelimitedFrom( 889 java.io.InputStream input) throws java.io.IOException { 890 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 891 } 892 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)893 public static com.google.devtools.cloudtrace.v1.TraceSpan parseDelimitedFrom( 894 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 895 throws java.io.IOException { 896 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 897 PARSER, input, extensionRegistry); 898 } 899 parseFrom( com.google.protobuf.CodedInputStream input)900 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 901 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 902 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 903 } 904 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)905 public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom( 906 com.google.protobuf.CodedInputStream input, 907 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 908 throws java.io.IOException { 909 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 910 PARSER, input, extensionRegistry); 911 } 912 913 @java.lang.Override newBuilderForType()914 public Builder newBuilderForType() { 915 return newBuilder(); 916 } 917 newBuilder()918 public static Builder newBuilder() { 919 return DEFAULT_INSTANCE.toBuilder(); 920 } 921 newBuilder(com.google.devtools.cloudtrace.v1.TraceSpan prototype)922 public static Builder newBuilder(com.google.devtools.cloudtrace.v1.TraceSpan prototype) { 923 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 924 } 925 926 @java.lang.Override toBuilder()927 public Builder toBuilder() { 928 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 929 } 930 931 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)932 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 933 Builder builder = new Builder(parent); 934 return builder; 935 } 936 /** 937 * 938 * 939 * <pre> 940 * A span represents a single timed event within a trace. Spans can be nested 941 * and form a trace tree. Often, a trace contains a root span that describes the 942 * end-to-end latency of an operation and, optionally, one or more subspans for 943 * its suboperations. Spans do not need to be contiguous. There may be gaps 944 * between spans in a trace. 945 * </pre> 946 * 947 * Protobuf type {@code google.devtools.cloudtrace.v1.TraceSpan} 948 */ 949 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 950 implements 951 // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v1.TraceSpan) 952 com.google.devtools.cloudtrace.v1.TraceSpanOrBuilder { getDescriptor()953 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 954 return com.google.devtools.cloudtrace.v1.TraceProto 955 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor; 956 } 957 958 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)959 protected com.google.protobuf.MapField internalGetMapField(int number) { 960 switch (number) { 961 case 7: 962 return internalGetLabels(); 963 default: 964 throw new RuntimeException("Invalid map field number: " + number); 965 } 966 } 967 968 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)969 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 970 switch (number) { 971 case 7: 972 return internalGetMutableLabels(); 973 default: 974 throw new RuntimeException("Invalid map field number: " + number); 975 } 976 } 977 978 @java.lang.Override 979 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()980 internalGetFieldAccessorTable() { 981 return com.google.devtools.cloudtrace.v1.TraceProto 982 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_fieldAccessorTable 983 .ensureFieldAccessorsInitialized( 984 com.google.devtools.cloudtrace.v1.TraceSpan.class, 985 com.google.devtools.cloudtrace.v1.TraceSpan.Builder.class); 986 } 987 988 // Construct using com.google.devtools.cloudtrace.v1.TraceSpan.newBuilder() Builder()989 private Builder() {} 990 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)991 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 992 super(parent); 993 } 994 995 @java.lang.Override clear()996 public Builder clear() { 997 super.clear(); 998 bitField0_ = 0; 999 spanId_ = 0L; 1000 kind_ = 0; 1001 name_ = ""; 1002 startTime_ = null; 1003 if (startTimeBuilder_ != null) { 1004 startTimeBuilder_.dispose(); 1005 startTimeBuilder_ = null; 1006 } 1007 endTime_ = null; 1008 if (endTimeBuilder_ != null) { 1009 endTimeBuilder_.dispose(); 1010 endTimeBuilder_ = null; 1011 } 1012 parentSpanId_ = 0L; 1013 internalGetMutableLabels().clear(); 1014 return this; 1015 } 1016 1017 @java.lang.Override getDescriptorForType()1018 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1019 return com.google.devtools.cloudtrace.v1.TraceProto 1020 .internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor; 1021 } 1022 1023 @java.lang.Override getDefaultInstanceForType()1024 public com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstanceForType() { 1025 return com.google.devtools.cloudtrace.v1.TraceSpan.getDefaultInstance(); 1026 } 1027 1028 @java.lang.Override build()1029 public com.google.devtools.cloudtrace.v1.TraceSpan build() { 1030 com.google.devtools.cloudtrace.v1.TraceSpan result = buildPartial(); 1031 if (!result.isInitialized()) { 1032 throw newUninitializedMessageException(result); 1033 } 1034 return result; 1035 } 1036 1037 @java.lang.Override buildPartial()1038 public com.google.devtools.cloudtrace.v1.TraceSpan buildPartial() { 1039 com.google.devtools.cloudtrace.v1.TraceSpan result = 1040 new com.google.devtools.cloudtrace.v1.TraceSpan(this); 1041 if (bitField0_ != 0) { 1042 buildPartial0(result); 1043 } 1044 onBuilt(); 1045 return result; 1046 } 1047 buildPartial0(com.google.devtools.cloudtrace.v1.TraceSpan result)1048 private void buildPartial0(com.google.devtools.cloudtrace.v1.TraceSpan result) { 1049 int from_bitField0_ = bitField0_; 1050 if (((from_bitField0_ & 0x00000001) != 0)) { 1051 result.spanId_ = spanId_; 1052 } 1053 if (((from_bitField0_ & 0x00000002) != 0)) { 1054 result.kind_ = kind_; 1055 } 1056 if (((from_bitField0_ & 0x00000004) != 0)) { 1057 result.name_ = name_; 1058 } 1059 if (((from_bitField0_ & 0x00000008) != 0)) { 1060 result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); 1061 } 1062 if (((from_bitField0_ & 0x00000010) != 0)) { 1063 result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); 1064 } 1065 if (((from_bitField0_ & 0x00000020) != 0)) { 1066 result.parentSpanId_ = parentSpanId_; 1067 } 1068 if (((from_bitField0_ & 0x00000040) != 0)) { 1069 result.labels_ = internalGetLabels(); 1070 result.labels_.makeImmutable(); 1071 } 1072 } 1073 1074 @java.lang.Override clone()1075 public Builder clone() { 1076 return super.clone(); 1077 } 1078 1079 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1080 public Builder setField( 1081 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1082 return super.setField(field, value); 1083 } 1084 1085 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1086 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1087 return super.clearField(field); 1088 } 1089 1090 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1091 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1092 return super.clearOneof(oneof); 1093 } 1094 1095 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1096 public Builder setRepeatedField( 1097 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1098 return super.setRepeatedField(field, index, value); 1099 } 1100 1101 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1102 public Builder addRepeatedField( 1103 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1104 return super.addRepeatedField(field, value); 1105 } 1106 1107 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1108 public Builder mergeFrom(com.google.protobuf.Message other) { 1109 if (other instanceof com.google.devtools.cloudtrace.v1.TraceSpan) { 1110 return mergeFrom((com.google.devtools.cloudtrace.v1.TraceSpan) other); 1111 } else { 1112 super.mergeFrom(other); 1113 return this; 1114 } 1115 } 1116 mergeFrom(com.google.devtools.cloudtrace.v1.TraceSpan other)1117 public Builder mergeFrom(com.google.devtools.cloudtrace.v1.TraceSpan other) { 1118 if (other == com.google.devtools.cloudtrace.v1.TraceSpan.getDefaultInstance()) return this; 1119 if (other.getSpanId() != 0L) { 1120 setSpanId(other.getSpanId()); 1121 } 1122 if (other.kind_ != 0) { 1123 setKindValue(other.getKindValue()); 1124 } 1125 if (!other.getName().isEmpty()) { 1126 name_ = other.name_; 1127 bitField0_ |= 0x00000004; 1128 onChanged(); 1129 } 1130 if (other.hasStartTime()) { 1131 mergeStartTime(other.getStartTime()); 1132 } 1133 if (other.hasEndTime()) { 1134 mergeEndTime(other.getEndTime()); 1135 } 1136 if (other.getParentSpanId() != 0L) { 1137 setParentSpanId(other.getParentSpanId()); 1138 } 1139 internalGetMutableLabels().mergeFrom(other.internalGetLabels()); 1140 bitField0_ |= 0x00000040; 1141 this.mergeUnknownFields(other.getUnknownFields()); 1142 onChanged(); 1143 return this; 1144 } 1145 1146 @java.lang.Override isInitialized()1147 public final boolean isInitialized() { 1148 return true; 1149 } 1150 1151 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1152 public Builder mergeFrom( 1153 com.google.protobuf.CodedInputStream input, 1154 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1155 throws java.io.IOException { 1156 if (extensionRegistry == null) { 1157 throw new java.lang.NullPointerException(); 1158 } 1159 try { 1160 boolean done = false; 1161 while (!done) { 1162 int tag = input.readTag(); 1163 switch (tag) { 1164 case 0: 1165 done = true; 1166 break; 1167 case 9: 1168 { 1169 spanId_ = input.readFixed64(); 1170 bitField0_ |= 0x00000001; 1171 break; 1172 } // case 9 1173 case 16: 1174 { 1175 kind_ = input.readEnum(); 1176 bitField0_ |= 0x00000002; 1177 break; 1178 } // case 16 1179 case 26: 1180 { 1181 name_ = input.readStringRequireUtf8(); 1182 bitField0_ |= 0x00000004; 1183 break; 1184 } // case 26 1185 case 34: 1186 { 1187 input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); 1188 bitField0_ |= 0x00000008; 1189 break; 1190 } // case 34 1191 case 42: 1192 { 1193 input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); 1194 bitField0_ |= 0x00000010; 1195 break; 1196 } // case 42 1197 case 49: 1198 { 1199 parentSpanId_ = input.readFixed64(); 1200 bitField0_ |= 0x00000020; 1201 break; 1202 } // case 49 1203 case 58: 1204 { 1205 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 1206 input.readMessage( 1207 LabelsDefaultEntryHolder.defaultEntry.getParserForType(), 1208 extensionRegistry); 1209 internalGetMutableLabels() 1210 .getMutableMap() 1211 .put(labels__.getKey(), labels__.getValue()); 1212 bitField0_ |= 0x00000040; 1213 break; 1214 } // case 58 1215 default: 1216 { 1217 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1218 done = true; // was an endgroup tag 1219 } 1220 break; 1221 } // default: 1222 } // switch (tag) 1223 } // while (!done) 1224 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1225 throw e.unwrapIOException(); 1226 } finally { 1227 onChanged(); 1228 } // finally 1229 return this; 1230 } 1231 1232 private int bitField0_; 1233 1234 private long spanId_; 1235 /** 1236 * 1237 * 1238 * <pre> 1239 * Identifier for the span. Must be a 64-bit integer other than 0 and 1240 * unique within a trace. For example, `2205310701640571284`. 1241 * </pre> 1242 * 1243 * <code>fixed64 span_id = 1;</code> 1244 * 1245 * @return The spanId. 1246 */ 1247 @java.lang.Override getSpanId()1248 public long getSpanId() { 1249 return spanId_; 1250 } 1251 /** 1252 * 1253 * 1254 * <pre> 1255 * Identifier for the span. Must be a 64-bit integer other than 0 and 1256 * unique within a trace. For example, `2205310701640571284`. 1257 * </pre> 1258 * 1259 * <code>fixed64 span_id = 1;</code> 1260 * 1261 * @param value The spanId to set. 1262 * @return This builder for chaining. 1263 */ setSpanId(long value)1264 public Builder setSpanId(long value) { 1265 1266 spanId_ = value; 1267 bitField0_ |= 0x00000001; 1268 onChanged(); 1269 return this; 1270 } 1271 /** 1272 * 1273 * 1274 * <pre> 1275 * Identifier for the span. Must be a 64-bit integer other than 0 and 1276 * unique within a trace. For example, `2205310701640571284`. 1277 * </pre> 1278 * 1279 * <code>fixed64 span_id = 1;</code> 1280 * 1281 * @return This builder for chaining. 1282 */ clearSpanId()1283 public Builder clearSpanId() { 1284 bitField0_ = (bitField0_ & ~0x00000001); 1285 spanId_ = 0L; 1286 onChanged(); 1287 return this; 1288 } 1289 1290 private int kind_ = 0; 1291 /** 1292 * 1293 * 1294 * <pre> 1295 * Distinguishes between spans generated in a particular context. For example, 1296 * two spans with the same name may be distinguished using `RPC_CLIENT` 1297 * and `RPC_SERVER` to identify queueing latency associated with the span. 1298 * </pre> 1299 * 1300 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 1301 * 1302 * @return The enum numeric value on the wire for kind. 1303 */ 1304 @java.lang.Override getKindValue()1305 public int getKindValue() { 1306 return kind_; 1307 } 1308 /** 1309 * 1310 * 1311 * <pre> 1312 * Distinguishes between spans generated in a particular context. For example, 1313 * two spans with the same name may be distinguished using `RPC_CLIENT` 1314 * and `RPC_SERVER` to identify queueing latency associated with the span. 1315 * </pre> 1316 * 1317 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 1318 * 1319 * @param value The enum numeric value on the wire for kind to set. 1320 * @return This builder for chaining. 1321 */ setKindValue(int value)1322 public Builder setKindValue(int value) { 1323 kind_ = value; 1324 bitField0_ |= 0x00000002; 1325 onChanged(); 1326 return this; 1327 } 1328 /** 1329 * 1330 * 1331 * <pre> 1332 * Distinguishes between spans generated in a particular context. For example, 1333 * two spans with the same name may be distinguished using `RPC_CLIENT` 1334 * and `RPC_SERVER` to identify queueing latency associated with the span. 1335 * </pre> 1336 * 1337 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 1338 * 1339 * @return The kind. 1340 */ 1341 @java.lang.Override getKind()1342 public com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind getKind() { 1343 com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind result = 1344 com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.forNumber(kind_); 1345 return result == null 1346 ? com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.UNRECOGNIZED 1347 : result; 1348 } 1349 /** 1350 * 1351 * 1352 * <pre> 1353 * Distinguishes between spans generated in a particular context. For example, 1354 * two spans with the same name may be distinguished using `RPC_CLIENT` 1355 * and `RPC_SERVER` to identify queueing latency associated with the span. 1356 * </pre> 1357 * 1358 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 1359 * 1360 * @param value The kind to set. 1361 * @return This builder for chaining. 1362 */ setKind(com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind value)1363 public Builder setKind(com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind value) { 1364 if (value == null) { 1365 throw new NullPointerException(); 1366 } 1367 bitField0_ |= 0x00000002; 1368 kind_ = value.getNumber(); 1369 onChanged(); 1370 return this; 1371 } 1372 /** 1373 * 1374 * 1375 * <pre> 1376 * Distinguishes between spans generated in a particular context. For example, 1377 * two spans with the same name may be distinguished using `RPC_CLIENT` 1378 * and `RPC_SERVER` to identify queueing latency associated with the span. 1379 * </pre> 1380 * 1381 * <code>.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;</code> 1382 * 1383 * @return This builder for chaining. 1384 */ clearKind()1385 public Builder clearKind() { 1386 bitField0_ = (bitField0_ & ~0x00000002); 1387 kind_ = 0; 1388 onChanged(); 1389 return this; 1390 } 1391 1392 private java.lang.Object name_ = ""; 1393 /** 1394 * 1395 * 1396 * <pre> 1397 * Name of the span. Must be less than 128 bytes. The span name is sanitized 1398 * and displayed in the Stackdriver Trace tool in the 1399 * Google Cloud Platform Console. 1400 * The name may be a method name or some other per-call site name. 1401 * For the same executable and the same call point, a best practice is 1402 * to use a consistent name, which makes it easier to correlate 1403 * cross-trace spans. 1404 * </pre> 1405 * 1406 * <code>string name = 3;</code> 1407 * 1408 * @return The name. 1409 */ getName()1410 public java.lang.String getName() { 1411 java.lang.Object ref = name_; 1412 if (!(ref instanceof java.lang.String)) { 1413 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1414 java.lang.String s = bs.toStringUtf8(); 1415 name_ = s; 1416 return s; 1417 } else { 1418 return (java.lang.String) ref; 1419 } 1420 } 1421 /** 1422 * 1423 * 1424 * <pre> 1425 * Name of the span. Must be less than 128 bytes. The span name is sanitized 1426 * and displayed in the Stackdriver Trace tool in the 1427 * Google Cloud Platform Console. 1428 * The name may be a method name or some other per-call site name. 1429 * For the same executable and the same call point, a best practice is 1430 * to use a consistent name, which makes it easier to correlate 1431 * cross-trace spans. 1432 * </pre> 1433 * 1434 * <code>string name = 3;</code> 1435 * 1436 * @return The bytes for name. 1437 */ getNameBytes()1438 public com.google.protobuf.ByteString getNameBytes() { 1439 java.lang.Object ref = name_; 1440 if (ref instanceof String) { 1441 com.google.protobuf.ByteString b = 1442 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1443 name_ = b; 1444 return b; 1445 } else { 1446 return (com.google.protobuf.ByteString) ref; 1447 } 1448 } 1449 /** 1450 * 1451 * 1452 * <pre> 1453 * Name of the span. Must be less than 128 bytes. The span name is sanitized 1454 * and displayed in the Stackdriver Trace tool in the 1455 * Google Cloud Platform Console. 1456 * The name may be a method name or some other per-call site name. 1457 * For the same executable and the same call point, a best practice is 1458 * to use a consistent name, which makes it easier to correlate 1459 * cross-trace spans. 1460 * </pre> 1461 * 1462 * <code>string name = 3;</code> 1463 * 1464 * @param value The name to set. 1465 * @return This builder for chaining. 1466 */ setName(java.lang.String value)1467 public Builder setName(java.lang.String value) { 1468 if (value == null) { 1469 throw new NullPointerException(); 1470 } 1471 name_ = value; 1472 bitField0_ |= 0x00000004; 1473 onChanged(); 1474 return this; 1475 } 1476 /** 1477 * 1478 * 1479 * <pre> 1480 * Name of the span. Must be less than 128 bytes. The span name is sanitized 1481 * and displayed in the Stackdriver Trace tool in the 1482 * Google Cloud Platform Console. 1483 * The name may be a method name or some other per-call site name. 1484 * For the same executable and the same call point, a best practice is 1485 * to use a consistent name, which makes it easier to correlate 1486 * cross-trace spans. 1487 * </pre> 1488 * 1489 * <code>string name = 3;</code> 1490 * 1491 * @return This builder for chaining. 1492 */ clearName()1493 public Builder clearName() { 1494 name_ = getDefaultInstance().getName(); 1495 bitField0_ = (bitField0_ & ~0x00000004); 1496 onChanged(); 1497 return this; 1498 } 1499 /** 1500 * 1501 * 1502 * <pre> 1503 * Name of the span. Must be less than 128 bytes. The span name is sanitized 1504 * and displayed in the Stackdriver Trace tool in the 1505 * Google Cloud Platform Console. 1506 * The name may be a method name or some other per-call site name. 1507 * For the same executable and the same call point, a best practice is 1508 * to use a consistent name, which makes it easier to correlate 1509 * cross-trace spans. 1510 * </pre> 1511 * 1512 * <code>string name = 3;</code> 1513 * 1514 * @param value The bytes for name to set. 1515 * @return This builder for chaining. 1516 */ setNameBytes(com.google.protobuf.ByteString value)1517 public Builder setNameBytes(com.google.protobuf.ByteString value) { 1518 if (value == null) { 1519 throw new NullPointerException(); 1520 } 1521 checkByteStringIsUtf8(value); 1522 name_ = value; 1523 bitField0_ |= 0x00000004; 1524 onChanged(); 1525 return this; 1526 } 1527 1528 private com.google.protobuf.Timestamp startTime_; 1529 private com.google.protobuf.SingleFieldBuilderV3< 1530 com.google.protobuf.Timestamp, 1531 com.google.protobuf.Timestamp.Builder, 1532 com.google.protobuf.TimestampOrBuilder> 1533 startTimeBuilder_; 1534 /** 1535 * 1536 * 1537 * <pre> 1538 * Start time of the span in nanoseconds from the UNIX epoch. 1539 * </pre> 1540 * 1541 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1542 * 1543 * @return Whether the startTime field is set. 1544 */ hasStartTime()1545 public boolean hasStartTime() { 1546 return ((bitField0_ & 0x00000008) != 0); 1547 } 1548 /** 1549 * 1550 * 1551 * <pre> 1552 * Start time of the span in nanoseconds from the UNIX epoch. 1553 * </pre> 1554 * 1555 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1556 * 1557 * @return The startTime. 1558 */ getStartTime()1559 public com.google.protobuf.Timestamp getStartTime() { 1560 if (startTimeBuilder_ == null) { 1561 return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; 1562 } else { 1563 return startTimeBuilder_.getMessage(); 1564 } 1565 } 1566 /** 1567 * 1568 * 1569 * <pre> 1570 * Start time of the span in nanoseconds from the UNIX epoch. 1571 * </pre> 1572 * 1573 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1574 */ setStartTime(com.google.protobuf.Timestamp value)1575 public Builder setStartTime(com.google.protobuf.Timestamp value) { 1576 if (startTimeBuilder_ == null) { 1577 if (value == null) { 1578 throw new NullPointerException(); 1579 } 1580 startTime_ = value; 1581 } else { 1582 startTimeBuilder_.setMessage(value); 1583 } 1584 bitField0_ |= 0x00000008; 1585 onChanged(); 1586 return this; 1587 } 1588 /** 1589 * 1590 * 1591 * <pre> 1592 * Start time of the span in nanoseconds from the UNIX epoch. 1593 * </pre> 1594 * 1595 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1596 */ setStartTime(com.google.protobuf.Timestamp.Builder builderForValue)1597 public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { 1598 if (startTimeBuilder_ == null) { 1599 startTime_ = builderForValue.build(); 1600 } else { 1601 startTimeBuilder_.setMessage(builderForValue.build()); 1602 } 1603 bitField0_ |= 0x00000008; 1604 onChanged(); 1605 return this; 1606 } 1607 /** 1608 * 1609 * 1610 * <pre> 1611 * Start time of the span in nanoseconds from the UNIX epoch. 1612 * </pre> 1613 * 1614 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1615 */ mergeStartTime(com.google.protobuf.Timestamp value)1616 public Builder mergeStartTime(com.google.protobuf.Timestamp value) { 1617 if (startTimeBuilder_ == null) { 1618 if (((bitField0_ & 0x00000008) != 0) 1619 && startTime_ != null 1620 && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 1621 getStartTimeBuilder().mergeFrom(value); 1622 } else { 1623 startTime_ = value; 1624 } 1625 } else { 1626 startTimeBuilder_.mergeFrom(value); 1627 } 1628 bitField0_ |= 0x00000008; 1629 onChanged(); 1630 return this; 1631 } 1632 /** 1633 * 1634 * 1635 * <pre> 1636 * Start time of the span in nanoseconds from the UNIX epoch. 1637 * </pre> 1638 * 1639 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1640 */ clearStartTime()1641 public Builder clearStartTime() { 1642 bitField0_ = (bitField0_ & ~0x00000008); 1643 startTime_ = null; 1644 if (startTimeBuilder_ != null) { 1645 startTimeBuilder_.dispose(); 1646 startTimeBuilder_ = null; 1647 } 1648 onChanged(); 1649 return this; 1650 } 1651 /** 1652 * 1653 * 1654 * <pre> 1655 * Start time of the span in nanoseconds from the UNIX epoch. 1656 * </pre> 1657 * 1658 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1659 */ getStartTimeBuilder()1660 public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { 1661 bitField0_ |= 0x00000008; 1662 onChanged(); 1663 return getStartTimeFieldBuilder().getBuilder(); 1664 } 1665 /** 1666 * 1667 * 1668 * <pre> 1669 * Start time of the span in nanoseconds from the UNIX epoch. 1670 * </pre> 1671 * 1672 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1673 */ getStartTimeOrBuilder()1674 public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { 1675 if (startTimeBuilder_ != null) { 1676 return startTimeBuilder_.getMessageOrBuilder(); 1677 } else { 1678 return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; 1679 } 1680 } 1681 /** 1682 * 1683 * 1684 * <pre> 1685 * Start time of the span in nanoseconds from the UNIX epoch. 1686 * </pre> 1687 * 1688 * <code>.google.protobuf.Timestamp start_time = 4;</code> 1689 */ 1690 private com.google.protobuf.SingleFieldBuilderV3< 1691 com.google.protobuf.Timestamp, 1692 com.google.protobuf.Timestamp.Builder, 1693 com.google.protobuf.TimestampOrBuilder> getStartTimeFieldBuilder()1694 getStartTimeFieldBuilder() { 1695 if (startTimeBuilder_ == null) { 1696 startTimeBuilder_ = 1697 new com.google.protobuf.SingleFieldBuilderV3< 1698 com.google.protobuf.Timestamp, 1699 com.google.protobuf.Timestamp.Builder, 1700 com.google.protobuf.TimestampOrBuilder>( 1701 getStartTime(), getParentForChildren(), isClean()); 1702 startTime_ = null; 1703 } 1704 return startTimeBuilder_; 1705 } 1706 1707 private com.google.protobuf.Timestamp endTime_; 1708 private com.google.protobuf.SingleFieldBuilderV3< 1709 com.google.protobuf.Timestamp, 1710 com.google.protobuf.Timestamp.Builder, 1711 com.google.protobuf.TimestampOrBuilder> 1712 endTimeBuilder_; 1713 /** 1714 * 1715 * 1716 * <pre> 1717 * End time of the span in nanoseconds from the UNIX epoch. 1718 * </pre> 1719 * 1720 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1721 * 1722 * @return Whether the endTime field is set. 1723 */ hasEndTime()1724 public boolean hasEndTime() { 1725 return ((bitField0_ & 0x00000010) != 0); 1726 } 1727 /** 1728 * 1729 * 1730 * <pre> 1731 * End time of the span in nanoseconds from the UNIX epoch. 1732 * </pre> 1733 * 1734 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1735 * 1736 * @return The endTime. 1737 */ getEndTime()1738 public com.google.protobuf.Timestamp getEndTime() { 1739 if (endTimeBuilder_ == null) { 1740 return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; 1741 } else { 1742 return endTimeBuilder_.getMessage(); 1743 } 1744 } 1745 /** 1746 * 1747 * 1748 * <pre> 1749 * End time of the span in nanoseconds from the UNIX epoch. 1750 * </pre> 1751 * 1752 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1753 */ setEndTime(com.google.protobuf.Timestamp value)1754 public Builder setEndTime(com.google.protobuf.Timestamp value) { 1755 if (endTimeBuilder_ == null) { 1756 if (value == null) { 1757 throw new NullPointerException(); 1758 } 1759 endTime_ = value; 1760 } else { 1761 endTimeBuilder_.setMessage(value); 1762 } 1763 bitField0_ |= 0x00000010; 1764 onChanged(); 1765 return this; 1766 } 1767 /** 1768 * 1769 * 1770 * <pre> 1771 * End time of the span in nanoseconds from the UNIX epoch. 1772 * </pre> 1773 * 1774 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1775 */ setEndTime(com.google.protobuf.Timestamp.Builder builderForValue)1776 public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { 1777 if (endTimeBuilder_ == null) { 1778 endTime_ = builderForValue.build(); 1779 } else { 1780 endTimeBuilder_.setMessage(builderForValue.build()); 1781 } 1782 bitField0_ |= 0x00000010; 1783 onChanged(); 1784 return this; 1785 } 1786 /** 1787 * 1788 * 1789 * <pre> 1790 * End time of the span in nanoseconds from the UNIX epoch. 1791 * </pre> 1792 * 1793 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1794 */ mergeEndTime(com.google.protobuf.Timestamp value)1795 public Builder mergeEndTime(com.google.protobuf.Timestamp value) { 1796 if (endTimeBuilder_ == null) { 1797 if (((bitField0_ & 0x00000010) != 0) 1798 && endTime_ != null 1799 && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 1800 getEndTimeBuilder().mergeFrom(value); 1801 } else { 1802 endTime_ = value; 1803 } 1804 } else { 1805 endTimeBuilder_.mergeFrom(value); 1806 } 1807 bitField0_ |= 0x00000010; 1808 onChanged(); 1809 return this; 1810 } 1811 /** 1812 * 1813 * 1814 * <pre> 1815 * End time of the span in nanoseconds from the UNIX epoch. 1816 * </pre> 1817 * 1818 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1819 */ clearEndTime()1820 public Builder clearEndTime() { 1821 bitField0_ = (bitField0_ & ~0x00000010); 1822 endTime_ = null; 1823 if (endTimeBuilder_ != null) { 1824 endTimeBuilder_.dispose(); 1825 endTimeBuilder_ = null; 1826 } 1827 onChanged(); 1828 return this; 1829 } 1830 /** 1831 * 1832 * 1833 * <pre> 1834 * End time of the span in nanoseconds from the UNIX epoch. 1835 * </pre> 1836 * 1837 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1838 */ getEndTimeBuilder()1839 public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { 1840 bitField0_ |= 0x00000010; 1841 onChanged(); 1842 return getEndTimeFieldBuilder().getBuilder(); 1843 } 1844 /** 1845 * 1846 * 1847 * <pre> 1848 * End time of the span in nanoseconds from the UNIX epoch. 1849 * </pre> 1850 * 1851 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1852 */ getEndTimeOrBuilder()1853 public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { 1854 if (endTimeBuilder_ != null) { 1855 return endTimeBuilder_.getMessageOrBuilder(); 1856 } else { 1857 return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; 1858 } 1859 } 1860 /** 1861 * 1862 * 1863 * <pre> 1864 * End time of the span in nanoseconds from the UNIX epoch. 1865 * </pre> 1866 * 1867 * <code>.google.protobuf.Timestamp end_time = 5;</code> 1868 */ 1869 private com.google.protobuf.SingleFieldBuilderV3< 1870 com.google.protobuf.Timestamp, 1871 com.google.protobuf.Timestamp.Builder, 1872 com.google.protobuf.TimestampOrBuilder> getEndTimeFieldBuilder()1873 getEndTimeFieldBuilder() { 1874 if (endTimeBuilder_ == null) { 1875 endTimeBuilder_ = 1876 new com.google.protobuf.SingleFieldBuilderV3< 1877 com.google.protobuf.Timestamp, 1878 com.google.protobuf.Timestamp.Builder, 1879 com.google.protobuf.TimestampOrBuilder>( 1880 getEndTime(), getParentForChildren(), isClean()); 1881 endTime_ = null; 1882 } 1883 return endTimeBuilder_; 1884 } 1885 1886 private long parentSpanId_; 1887 /** 1888 * 1889 * 1890 * <pre> 1891 * Optional. ID of the parent span, if any. 1892 * </pre> 1893 * 1894 * <code>fixed64 parent_span_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code> 1895 * 1896 * @return The parentSpanId. 1897 */ 1898 @java.lang.Override getParentSpanId()1899 public long getParentSpanId() { 1900 return parentSpanId_; 1901 } 1902 /** 1903 * 1904 * 1905 * <pre> 1906 * Optional. ID of the parent span, if any. 1907 * </pre> 1908 * 1909 * <code>fixed64 parent_span_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code> 1910 * 1911 * @param value The parentSpanId to set. 1912 * @return This builder for chaining. 1913 */ setParentSpanId(long value)1914 public Builder setParentSpanId(long value) { 1915 1916 parentSpanId_ = value; 1917 bitField0_ |= 0x00000020; 1918 onChanged(); 1919 return this; 1920 } 1921 /** 1922 * 1923 * 1924 * <pre> 1925 * Optional. ID of the parent span, if any. 1926 * </pre> 1927 * 1928 * <code>fixed64 parent_span_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code> 1929 * 1930 * @return This builder for chaining. 1931 */ clearParentSpanId()1932 public Builder clearParentSpanId() { 1933 bitField0_ = (bitField0_ & ~0x00000020); 1934 parentSpanId_ = 0L; 1935 onChanged(); 1936 return this; 1937 } 1938 1939 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 1940 internalGetLabels()1941 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 1942 if (labels_ == null) { 1943 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 1944 } 1945 return labels_; 1946 } 1947 1948 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableLabels()1949 internalGetMutableLabels() { 1950 if (labels_ == null) { 1951 labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); 1952 } 1953 if (!labels_.isMutable()) { 1954 labels_ = labels_.copy(); 1955 } 1956 bitField0_ |= 0x00000040; 1957 onChanged(); 1958 return labels_; 1959 } 1960 getLabelsCount()1961 public int getLabelsCount() { 1962 return internalGetLabels().getMap().size(); 1963 } 1964 /** 1965 * 1966 * 1967 * <pre> 1968 * Collection of labels associated with the span. Label keys must be less than 1969 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 1970 * `/stacktrace` values). 1971 * Some predefined label keys exist, or you may create your own. When creating 1972 * your own, we recommend the following formats: 1973 * * `/category/product/key` for agents of well-known products (e.g. 1974 * `/db/mongodb/read_size`). 1975 * * `short_host/path/key` for domain-specific keys (e.g. 1976 * `foo.com/myproduct/bar`) 1977 * Predefined labels include: 1978 * * `/agent` 1979 * * `/component` 1980 * * `/error/message` 1981 * * `/error/name` 1982 * * `/http/client_city` 1983 * * `/http/client_country` 1984 * * `/http/client_protocol` 1985 * * `/http/client_region` 1986 * * `/http/host` 1987 * * `/http/method` 1988 * * `/http/path` 1989 * * `/http/redirected_url` 1990 * * `/http/request/size` 1991 * * `/http/response/size` 1992 * * `/http/route` 1993 * * `/http/status_code` 1994 * * `/http/url` 1995 * * `/http/user_agent` 1996 * * `/pid` 1997 * * `/stacktrace` 1998 * * `/tid` 1999 * </pre> 2000 * 2001 * <code>map<string, string> labels = 7;</code> 2002 */ 2003 @java.lang.Override containsLabels(java.lang.String key)2004 public boolean containsLabels(java.lang.String key) { 2005 if (key == null) { 2006 throw new NullPointerException("map key"); 2007 } 2008 return internalGetLabels().getMap().containsKey(key); 2009 } 2010 /** Use {@link #getLabelsMap()} instead. */ 2011 @java.lang.Override 2012 @java.lang.Deprecated getLabels()2013 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 2014 return getLabelsMap(); 2015 } 2016 /** 2017 * 2018 * 2019 * <pre> 2020 * Collection of labels associated with the span. Label keys must be less than 2021 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2022 * `/stacktrace` values). 2023 * Some predefined label keys exist, or you may create your own. When creating 2024 * your own, we recommend the following formats: 2025 * * `/category/product/key` for agents of well-known products (e.g. 2026 * `/db/mongodb/read_size`). 2027 * * `short_host/path/key` for domain-specific keys (e.g. 2028 * `foo.com/myproduct/bar`) 2029 * Predefined labels include: 2030 * * `/agent` 2031 * * `/component` 2032 * * `/error/message` 2033 * * `/error/name` 2034 * * `/http/client_city` 2035 * * `/http/client_country` 2036 * * `/http/client_protocol` 2037 * * `/http/client_region` 2038 * * `/http/host` 2039 * * `/http/method` 2040 * * `/http/path` 2041 * * `/http/redirected_url` 2042 * * `/http/request/size` 2043 * * `/http/response/size` 2044 * * `/http/route` 2045 * * `/http/status_code` 2046 * * `/http/url` 2047 * * `/http/user_agent` 2048 * * `/pid` 2049 * * `/stacktrace` 2050 * * `/tid` 2051 * </pre> 2052 * 2053 * <code>map<string, string> labels = 7;</code> 2054 */ 2055 @java.lang.Override getLabelsMap()2056 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 2057 return internalGetLabels().getMap(); 2058 } 2059 /** 2060 * 2061 * 2062 * <pre> 2063 * Collection of labels associated with the span. Label keys must be less than 2064 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2065 * `/stacktrace` values). 2066 * Some predefined label keys exist, or you may create your own. When creating 2067 * your own, we recommend the following formats: 2068 * * `/category/product/key` for agents of well-known products (e.g. 2069 * `/db/mongodb/read_size`). 2070 * * `short_host/path/key` for domain-specific keys (e.g. 2071 * `foo.com/myproduct/bar`) 2072 * Predefined labels include: 2073 * * `/agent` 2074 * * `/component` 2075 * * `/error/message` 2076 * * `/error/name` 2077 * * `/http/client_city` 2078 * * `/http/client_country` 2079 * * `/http/client_protocol` 2080 * * `/http/client_region` 2081 * * `/http/host` 2082 * * `/http/method` 2083 * * `/http/path` 2084 * * `/http/redirected_url` 2085 * * `/http/request/size` 2086 * * `/http/response/size` 2087 * * `/http/route` 2088 * * `/http/status_code` 2089 * * `/http/url` 2090 * * `/http/user_agent` 2091 * * `/pid` 2092 * * `/stacktrace` 2093 * * `/tid` 2094 * </pre> 2095 * 2096 * <code>map<string, string> labels = 7;</code> 2097 */ 2098 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)2099 public /* nullable */ java.lang.String getLabelsOrDefault( 2100 java.lang.String key, 2101 /* nullable */ 2102 java.lang.String defaultValue) { 2103 if (key == null) { 2104 throw new NullPointerException("map key"); 2105 } 2106 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 2107 return map.containsKey(key) ? map.get(key) : defaultValue; 2108 } 2109 /** 2110 * 2111 * 2112 * <pre> 2113 * Collection of labels associated with the span. Label keys must be less than 2114 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2115 * `/stacktrace` values). 2116 * Some predefined label keys exist, or you may create your own. When creating 2117 * your own, we recommend the following formats: 2118 * * `/category/product/key` for agents of well-known products (e.g. 2119 * `/db/mongodb/read_size`). 2120 * * `short_host/path/key` for domain-specific keys (e.g. 2121 * `foo.com/myproduct/bar`) 2122 * Predefined labels include: 2123 * * `/agent` 2124 * * `/component` 2125 * * `/error/message` 2126 * * `/error/name` 2127 * * `/http/client_city` 2128 * * `/http/client_country` 2129 * * `/http/client_protocol` 2130 * * `/http/client_region` 2131 * * `/http/host` 2132 * * `/http/method` 2133 * * `/http/path` 2134 * * `/http/redirected_url` 2135 * * `/http/request/size` 2136 * * `/http/response/size` 2137 * * `/http/route` 2138 * * `/http/status_code` 2139 * * `/http/url` 2140 * * `/http/user_agent` 2141 * * `/pid` 2142 * * `/stacktrace` 2143 * * `/tid` 2144 * </pre> 2145 * 2146 * <code>map<string, string> labels = 7;</code> 2147 */ 2148 @java.lang.Override getLabelsOrThrow(java.lang.String key)2149 public java.lang.String getLabelsOrThrow(java.lang.String key) { 2150 if (key == null) { 2151 throw new NullPointerException("map key"); 2152 } 2153 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 2154 if (!map.containsKey(key)) { 2155 throw new java.lang.IllegalArgumentException(); 2156 } 2157 return map.get(key); 2158 } 2159 clearLabels()2160 public Builder clearLabels() { 2161 bitField0_ = (bitField0_ & ~0x00000040); 2162 internalGetMutableLabels().getMutableMap().clear(); 2163 return this; 2164 } 2165 /** 2166 * 2167 * 2168 * <pre> 2169 * Collection of labels associated with the span. Label keys must be less than 2170 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2171 * `/stacktrace` values). 2172 * Some predefined label keys exist, or you may create your own. When creating 2173 * your own, we recommend the following formats: 2174 * * `/category/product/key` for agents of well-known products (e.g. 2175 * `/db/mongodb/read_size`). 2176 * * `short_host/path/key` for domain-specific keys (e.g. 2177 * `foo.com/myproduct/bar`) 2178 * Predefined labels include: 2179 * * `/agent` 2180 * * `/component` 2181 * * `/error/message` 2182 * * `/error/name` 2183 * * `/http/client_city` 2184 * * `/http/client_country` 2185 * * `/http/client_protocol` 2186 * * `/http/client_region` 2187 * * `/http/host` 2188 * * `/http/method` 2189 * * `/http/path` 2190 * * `/http/redirected_url` 2191 * * `/http/request/size` 2192 * * `/http/response/size` 2193 * * `/http/route` 2194 * * `/http/status_code` 2195 * * `/http/url` 2196 * * `/http/user_agent` 2197 * * `/pid` 2198 * * `/stacktrace` 2199 * * `/tid` 2200 * </pre> 2201 * 2202 * <code>map<string, string> labels = 7;</code> 2203 */ removeLabels(java.lang.String key)2204 public Builder removeLabels(java.lang.String key) { 2205 if (key == null) { 2206 throw new NullPointerException("map key"); 2207 } 2208 internalGetMutableLabels().getMutableMap().remove(key); 2209 return this; 2210 } 2211 /** Use alternate mutation accessors instead. */ 2212 @java.lang.Deprecated getMutableLabels()2213 public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() { 2214 bitField0_ |= 0x00000040; 2215 return internalGetMutableLabels().getMutableMap(); 2216 } 2217 /** 2218 * 2219 * 2220 * <pre> 2221 * Collection of labels associated with the span. Label keys must be less than 2222 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2223 * `/stacktrace` values). 2224 * Some predefined label keys exist, or you may create your own. When creating 2225 * your own, we recommend the following formats: 2226 * * `/category/product/key` for agents of well-known products (e.g. 2227 * `/db/mongodb/read_size`). 2228 * * `short_host/path/key` for domain-specific keys (e.g. 2229 * `foo.com/myproduct/bar`) 2230 * Predefined labels include: 2231 * * `/agent` 2232 * * `/component` 2233 * * `/error/message` 2234 * * `/error/name` 2235 * * `/http/client_city` 2236 * * `/http/client_country` 2237 * * `/http/client_protocol` 2238 * * `/http/client_region` 2239 * * `/http/host` 2240 * * `/http/method` 2241 * * `/http/path` 2242 * * `/http/redirected_url` 2243 * * `/http/request/size` 2244 * * `/http/response/size` 2245 * * `/http/route` 2246 * * `/http/status_code` 2247 * * `/http/url` 2248 * * `/http/user_agent` 2249 * * `/pid` 2250 * * `/stacktrace` 2251 * * `/tid` 2252 * </pre> 2253 * 2254 * <code>map<string, string> labels = 7;</code> 2255 */ putLabels(java.lang.String key, java.lang.String value)2256 public Builder putLabels(java.lang.String key, java.lang.String value) { 2257 if (key == null) { 2258 throw new NullPointerException("map key"); 2259 } 2260 if (value == null) { 2261 throw new NullPointerException("map value"); 2262 } 2263 internalGetMutableLabels().getMutableMap().put(key, value); 2264 bitField0_ |= 0x00000040; 2265 return this; 2266 } 2267 /** 2268 * 2269 * 2270 * <pre> 2271 * Collection of labels associated with the span. Label keys must be less than 2272 * 128 bytes. Label values must be less than 16 kilobytes (10MB for 2273 * `/stacktrace` values). 2274 * Some predefined label keys exist, or you may create your own. When creating 2275 * your own, we recommend the following formats: 2276 * * `/category/product/key` for agents of well-known products (e.g. 2277 * `/db/mongodb/read_size`). 2278 * * `short_host/path/key` for domain-specific keys (e.g. 2279 * `foo.com/myproduct/bar`) 2280 * Predefined labels include: 2281 * * `/agent` 2282 * * `/component` 2283 * * `/error/message` 2284 * * `/error/name` 2285 * * `/http/client_city` 2286 * * `/http/client_country` 2287 * * `/http/client_protocol` 2288 * * `/http/client_region` 2289 * * `/http/host` 2290 * * `/http/method` 2291 * * `/http/path` 2292 * * `/http/redirected_url` 2293 * * `/http/request/size` 2294 * * `/http/response/size` 2295 * * `/http/route` 2296 * * `/http/status_code` 2297 * * `/http/url` 2298 * * `/http/user_agent` 2299 * * `/pid` 2300 * * `/stacktrace` 2301 * * `/tid` 2302 * </pre> 2303 * 2304 * <code>map<string, string> labels = 7;</code> 2305 */ putAllLabels(java.util.Map<java.lang.String, java.lang.String> values)2306 public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) { 2307 internalGetMutableLabels().getMutableMap().putAll(values); 2308 bitField0_ |= 0x00000040; 2309 return this; 2310 } 2311 2312 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2313 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2314 return super.setUnknownFields(unknownFields); 2315 } 2316 2317 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2318 public final Builder mergeUnknownFields( 2319 final com.google.protobuf.UnknownFieldSet unknownFields) { 2320 return super.mergeUnknownFields(unknownFields); 2321 } 2322 2323 // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v1.TraceSpan) 2324 } 2325 2326 // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.TraceSpan) 2327 private static final com.google.devtools.cloudtrace.v1.TraceSpan DEFAULT_INSTANCE; 2328 2329 static { 2330 DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v1.TraceSpan(); 2331 } 2332 getDefaultInstance()2333 public static com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstance() { 2334 return DEFAULT_INSTANCE; 2335 } 2336 2337 private static final com.google.protobuf.Parser<TraceSpan> PARSER = 2338 new com.google.protobuf.AbstractParser<TraceSpan>() { 2339 @java.lang.Override 2340 public TraceSpan parsePartialFrom( 2341 com.google.protobuf.CodedInputStream input, 2342 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2343 throws com.google.protobuf.InvalidProtocolBufferException { 2344 Builder builder = newBuilder(); 2345 try { 2346 builder.mergeFrom(input, extensionRegistry); 2347 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2348 throw e.setUnfinishedMessage(builder.buildPartial()); 2349 } catch (com.google.protobuf.UninitializedMessageException e) { 2350 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2351 } catch (java.io.IOException e) { 2352 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2353 .setUnfinishedMessage(builder.buildPartial()); 2354 } 2355 return builder.buildPartial(); 2356 } 2357 }; 2358 parser()2359 public static com.google.protobuf.Parser<TraceSpan> parser() { 2360 return PARSER; 2361 } 2362 2363 @java.lang.Override getParserForType()2364 public com.google.protobuf.Parser<TraceSpan> getParserForType() { 2365 return PARSER; 2366 } 2367 2368 @java.lang.Override getDefaultInstanceForType()2369 public com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstanceForType() { 2370 return DEFAULT_INSTANCE; 2371 } 2372 } 2373