text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/devtools/cloudtrace/v1/trace.proto

package com.google.devtools.cloudtrace.v1;

/**
 *

 * A span represents a single timed event within a trace. Spans can be nested
 * and form a trace tree. Often, a trace contains a root span that describes the
 * end-to-end latency of an operation and, optionally, one or more subspans for
 * its suboperations. Spans do not need to be contiguous. There may be gaps
 * between spans in a trace.
 *

 *
 * Protobuf type {@code google.devtools.cloudtrace.v1.TraceSpan}
 */
public  final class TraceSpan extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v1.TraceSpan)
    TraceSpanOrBuilder {
  // Use TraceSpan.newBuilder() to construct.
  private TraceSpan(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private TraceSpan() {
    spanId_ = 0L;
    kind_ = 0;
    name_ = "";
    parentSpanId_ = 0L;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private TraceSpan(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 9: {

            spanId_ = input.readFixed64();
            break;
          }
          case 16: {
            int rawValue = input.readEnum();

            kind_ = rawValue;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            name_ = s;
            break;
          }
          case 34: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (startTime_ != null) {
              subBuilder = startTime_.toBuilder();
            }
            startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(startTime_);
              startTime_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (endTime_ != null) {
              subBuilder = endTime_.toBuilder();
            }
            endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(endTime_);
              endTime_ = subBuilder.buildPartial();
            }

            break;
          }
          case 49: {

            parentSpanId_ = input.readFixed64();
            break;
          }
          case 58: {
            if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
              labels_ = com.google.protobuf.MapField.newMapField(
                  LabelsDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000040;
            }
            com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
            labels__ = input.readMessage(
                LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            labels_.getMutableMap().put(
                labels__.getKey(), labels__.getValue());
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 7:
        return internalGetLabels();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.devtools.cloudtrace.v1.TraceSpan.class, com.google.devtools.cloudtrace.v1.TraceSpan.Builder.class);
  }

  /**
   *

   * Type of span. Can be used to specify additional relationships between spans
   * in addition to a parent/child relationship.
   *

   *
   * Protobuf enum {@code google.devtools.cloudtrace.v1.TraceSpan.SpanKind}
   */
  public enum SpanKind
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *

     * Unspecified.
     *

     *
     * SPAN_KIND_UNSPECIFIED = 0;
     */
    SPAN_KIND_UNSPECIFIED(0),
    /**
     *

     * Indicates that the span covers server-side handling of an RPC or other
     * remote network request.
     *

     *
     * RPC_SERVER = 1;
     */
    RPC_SERVER(1),
    /**
     *

     * Indicates that the span covers the client-side wrapper around an RPC or
     * other remote request.
     *

     *
     * RPC_CLIENT = 2;
     */
    RPC_CLIENT(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *

     * Unspecified.
     *

     *
     * SPAN_KIND_UNSPECIFIED = 0;
     */
    public static final int SPAN_KIND_UNSPECIFIED_VALUE = 0;
    /**
     *

     * Indicates that the span covers server-side handling of an RPC or other
     * remote network request.
     *

     *
     * RPC_SERVER = 1;
     */
    public static final int RPC_SERVER_VALUE = 1;
    /**
     *

     * Indicates that the span covers the client-side wrapper around an RPC or
     * other remote request.
     *

     *
     * RPC_CLIENT = 2;
     */
    public static final int RPC_CLIENT_VALUE = 2;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static SpanKind valueOf(int value) {
      return forNumber(value);
    }

    public static SpanKind forNumber(int value) {
      switch (value) {
        case 0: return SPAN_KIND_UNSPECIFIED;
        case 1: return RPC_SERVER;
        case 2: return RPC_CLIENT;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<SpanKind>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        SpanKind> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<SpanKind>() {
            public SpanKind findValueByNumber(int number) {
              return SpanKind.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.google.devtools.cloudtrace.v1.TraceSpan.getDescriptor().getEnumTypes().get(0);
    }

    private static final SpanKind[] VALUES = values();

    public static SpanKind valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private SpanKind(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.devtools.cloudtrace.v1.TraceSpan.SpanKind)
  }

  private int bitField0_;
  public static final int SPAN_ID_FIELD_NUMBER = 1;
  private long spanId_;
  /**
   *

   * Identifier for the span. Must be a 64-bit integer other than 0 and
   * unique within a trace.
   *

   *
   * optional fixed64 span_id = 1;
   */
  public long getSpanId() {
    return spanId_;
  }

  public static final int KIND_FIELD_NUMBER = 2;
  private int kind_;
  /**
   *

   * Distinguishes between spans generated in a particular context. For example,
   * two spans with the same name may be distinguished using `RPC_CLIENT`
   * and `RPC_SERVER` to identify queueing latency associated with the span.
   *

   *
   * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
   */
  public int getKindValue() {
    return kind_;
  }
  /**
   *

   * Distinguishes between spans generated in a particular context. For example,
   * two spans with the same name may be distinguished using `RPC_CLIENT`
   * and `RPC_SERVER` to identify queueing latency associated with the span.
   *

   *
   * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
   */
  public com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind getKind() {
    com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind result = com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.valueOf(kind_);
    return result == null ? com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.UNRECOGNIZED : result;
  }

  public static final int NAME_FIELD_NUMBER = 3;
  private volatile java.lang.Object name_;
  /**
   *

   * Name of the trace. The trace name is sanitized and displayed in the
   * Stackdriver Trace tool in the Google Developers Console.
   * The name may be a method name or some other per-call site name.
   * For the same executable and the same call point, a best practice is
   * to use a consistent name, which makes it easier to correlate
   * cross-trace spans.
   *

   *
   * optional string name = 3;
   */
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *

   * Name of the trace. The trace name is sanitized and displayed in the
   * Stackdriver Trace tool in the Google Developers Console.
   * The name may be a method name or some other per-call site name.
   * For the same executable and the same call point, a best practice is
   * to use a consistent name, which makes it easier to correlate
   * cross-trace spans.
   *

   *
   * optional string name = 3;
   */
  public com.google.protobuf.ByteString
      getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int START_TIME_FIELD_NUMBER = 4;
  private com.google.protobuf.Timestamp startTime_;
  /**
   *

   * Start time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp start_time = 4;
   */
  public boolean hasStartTime() {
    return startTime_ != null;
  }
  /**
   *

   * Start time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp start_time = 4;
   */
  public com.google.protobuf.Timestamp getStartTime() {
    return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
  }
  /**
   *

   * Start time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp start_time = 4;
   */
  public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
    return getStartTime();
  }

  public static final int END_TIME_FIELD_NUMBER = 5;
  private com.google.protobuf.Timestamp endTime_;
  /**
   *

   * End time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp end_time = 5;
   */
  public boolean hasEndTime() {
    return endTime_ != null;
  }
  /**
   *

   * End time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp end_time = 5;
   */
  public com.google.protobuf.Timestamp getEndTime() {
    return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
  }
  /**
   *

   * End time of the span in nanoseconds from the UNIX epoch.
   *

   *
   * optional .google.protobuf.Timestamp end_time = 5;
   */
  public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
    return getEndTime();
  }

  public static final int PARENT_SPAN_ID_FIELD_NUMBER = 6;
  private long parentSpanId_;
  /**
   *

   * ID of the parent span, if any. Optional.
   *

   *
   * optional fixed64 parent_span_id = 6;
   */
  public long getParentSpanId() {
    return parentSpanId_;
  }

  public static final int LABELS_FIELD_NUMBER = 7;
  private static final class LabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, java.lang.String>newDefaultInstance(
                com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_LabelsEntry_descriptor,
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.String, java.lang.String> labels_;
  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
  internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *

   * Collection of labels associated with the span.
   *

   *
   * map<string, string> labels = 7;
   */

  public boolean containsLabels(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetLabels().getMap().containsKey(key);
  }
  /**
   * Use {@link #getLabelsMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *

   * Collection of labels associated with the span.
   *

   *
   * map<string, string> labels = 7;
   */

  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *

   * Collection of labels associated with the span.
   *

   *
   * map<string, string> labels = 7;
   */

  public java.lang.String getLabelsOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *

   * Collection of labels associated with the span.
   *

   *
   * map<string, string> labels = 7;
   */

  public java.lang.String getLabelsOrThrow(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (spanId_ != 0L) {
      output.writeFixed64(1, spanId_);
    }
    if (kind_ != com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.SPAN_KIND_UNSPECIFIED.getNumber()) {
      output.writeEnum(2, kind_);
    }
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);
    }
    if (startTime_ != null) {
      output.writeMessage(4, getStartTime());
    }
    if (endTime_ != null) {
      output.writeMessage(5, getEndTime());
    }
    if (parentSpanId_ != 0L) {
      output.writeFixed64(6, parentSpanId_);
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetLabels(),
        LabelsDefaultEntryHolder.defaultEntry,
        7);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (spanId_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeFixed64Size(1, spanId_);
    }
    if (kind_ != com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.SPAN_KIND_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(2, kind_);
    }
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_);
    }
    if (startTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getStartTime());
    }
    if (endTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getEndTime());
    }
    if (parentSpanId_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeFixed64Size(6, parentSpanId_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
         : internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
      labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(7, labels__);
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.devtools.cloudtrace.v1.TraceSpan)) {
      return super.equals(obj);
    }
    com.google.devtools.cloudtrace.v1.TraceSpan other = (com.google.devtools.cloudtrace.v1.TraceSpan) obj;

    boolean result = true;
    result = result && (getSpanId()
        == other.getSpanId());
    result = result && kind_ == other.kind_;
    result = result && getName()
        .equals(other.getName());
    result = result && (hasStartTime() == other.hasStartTime());
    if (hasStartTime()) {
      result = result && getStartTime()
          .equals(other.getStartTime());
    }
    result = result && (hasEndTime() == other.hasEndTime());
    if (hasEndTime()) {
      result = result && getEndTime()
          .equals(other.getEndTime());
    }
    result = result && (getParentSpanId()
        == other.getParentSpanId());
    result = result && internalGetLabels().equals(
        other.internalGetLabels());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptorForType().hashCode();
    hash = (37 * hash) + SPAN_ID_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getSpanId());
    hash = (37 * hash) + KIND_FIELD_NUMBER;
    hash = (53 * hash) + kind_;
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (hasStartTime()) {
      hash = (37 * hash) + START_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getStartTime().hashCode();
    }
    if (hasEndTime()) {
      hash = (37 * hash) + END_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getEndTime().hashCode();
    }
    hash = (37 * hash) + PARENT_SPAN_ID_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getParentSpanId());
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.devtools.cloudtrace.v1.TraceSpan parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.devtools.cloudtrace.v1.TraceSpan prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * A span represents a single timed event within a trace. Spans can be nested
   * and form a trace tree. Often, a trace contains a root span that describes the
   * end-to-end latency of an operation and, optionally, one or more subspans for
   * its suboperations. Spans do not need to be contiguous. There may be gaps
   * between spans in a trace.
   *

   *
   * Protobuf type {@code google.devtools.cloudtrace.v1.TraceSpan}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v1.TraceSpan)
      com.google.devtools.cloudtrace.v1.TraceSpanOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 7:
          return internalGetLabels();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 7:
          return internalGetMutableLabels();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v1.TraceSpan.class, com.google.devtools.cloudtrace.v1.TraceSpan.Builder.class);
    }

    // Construct using com.google.devtools.cloudtrace.v1.TraceSpan.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      spanId_ = 0L;

      kind_ = 0;

      name_ = "";

      if (startTimeBuilder_ == null) {
        startTime_ = null;
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }
      if (endTimeBuilder_ == null) {
        endTime_ = null;
      } else {
        endTime_ = null;
        endTimeBuilder_ = null;
      }
      parentSpanId_ = 0L;

      internalGetMutableLabels().clear();
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.devtools.cloudtrace.v1.TraceProto.internal_static_google_devtools_cloudtrace_v1_TraceSpan_descriptor;
    }

    public com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstanceForType() {
      return com.google.devtools.cloudtrace.v1.TraceSpan.getDefaultInstance();
    }

    public com.google.devtools.cloudtrace.v1.TraceSpan build() {
      com.google.devtools.cloudtrace.v1.TraceSpan result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.devtools.cloudtrace.v1.TraceSpan buildPartial() {
      com.google.devtools.cloudtrace.v1.TraceSpan result = new com.google.devtools.cloudtrace.v1.TraceSpan(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.spanId_ = spanId_;
      result.kind_ = kind_;
      result.name_ = name_;
      if (startTimeBuilder_ == null) {
        result.startTime_ = startTime_;
      } else {
        result.startTime_ = startTimeBuilder_.build();
      }
      if (endTimeBuilder_ == null) {
        result.endTime_ = endTime_;
      } else {
        result.endTime_ = endTimeBuilder_.build();
      }
      result.parentSpanId_ = parentSpanId_;
      result.labels_ = internalGetLabels();
      result.labels_.makeImmutable();
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.devtools.cloudtrace.v1.TraceSpan) {
        return mergeFrom((com.google.devtools.cloudtrace.v1.TraceSpan)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.devtools.cloudtrace.v1.TraceSpan other) {
      if (other == com.google.devtools.cloudtrace.v1.TraceSpan.getDefaultInstance()) return this;
      if (other.getSpanId() != 0L) {
        setSpanId(other.getSpanId());
      }
      if (other.kind_ != 0) {
        setKindValue(other.getKindValue());
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.hasStartTime()) {
        mergeStartTime(other.getStartTime());
      }
      if (other.hasEndTime()) {
        mergeEndTime(other.getEndTime());
      }
      if (other.getParentSpanId() != 0L) {
        setParentSpanId(other.getParentSpanId());
      }
      internalGetMutableLabels().mergeFrom(
          other.internalGetLabels());
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.devtools.cloudtrace.v1.TraceSpan parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.devtools.cloudtrace.v1.TraceSpan) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private long spanId_ ;
    /**
     *

     * Identifier for the span. Must be a 64-bit integer other than 0 and
     * unique within a trace.
     *

     *
     * optional fixed64 span_id = 1;
     */
    public long getSpanId() {
      return spanId_;
    }
    /**
     *

     * Identifier for the span. Must be a 64-bit integer other than 0 and
     * unique within a trace.
     *

     *
     * optional fixed64 span_id = 1;
     */
    public Builder setSpanId(long value) {

      spanId_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Identifier for the span. Must be a 64-bit integer other than 0 and
     * unique within a trace.
     *

     *
     * optional fixed64 span_id = 1;
     */
    public Builder clearSpanId() {

      spanId_ = 0L;
      onChanged();
      return this;
    }

    private int kind_ = 0;
    /**
     *

     * Distinguishes between spans generated in a particular context. For example,
     * two spans with the same name may be distinguished using `RPC_CLIENT`
     * and `RPC_SERVER` to identify queueing latency associated with the span.
     *

     *
     * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
     */
    public int getKindValue() {
      return kind_;
    }
    /**
     *

     * Distinguishes between spans generated in a particular context. For example,
     * two spans with the same name may be distinguished using `RPC_CLIENT`
     * and `RPC_SERVER` to identify queueing latency associated with the span.
     *

     *
     * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
     */
    public Builder setKindValue(int value) {
      kind_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Distinguishes between spans generated in a particular context. For example,
     * two spans with the same name may be distinguished using `RPC_CLIENT`
     * and `RPC_SERVER` to identify queueing latency associated with the span.
     *

     *
     * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
     */
    public com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind getKind() {
      com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind result = com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.valueOf(kind_);
      return result == null ? com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind.UNRECOGNIZED : result;
    }
    /**
     *

     * Distinguishes between spans generated in a particular context. For example,
     * two spans with the same name may be distinguished using `RPC_CLIENT`
     * and `RPC_SERVER` to identify queueing latency associated with the span.
     *

     *
     * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
     */
    public Builder setKind(com.google.devtools.cloudtrace.v1.TraceSpan.SpanKind value) {
      if (value == null) {
        throw new NullPointerException();
      }

      kind_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *

     * Distinguishes between spans generated in a particular context. For example,
     * two spans with the same name may be distinguished using `RPC_CLIENT`
     * and `RPC_SERVER` to identify queueing latency associated with the span.
     *

     *
     * optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;
     */
    public Builder clearKind() {

      kind_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *

     * Name of the trace. The trace name is sanitized and displayed in the
     * Stackdriver Trace tool in the Google Developers Console.
     * The name may be a method name or some other per-call site name.
     * For the same executable and the same call point, a best practice is
     * to use a consistent name, which makes it easier to correlate
     * cross-trace spans.
     *

     *
     * optional string name = 3;
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Name of the trace. The trace name is sanitized and displayed in the
     * Stackdriver Trace tool in the Google Developers Console.
     * The name may be a method name or some other per-call site name.
     * For the same executable and the same call point, a best practice is
     * to use a consistent name, which makes it easier to correlate
     * cross-trace spans.
     *

     *
     * optional string name = 3;
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Name of the trace. The trace name is sanitized and displayed in the
     * Stackdriver Trace tool in the Google Developers Console.
     * The name may be a method name or some other per-call site name.
     * For the same executable and the same call point, a best practice is
     * to use a consistent name, which makes it easier to correlate
     * cross-trace spans.
     *

     *
     * optional string name = 3;
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Name of the trace. The trace name is sanitized and displayed in the
     * Stackdriver Trace tool in the Google Developers Console.
     * The name may be a method name or some other per-call site name.
     * For the same executable and the same call point, a best practice is
     * to use a consistent name, which makes it easier to correlate
     * cross-trace spans.
     *

     *
     * optional string name = 3;
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *

     * Name of the trace. The trace name is sanitized and displayed in the
     * Stackdriver Trace tool in the Google Developers Console.
     * The name may be a method name or some other per-call site name.
     * For the same executable and the same call point, a best practice is
     * to use a consistent name, which makes it easier to correlate
     * cross-trace spans.
     *

     *
     * optional string name = 3;
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      name_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp startTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_;
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public boolean hasStartTime() {
      return startTimeBuilder_ != null || startTime_ != null;
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public com.google.protobuf.Timestamp getStartTime() {
      if (startTimeBuilder_ == null) {
        return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      } else {
        return startTimeBuilder_.getMessage();
      }
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public Builder setStartTime(com.google.protobuf.Timestamp value) {
      if (startTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        startTime_ = value;
        onChanged();
      } else {
        startTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public Builder setStartTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (startTimeBuilder_ == null) {
        startTime_ = builderForValue.build();
        onChanged();
      } else {
        startTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public Builder mergeStartTime(com.google.protobuf.Timestamp value) {
      if (startTimeBuilder_ == null) {
        if (startTime_ != null) {
          startTime_ =
            com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial();
        } else {
          startTime_ = value;
        }
        onChanged();
      } else {
        startTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public Builder clearStartTime() {
      if (startTimeBuilder_ == null) {
        startTime_ = null;
        onChanged();
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() {

      onChanged();
      return getStartTimeFieldBuilder().getBuilder();
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
      if (startTimeBuilder_ != null) {
        return startTimeBuilder_.getMessageOrBuilder();
      } else {
        return startTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      }
    }
    /**
     *

     * Start time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp start_time = 4;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
        getStartTimeFieldBuilder() {
      if (startTimeBuilder_ == null) {
        startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getStartTime(),
                getParentForChildren(),
                isClean());
        startTime_ = null;
      }
      return startTimeBuilder_;
    }

    private com.google.protobuf.Timestamp endTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_;
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public boolean hasEndTime() {
      return endTimeBuilder_ != null || endTime_ != null;
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public com.google.protobuf.Timestamp getEndTime() {
      if (endTimeBuilder_ == null) {
        return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
      } else {
        return endTimeBuilder_.getMessage();
      }
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public Builder setEndTime(com.google.protobuf.Timestamp value) {
      if (endTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        endTime_ = value;
        onChanged();
      } else {
        endTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public Builder setEndTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (endTimeBuilder_ == null) {
        endTime_ = builderForValue.build();
        onChanged();
      } else {
        endTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public Builder mergeEndTime(com.google.protobuf.Timestamp value) {
      if (endTimeBuilder_ == null) {
        if (endTime_ != null) {
          endTime_ =
            com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial();
        } else {
          endTime_ = value;
        }
        onChanged();
      } else {
        endTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public Builder clearEndTime() {
      if (endTimeBuilder_ == null) {
        endTime_ = null;
        onChanged();
      } else {
        endTime_ = null;
        endTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() {

      onChanged();
      return getEndTimeFieldBuilder().getBuilder();
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
      if (endTimeBuilder_ != null) {
        return endTimeBuilder_.getMessageOrBuilder();
      } else {
        return endTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
      }
    }
    /**
     *

     * End time of the span in nanoseconds from the UNIX epoch.
     *

     *
     * optional .google.protobuf.Timestamp end_time = 5;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
        getEndTimeFieldBuilder() {
      if (endTimeBuilder_ == null) {
        endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getEndTime(),
                getParentForChildren(),
                isClean());
        endTime_ = null;
      }
      return endTimeBuilder_;
    }

    private long parentSpanId_ ;
    /**
     *

     * ID of the parent span, if any. Optional.
     *

     *
     * optional fixed64 parent_span_id = 6;
     */
    public long getParentSpanId() {
      return parentSpanId_;
    }
    /**
     *

     * ID of the parent span, if any. Optional.
     *

     *
     * optional fixed64 parent_span_id = 6;
     */
    public Builder setParentSpanId(long value) {

      parentSpanId_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * ID of the parent span, if any. Optional.
     *

     *
     * optional fixed64 parent_span_id = 6;
     */
    public Builder clearParentSpanId() {

      parentSpanId_ = 0L;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> labels_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetMutableLabels() {
      onChanged();;
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(
            LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public boolean containsLabels(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetLabels().getMap().containsKey(key);
    }
    /**
     * Use {@link #getLabelsMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public java.lang.String getLabelsOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public java.lang.String getLabelsOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      getMutableLabels().clear();
      return this;
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public Builder removeLabels(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      getMutableLabels().remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
    getMutableLabels() {
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */
    public Builder putLabels(
        java.lang.String key,
        java.lang.String value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      getMutableLabels().put(key, value);
      return this;
    }
    /**
     *

     * Collection of labels associated with the span.
     *

     *
     * map<string, string> labels = 7;
     */

    public Builder putAllLabels(
        java.util.Map<java.lang.String, java.lang.String> values) {
      getMutableLabels().putAll(values);
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v1.TraceSpan)
  }

  // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.TraceSpan)
  private static final com.google.devtools.cloudtrace.v1.TraceSpan DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v1.TraceSpan();
  }

  public static com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<TraceSpan>
      PARSER = new com.google.protobuf.AbstractParser<TraceSpan>() {
    public TraceSpan parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
        return new TraceSpan(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<TraceSpan> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<TraceSpan> getParserForType() {
    return PARSER;
  }

  public com.google.devtools.cloudtrace.v1.TraceSpan getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
import { ISynchronousOperation } from './Interfaces';
import { InputParserReadFilesOptionalStandardInput } from './InputParser';

import * as _ from 'lodash';

export class SetOperation {
    private parser: InputParserReadFilesOptionalStandardInput;

    constructor() {
        this.parser = new InputParserReadFilesOptionalStandardInput();
    }

    public parse(argv: string[]): Promise<string[][]> {
        return this.parser.parse(argv);
    }
}

/* Computes the Symmetric Difference of the input arrays. */
/* https://en.wikipedia.org/wiki/Symmetric_difference */
export class XOR extends SetOperation implements ISynchronousOperation {
    public run(data: string[][]): Promise<string[]> {
        return new Promise((resolve, reject) => resolve(_.xor(...data)));
    }
}

/* Unions lists together. */
export class Union extends SetOperation implements ISynchronousOperation {
    public run(data: string[][]): Promise<string[]> {
        return new Promise((resolve, reject) => resolve(_.union(...data)));
    }
}

/* Concatenates lists together. */
export class Concatenate extends SetOperation implements ISynchronousOperation {
    public run(data: string[][]): Promise<string[]> {
        return new Promise((resolve, reject) => resolve(_.concat(...data)));
    }
}

/* Computes the difference between the first list and the remaining lists. */
export class Difference extends SetOperation implements ISynchronousOperation {
    public run(data: string[][]): Promise<string[]> {
        return new Promise((resolve, reject) => resolve(_.difference(data.shift(), ...data)));
    }
}

redpajama_set_name: RedPajamaGithub


text:
package client

const (
	PushPipelineConfigInputType         = "pushPipelineConfigInput"
	PushPipelineConfigInputFieldConfigs = "configs"
)

type PushPipelineConfigInput struct {
	Configs map[string]PipelineConfig `json:"configs,omitempty" yaml:"configs,omitempty"`
}


text:
var saleableBasicCtrl = function($scope,$rootScope,SaleableService,MessageService,CategoryHelper){

    $rootScope.$on("newBasicDetail",function(event){
        CategoryHelper.categoryList('/salcatlist',$scope);

        //var numberOfSaleables = $scope.$parent.saleables.length;
        var saleable = SaleableService.$build();
        saleable.type =0;
        saleable.featured = 0;

        /*if(numberOfSaleables==0){

        }*/
        //$scope.saleable = angular.copy($scope.master);
        $scope.saleable = saleable;

        $scope.updateSaleable = function(){

            if($scope.saleable.isfeatured){
                $scope.saleable.featured = 1;
            }else{
                $scope.saleable.featured = 0;
            }
            console.log($scope.saleable.categories);
            saleable.$save().$then(function(data){
                var meta = data.$metadata.meta;
                MessageService.setAlertMessage($scope,meta);
                $rootScope.$emit("saleableCreated",saleable);

            });
        }

    });

    $rootScope.$on("editBasicDetail",function(event,saleable){
        CategoryHelper.categoryList('/salcatlist',$scope);
        CategoryHelper.salCategoryList('/salcatlistselected/'+saleable.id,$scope);
        $scope.saleable = saleable;
        $scope.updateSaleable = function(){

            if($scope.saleable.isfeatured){
                $scope.saleable.featured = 1;
            }else{
                $scope.saleable.featured = 0;
            }
            saleable.$save().$then(function(data){

                var meta = data.$metadata.meta;
                MessageService.setAlertMessage($scope,meta);
                $rootScope.$emit("saleableUpdated",saleable);

            });
        }

    });

}

module.exports = saleableBasicCtrl;


text:
console.log("Starting bot");

//require discord.js dependency
const Discord = require("discord.js");
console.log("discord.js successfully required");

const helpClass = require("./helpText.js");

//create the client
const client = new Discord.Client();
console.log("client successfully created");

//token for loging in
let fs = require("fs");
const token = fs.readFile("./bot.json", (err, data) => {
  JSON.parse(data, (key, value) => {
    if (key === "token") {
      client.login(value);
    }
  });
});

//other program constants
const prefix = "!";

//action for when bot is ready
client.on("ready", () => {
  console.log("Report: Ready");

  client.guilds.forEach(function(guild, id) {

    let hasOnCallRole = guild.roles.exists(function(role) {
      return role.name.toLowerCase() === "on-call";
    });
    //console.log("in a guild");

    let speakChannel = guild.channels.find(function(channel) {
      let channelPermissions = channel.permissionsFor(client.user);
      //console.log(channelPermissions);
      if (channelPermissions) {
        return channelPermissions.has("SEND_MESSAGES");
      }
      return false;
    });

    if (speakChannel) {
      speakChannel.send("This test bot has started! I'M ALIVE!");
      //speakChannel.send(
      //    "This server has an `On-call` role: " + hasOnCallRole);
    }
  });
});

//message handling
client.on("message", msg => {
  //check for bot prefix
  if (!msg.content.startsWith(prefix)) return;

  //take off the prefix, already checked for it
  msg.content = msg.content.substr(1).toLowerCase();

  //handle commands

  //ping command
  if (msg.content === "ping") {
    let originalTime = msg.createdTimestamp;
    msg.channel.send("Pong! Response time is: " + (Date.now() - originalTime));
  }

  //on-call command
  if (msg.content === "on-call") {
    let onCallRole =
        msg.guild.roles.find(role => {
          return role.name.toLowerCase() === "on-call";
        });

    if (!onCallRole) {
      msg.channel.send("Sorry, this server doesn't have an `On-call` role");
      return;
    }
    //console.log("on-call role found");
    const member = msg.guild.member(msg.author);

    //if the author is a member of the server
    if (member) {
      //console.log("author is a member of the server");
      let onCall = member.roles.find(role => {
          return role.name.toLowerCase() === "on-call";
        });

      //toggle on-call role
      if (onCall) {
        member.removeRole(onCallRole);
        msg.channel.send(member.displayName + " is no longer on call.");
      } else {
        member.addRole(onCallRole);
        msg.channel.send(member.displayName + " is now on call.");
      }
    } else {
      /*
      console.log("Message author isn't a member of the server!");
      console.log("Contents: " + msg.content);
      console.log("Author: " + msg.guild.member(msg.author).displayName);
      */
    }
  } //end on-call command

  //help command
  if (msg.content === "help") {
    let DM = msg.author.dmChannel;
    if (!DM) {
      msg.author.createDM().then(DM => DM.send(helpClass.help()));
    }
    DM.send(helpClass.help());
  }
});


text:
package uk.co.automatictester.concurrency.forkjoin;

import org.testng.annotations.Test;

import java.util.concurrent.ForkJoinPool;

public class ParallelAddRecursiveActionTest {

    @Test
    public void test() {
        int[] input = {1, 2, 3, 2, 2, 1, 2, 3, 2, 2};
        ParallelAddRecursiveAction task = new ParallelAddRecursiveAction(0, input.length, input, 4);
        ForkJoinPool.commonPool().invoke(task);
        assert task.getValue() == 20;
    }
}


text:
add_lunch_combo cm_kumquat-userdebug
add_lunch_combo cm_kumquat-eng