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

package com.google.devtools.cloudtrace.v2;

/**
 *
 *
 * <pre>
 * A span represents a single operation within a trace. Spans can be
 * nested to form a trace tree. Often, a trace contains a root span
 * that describes the end-to-end latency, and one or more subspans for
 * its sub-operations. A trace can also contain multiple root spans,
 * or none at all. Spans do not need to be contiguous&amp;mdash;there may be
 * gaps or overlaps between spans in a trace.
 * </pre>
 *
 * Protobuf type {@code google.devtools.cloudtrace.v2.Span}
 */
public final class Span extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span)
    SpanOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Span.newBuilder() to construct.
  private Span(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Span() {
    name_ = "";
    spanId_ = "";
    parentSpanId_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private Span(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

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

              parentSpanId_ = s;
              break;
            }
          case 34:
            {
              com.google.devtools.cloudtrace.v2.TruncatableString.Builder subBuilder = null;
              if (displayName_ != null) {
                subBuilder = displayName_.toBuilder();
              }
              displayName_ =
                  input.readMessage(
                      com.google.devtools.cloudtrace.v2.TruncatableString.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(displayName_);
                displayName_ = subBuilder.buildPartial();
              }

              break;
            }
          case 42:
            {
              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 50:
            {
              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 58:
            {
              com.google.devtools.cloudtrace.v2.Span.Attributes.Builder subBuilder = null;
              if (attributes_ != null) {
                subBuilder = attributes_.toBuilder();
              }
              attributes_ =
                  input.readMessage(
                      com.google.devtools.cloudtrace.v2.Span.Attributes.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(attributes_);
                attributes_ = subBuilder.buildPartial();
              }

              break;
            }
          case 66:
            {
              com.google.devtools.cloudtrace.v2.StackTrace.Builder subBuilder = null;
              if (stackTrace_ != null) {
                subBuilder = stackTrace_.toBuilder();
              }
              stackTrace_ =
                  input.readMessage(
                      com.google.devtools.cloudtrace.v2.StackTrace.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(stackTrace_);
                stackTrace_ = subBuilder.buildPartial();
              }

              break;
            }
          case 74:
            {
              com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder subBuilder = null;
              if (timeEvents_ != null) {
                subBuilder = timeEvents_.toBuilder();
              }
              timeEvents_ =
                  input.readMessage(
                      com.google.devtools.cloudtrace.v2.Span.TimeEvents.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(timeEvents_);
                timeEvents_ = subBuilder.buildPartial();
              }

              break;
            }
          case 82:
            {
              com.google.devtools.cloudtrace.v2.Span.Links.Builder subBuilder = null;
              if (links_ != null) {
                subBuilder = links_.toBuilder();
              }
              links_ =
                  input.readMessage(
                      com.google.devtools.cloudtrace.v2.Span.Links.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(links_);
                links_ = subBuilder.buildPartial();
              }

              break;
            }
          case 90:
            {
              com.google.rpc.Status.Builder subBuilder = null;
              if (status_ != null) {
                subBuilder = status_.toBuilder();
              }
              status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(status_);
                status_ = subBuilder.buildPartial();
              }

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

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

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.devtools.cloudtrace.v2.TraceProto
        .internal_static_google_devtools_cloudtrace_v2_Span_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.devtools.cloudtrace.v2.TraceProto
        .internal_static_google_devtools_cloudtrace_v2_Span_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.devtools.cloudtrace.v2.Span.class,
            com.google.devtools.cloudtrace.v2.Span.Builder.class);
  }

  public interface AttributesOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.Attributes)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    int getAttributeMapCount();
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    boolean containsAttributeMap(java.lang.String key);
    /** Use {@link #getAttributeMapMap()} instead. */
    @java.lang.Deprecated
    java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        getAttributeMap();
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        getAttributeMapMap();
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrDefault(
        java.lang.String key, com.google.devtools.cloudtrace.v2.AttributeValue defaultValue);
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrThrow(java.lang.String key);

    /**
     *
     *
     * <pre>
     * The number of attributes that were discarded. Attributes can be discarded
     * because their keys are too long or because there are too many attributes.
     * If this value is 0 then all attributes are valid.
     * </pre>
     *
     * <code>int32 dropped_attributes_count = 2;</code>
     */
    int getDroppedAttributesCount();
  }
  /**
   *
   *
   * <pre>
   * A set of attributes, each in the format `[KEY]:[VALUE]`.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Attributes}
   */
  public static final class Attributes extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.Attributes)
      AttributesOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Attributes.newBuilder() to construct.
    private Attributes(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Attributes() {}

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private Attributes(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                  attributeMap_ =
                      com.google.protobuf.MapField.newMapField(
                          AttributeMapDefaultEntryHolder.defaultEntry);
                  mutable_bitField0_ |= 0x00000001;
                }
                com.google.protobuf.MapEntry<
                        java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
                    attributeMap__ =
                        input.readMessage(
                            AttributeMapDefaultEntryHolder.defaultEntry.getParserForType(),
                            extensionRegistry);
                attributeMap_
                    .getMutableMap()
                    .put(attributeMap__.getKey(), attributeMap__.getValue());
                break;
              }
            case 16:
              {
                droppedAttributesCount_ = input.readInt32();
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                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 {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    @java.lang.Override
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 1:
          return internalGetAttributeMap();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.Attributes.class,
              com.google.devtools.cloudtrace.v2.Span.Attributes.Builder.class);
    }

    private int bitField0_;
    public static final int ATTRIBUTE_MAP_FIELD_NUMBER = 1;

    private static final class AttributeMapDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
              java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          defaultEntry =
              com.google.protobuf.MapEntry
                  .<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
                      newDefaultInstance(
                          com.google.devtools.cloudtrace.v2.TraceProto
                              .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_AttributeMapEntry_descriptor,
                          com.google.protobuf.WireFormat.FieldType.STRING,
                          "",
                          com.google.protobuf.WireFormat.FieldType.MESSAGE,
                          com.google.devtools.cloudtrace.v2.AttributeValue.getDefaultInstance());
    }

    private com.google.protobuf.MapField<
            java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        attributeMap_;

    private com.google.protobuf.MapField<
            java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        internalGetAttributeMap() {
      if (attributeMap_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            AttributeMapDefaultEntryHolder.defaultEntry);
      }
      return attributeMap_;
    }

    public int getAttributeMapCount() {
      return internalGetAttributeMap().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    public boolean containsAttributeMap(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      return internalGetAttributeMap().getMap().containsKey(key);
    }
    /** Use {@link #getAttributeMapMap()} instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        getAttributeMap() {
      return getAttributeMapMap();
    }
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
        getAttributeMapMap() {
      return internalGetAttributeMap().getMap();
    }
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    public com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrDefault(
        java.lang.String key, com.google.devtools.cloudtrace.v2.AttributeValue defaultValue) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue> map =
          internalGetAttributeMap().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * The set of attributes. Each attribute's key can be up to 128 bytes
     * long. The value can be a string up to 256 bytes, an integer, or the
     * Boolean values `true` and `false`. For example:
     *     "/instance_id": "my-instance"
     *     "/http/user_agent": ""
     *     "/http/request_bytes": 300
     *     "abc.com/myattribute": true
     * </pre>
     *
     * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
     * </code>
     */
    public com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrThrow(
        java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue> map =
          internalGetAttributeMap().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public static final int DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER = 2;
    private int droppedAttributesCount_;
    /**
     *
     *
     * <pre>
     * The number of attributes that were discarded. Attributes can be discarded
     * because their keys are too long or because there are too many attributes.
     * If this value is 0 then all attributes are valid.
     * </pre>
     *
     * <code>int32 dropped_attributes_count = 2;</code>
     */
    public int getDroppedAttributesCount() {
      return droppedAttributesCount_;
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
          output, internalGetAttributeMap(), AttributeMapDefaultEntryHolder.defaultEntry, 1);
      if (droppedAttributesCount_ != 0) {
        output.writeInt32(2, droppedAttributesCount_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      for (java.util.Map.Entry<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          entry : internalGetAttributeMap().getMap().entrySet()) {
        com.google.protobuf.MapEntry<
                java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
            attributeMap__ =
                AttributeMapDefaultEntryHolder.defaultEntry
                    .newBuilderForType()
                    .setKey(entry.getKey())
                    .setValue(entry.getValue())
                    .build();
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, attributeMap__);
      }
      if (droppedAttributesCount_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, droppedAttributesCount_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.Attributes)) {
        return super.equals(obj);
      }
      com.google.devtools.cloudtrace.v2.Span.Attributes other =
          (com.google.devtools.cloudtrace.v2.Span.Attributes) obj;

      if (!internalGetAttributeMap().equals(other.internalGetAttributeMap())) return false;
      if (getDroppedAttributesCount() != other.getDroppedAttributesCount()) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (!internalGetAttributeMap().getMap().isEmpty()) {
        hash = (37 * hash) + ATTRIBUTE_MAP_FIELD_NUMBER;
        hash = (53 * hash) + internalGetAttributeMap().hashCode();
      }
      hash = (37 * hash) + DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + getDroppedAttributesCount();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes 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.v2.Span.Attributes parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes 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.v2.Span.Attributes parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes 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.v2.Span.Attributes parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span.Attributes prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    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;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes, each in the format `[KEY]:[VALUE]`.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Attributes}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.Attributes)
        com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(int number) {
        switch (number) {
          case 1:
            return internalGetAttributeMap();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        switch (number) {
          case 1:
            return internalGetMutableAttributeMap();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.Attributes.class,
                com.google.devtools.cloudtrace.v2.Span.Attributes.Builder.class);
      }

      // Construct using com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        internalGetMutableAttributeMap().clear();
        droppedAttributesCount_ = 0;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Attributes_descriptor;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Attributes getDefaultInstanceForType() {
        return com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Attributes build() {
        com.google.devtools.cloudtrace.v2.Span.Attributes result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Attributes buildPartial() {
        com.google.devtools.cloudtrace.v2.Span.Attributes result =
            new com.google.devtools.cloudtrace.v2.Span.Attributes(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.attributeMap_ = internalGetAttributeMap();
        result.attributeMap_.makeImmutable();
        result.droppedAttributesCount_ = droppedAttributesCount_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.devtools.cloudtrace.v2.Span.Attributes) {
          return mergeFrom((com.google.devtools.cloudtrace.v2.Span.Attributes) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.Attributes other) {
        if (other == com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance())
          return this;
        internalGetMutableAttributeMap().mergeFrom(other.internalGetAttributeMap());
        if (other.getDroppedAttributesCount() != 0) {
          setDroppedAttributesCount(other.getDroppedAttributesCount());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.devtools.cloudtrace.v2.Span.Attributes parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage =
              (com.google.devtools.cloudtrace.v2.Span.Attributes) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private com.google.protobuf.MapField<
              java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          attributeMap_;

      private com.google.protobuf.MapField<
              java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          internalGetAttributeMap() {
        if (attributeMap_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              AttributeMapDefaultEntryHolder.defaultEntry);
        }
        return attributeMap_;
      }

      private com.google.protobuf.MapField<
              java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          internalGetMutableAttributeMap() {
        onChanged();
        ;
        if (attributeMap_ == null) {
          attributeMap_ =
              com.google.protobuf.MapField.newMapField(AttributeMapDefaultEntryHolder.defaultEntry);
        }
        if (!attributeMap_.isMutable()) {
          attributeMap_ = attributeMap_.copy();
        }
        return attributeMap_;
      }

      public int getAttributeMapCount() {
        return internalGetAttributeMap().getMap().size();
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public boolean containsAttributeMap(java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        return internalGetAttributeMap().getMap().containsKey(key);
      }
      /** Use {@link #getAttributeMapMap()} instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          getAttributeMap() {
        return getAttributeMapMap();
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          getAttributeMapMap() {
        return internalGetAttributeMap().getMap();
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrDefault(
          java.lang.String key, com.google.devtools.cloudtrace.v2.AttributeValue defaultValue) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue> map =
            internalGetAttributeMap().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public com.google.devtools.cloudtrace.v2.AttributeValue getAttributeMapOrThrow(
          java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue> map =
            internalGetAttributeMap().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearAttributeMap() {
        internalGetMutableAttributeMap().getMutableMap().clear();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public Builder removeAttributeMap(java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        internalGetMutableAttributeMap().getMutableMap().remove(key);
        return this;
      }
      /** Use alternate mutation accessors instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
          getMutableAttributeMap() {
        return internalGetMutableAttributeMap().getMutableMap();
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public Builder putAttributeMap(
          java.lang.String key, com.google.devtools.cloudtrace.v2.AttributeValue value) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        if (value == null) {
          throw new java.lang.NullPointerException();
        }
        internalGetMutableAttributeMap().getMutableMap().put(key, value);
        return this;
      }
      /**
       *
       *
       * <pre>
       * The set of attributes. Each attribute's key can be up to 128 bytes
       * long. The value can be a string up to 256 bytes, an integer, or the
       * Boolean values `true` and `false`. For example:
       *     "/instance_id": "my-instance"
       *     "/http/user_agent": ""
       *     "/http/request_bytes": 300
       *     "abc.com/myattribute": true
       * </pre>
       *
       * <code>map&lt;string, .google.devtools.cloudtrace.v2.AttributeValue&gt; attribute_map = 1;
       * </code>
       */
      public Builder putAllAttributeMap(
          java.util.Map<java.lang.String, com.google.devtools.cloudtrace.v2.AttributeValue>
              values) {
        internalGetMutableAttributeMap().getMutableMap().putAll(values);
        return this;
      }

      private int droppedAttributesCount_;
      /**
       *
       *
       * <pre>
       * The number of attributes that were discarded. Attributes can be discarded
       * because their keys are too long or because there are too many attributes.
       * If this value is 0 then all attributes are valid.
       * </pre>
       *
       * <code>int32 dropped_attributes_count = 2;</code>
       */
      public int getDroppedAttributesCount() {
        return droppedAttributesCount_;
      }
      /**
       *
       *
       * <pre>
       * The number of attributes that were discarded. Attributes can be discarded
       * because their keys are too long or because there are too many attributes.
       * If this value is 0 then all attributes are valid.
       * </pre>
       *
       * <code>int32 dropped_attributes_count = 2;</code>
       */
      public Builder setDroppedAttributesCount(int value) {

        droppedAttributesCount_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The number of attributes that were discarded. Attributes can be discarded
       * because their keys are too long or because there are too many attributes.
       * If this value is 0 then all attributes are valid.
       * </pre>
       *
       * <code>int32 dropped_attributes_count = 2;</code>
       */
      public Builder clearDroppedAttributesCount() {

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

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.Attributes)
    }

    // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Attributes)
    private static final com.google.devtools.cloudtrace.v2.Span.Attributes DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.Attributes();
    }

    public static com.google.devtools.cloudtrace.v2.Span.Attributes getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span.Attributes getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface TimeEventOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.TimeEvent)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    boolean hasTime();
    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    com.google.protobuf.Timestamp getTime();
    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    com.google.protobuf.TimestampOrBuilder getTimeOrBuilder();

    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    boolean hasAnnotation();
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation getAnnotation();
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder getAnnotationOrBuilder();

    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    boolean hasMessageEvent();
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent getMessageEvent();
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder
        getMessageEventOrBuilder();

    public com.google.devtools.cloudtrace.v2.Span.TimeEvent.ValueCase getValueCase();
  }
  /**
   *
   *
   * <pre>
   * A time-stamped annotation or message event in the Span.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent}
   */
  public static final class TimeEvent extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.TimeEvent)
      TimeEventOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use TimeEvent.newBuilder() to construct.
    private TimeEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private TimeEvent() {}

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private TimeEvent(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                com.google.protobuf.Timestamp.Builder subBuilder = null;
                if (time_ != null) {
                  subBuilder = time_.toBuilder();
                }
                time_ =
                    input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(time_);
                  time_ = subBuilder.buildPartial();
                }

                break;
              }
            case 18:
              {
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder subBuilder =
                    null;
                if (valueCase_ == 2) {
                  subBuilder =
                      ((com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_)
                          .toBuilder();
                }
                value_ =
                    input.readMessage(
                        com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.parser(),
                        extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(
                      (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_);
                  value_ = subBuilder.buildPartial();
                }
                valueCase_ = 2;
                break;
              }
            case 26:
              {
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder subBuilder =
                    null;
                if (valueCase_ == 3) {
                  subBuilder =
                      ((com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_)
                          .toBuilder();
                }
                value_ =
                    input.readMessage(
                        com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.parser(),
                        extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(
                      (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_);
                  value_ = subBuilder.buildPartial();
                }
                valueCase_ = 3;
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                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 {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.class,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder.class);
    }

    public interface AnnotationOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      boolean hasDescription();
      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      com.google.devtools.cloudtrace.v2.TruncatableString getDescription();
      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder getDescriptionOrBuilder();

      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      boolean hasAttributes();
      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes();
      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder();
    }
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation}
     */
    public static final class Annotation extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
        AnnotationOrBuilder {
      private static final long serialVersionUID = 0L;
      // Use Annotation.newBuilder() to construct.
      private Annotation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }

      private Annotation() {}

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      private Annotation(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        this();
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder();
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10:
                {
                  com.google.devtools.cloudtrace.v2.TruncatableString.Builder subBuilder = null;
                  if (description_ != null) {
                    subBuilder = description_.toBuilder();
                  }
                  description_ =
                      input.readMessage(
                          com.google.devtools.cloudtrace.v2.TruncatableString.parser(),
                          extensionRegistry);
                  if (subBuilder != null) {
                    subBuilder.mergeFrom(description_);
                    description_ = subBuilder.buildPartial();
                  }

                  break;
                }
              case 18:
                {
                  com.google.devtools.cloudtrace.v2.Span.Attributes.Builder subBuilder = null;
                  if (attributes_ != null) {
                    subBuilder = attributes_.toBuilder();
                  }
                  attributes_ =
                      input.readMessage(
                          com.google.devtools.cloudtrace.v2.Span.Attributes.parser(),
                          extensionRegistry);
                  if (subBuilder != null) {
                    subBuilder.mergeFrom(attributes_);
                    attributes_ = subBuilder.buildPartial();
                  }

                  break;
                }
              default:
                {
                  if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                    done = true;
                  }
                  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 {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_Annotation_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_Annotation_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.class,
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder.class);
      }

      public static final int DESCRIPTION_FIELD_NUMBER = 1;
      private com.google.devtools.cloudtrace.v2.TruncatableString description_;
      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      public boolean hasDescription() {
        return description_ != null;
      }
      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.TruncatableString getDescription() {
        return description_ == null
            ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
            : description_;
      }
      /**
       *
       *
       * <pre>
       * A user-supplied message describing the event. The maximum length for
       * the description is 256 bytes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder
          getDescriptionOrBuilder() {
        return getDescription();
      }

      public static final int ATTRIBUTES_FIELD_NUMBER = 2;
      private com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      public boolean hasAttributes() {
        return attributes_ != null;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
        return attributes_ == null
            ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
            : attributes_;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the annotation. You can have up to 4 attributes
       * per Annotation.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
        return getAttributes();
      }

      private byte memoizedIsInitialized = -1;

      @java.lang.Override
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;

        memoizedIsInitialized = 1;
        return true;
      }

      @java.lang.Override
      public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        if (description_ != null) {
          output.writeMessage(1, getDescription());
        }
        if (attributes_ != null) {
          output.writeMessage(2, getAttributes());
        }
        unknownFields.writeTo(output);
      }

      @java.lang.Override
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;

        size = 0;
        if (description_ != null) {
          size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDescription());
        }
        if (attributes_ != null) {
          size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttributes());
        }
        size += unknownFields.getSerializedSize();
        memoizedSize = size;
        return size;
      }

      @java.lang.Override
      public boolean equals(final java.lang.Object obj) {
        if (obj == this) {
          return true;
        }
        if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)) {
          return super.equals(obj);
        }
        com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation other =
            (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) obj;

        if (hasDescription() != other.hasDescription()) return false;
        if (hasDescription()) {
          if (!getDescription().equals(other.getDescription())) return false;
        }
        if (hasAttributes() != other.hasAttributes()) return false;
        if (hasAttributes()) {
          if (!getAttributes().equals(other.getAttributes())) return false;
        }
        if (!unknownFields.equals(other.unknownFields)) return false;
        return true;
      }

      @java.lang.Override
      public int hashCode() {
        if (memoizedHashCode != 0) {
          return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        if (hasDescription()) {
          hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
          hash = (53 * hash) + getDescription().hashCode();
        }
        if (hasAttributes()) {
          hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
          hash = (53 * hash) + getAttributes().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation 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.v2.Span.TimeEvent.Annotation parseFrom(
          byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation 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.v2.Span.TimeEvent.Annotation parseDelimitedFrom(
          java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation 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.v2.Span.TimeEvent.Annotation parseFrom(
          com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
            PARSER, input, extensionRegistry);
      }

      @java.lang.Override
      public Builder newBuilderForType() {
        return newBuilder();
      }

      public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
      }

      public static Builder newBuilder(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }

      @java.lang.Override
      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;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_Annotation_descriptor;
        }

        @java.lang.Override
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_Annotation_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.class,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder.class);
        }

        // Construct using com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }

        private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }

        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
        }

        @java.lang.Override
        public Builder clear() {
          super.clear();
          if (descriptionBuilder_ == null) {
            description_ = null;
          } else {
            description_ = null;
            descriptionBuilder_ = null;
          }
          if (attributesBuilder_ == null) {
            attributes_ = null;
          } else {
            attributes_ = null;
            attributesBuilder_ = null;
          }
          return this;
        }

        @java.lang.Override
        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_Annotation_descriptor;
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation
            getDefaultInstanceForType() {
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation build() {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation buildPartial() {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation result =
              new com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation(this);
          if (descriptionBuilder_ == null) {
            result.description_ = description_;
          } else {
            result.description_ = descriptionBuilder_.build();
          }
          if (attributesBuilder_ == null) {
            result.attributes_ = attributes_;
          } else {
            result.attributes_ = attributesBuilder_.build();
          }
          onBuilt();
          return result;
        }

        @java.lang.Override
        public Builder clone() {
          return super.clone();
        }

        @java.lang.Override
        public Builder setField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.setField(field, value);
        }

        @java.lang.Override
        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
          return super.clearField(field);
        }

        @java.lang.Override
        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
          return super.clearOneof(oneof);
        }

        @java.lang.Override
        public Builder setRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field,
            int index,
            java.lang.Object value) {
          return super.setRepeatedField(field, index, value);
        }

        @java.lang.Override
        public Builder addRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.addRepeatedField(field, value);
        }

        @java.lang.Override
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) {
            return mergeFrom((com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation other) {
          if (other
              == com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance())
            return this;
          if (other.hasDescription()) {
            mergeDescription(other.getDescription());
          }
          if (other.hasAttributes()) {
            mergeAttributes(other.getAttributes());
          }
          this.mergeUnknownFields(other.unknownFields);
          onChanged();
          return this;
        }

        @java.lang.Override
        public final boolean isInitialized() {
          return true;
        }

        @java.lang.Override
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage =
                (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
                    e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }

        private com.google.devtools.cloudtrace.v2.TruncatableString description_;
        private com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.TruncatableString,
                com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
                com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>
            descriptionBuilder_;
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public boolean hasDescription() {
          return descriptionBuilder_ != null || description_ != null;
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public com.google.devtools.cloudtrace.v2.TruncatableString getDescription() {
          if (descriptionBuilder_ == null) {
            return description_ == null
                ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
                : description_;
          } else {
            return descriptionBuilder_.getMessage();
          }
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public Builder setDescription(com.google.devtools.cloudtrace.v2.TruncatableString value) {
          if (descriptionBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            description_ = value;
            onChanged();
          } else {
            descriptionBuilder_.setMessage(value);
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public Builder setDescription(
            com.google.devtools.cloudtrace.v2.TruncatableString.Builder builderForValue) {
          if (descriptionBuilder_ == null) {
            description_ = builderForValue.build();
            onChanged();
          } else {
            descriptionBuilder_.setMessage(builderForValue.build());
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public Builder mergeDescription(com.google.devtools.cloudtrace.v2.TruncatableString value) {
          if (descriptionBuilder_ == null) {
            if (description_ != null) {
              description_ =
                  com.google.devtools.cloudtrace.v2.TruncatableString.newBuilder(description_)
                      .mergeFrom(value)
                      .buildPartial();
            } else {
              description_ = value;
            }
            onChanged();
          } else {
            descriptionBuilder_.mergeFrom(value);
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public Builder clearDescription() {
          if (descriptionBuilder_ == null) {
            description_ = null;
            onChanged();
          } else {
            description_ = null;
            descriptionBuilder_ = null;
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public com.google.devtools.cloudtrace.v2.TruncatableString.Builder getDescriptionBuilder() {

          onChanged();
          return getDescriptionFieldBuilder().getBuilder();
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        public com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder
            getDescriptionOrBuilder() {
          if (descriptionBuilder_ != null) {
            return descriptionBuilder_.getMessageOrBuilder();
          } else {
            return description_ == null
                ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
                : description_;
          }
        }
        /**
         *
         *
         * <pre>
         * A user-supplied message describing the event. The maximum length for
         * the description is 256 bytes.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.TruncatableString,
                com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
                com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>
            getDescriptionFieldBuilder() {
          if (descriptionBuilder_ == null) {
            descriptionBuilder_ =
                new com.google.protobuf.SingleFieldBuilderV3<
                    com.google.devtools.cloudtrace.v2.TruncatableString,
                    com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
                    com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>(
                    getDescription(), getParentForChildren(), isClean());
            description_ = null;
          }
          return descriptionBuilder_;
        }

        private com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
        private com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.Span.Attributes,
                com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
                com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
            attributesBuilder_;
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public boolean hasAttributes() {
          return attributesBuilder_ != null || attributes_ != null;
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
          if (attributesBuilder_ == null) {
            return attributes_ == null
                ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
                : attributes_;
          } else {
            return attributesBuilder_.getMessage();
          }
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public Builder setAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
          if (attributesBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            attributes_ = value;
            onChanged();
          } else {
            attributesBuilder_.setMessage(value);
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public Builder setAttributes(
            com.google.devtools.cloudtrace.v2.Span.Attributes.Builder builderForValue) {
          if (attributesBuilder_ == null) {
            attributes_ = builderForValue.build();
            onChanged();
          } else {
            attributesBuilder_.setMessage(builderForValue.build());
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
          if (attributesBuilder_ == null) {
            if (attributes_ != null) {
              attributes_ =
                  com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_)
                      .mergeFrom(value)
                      .buildPartial();
            } else {
              attributes_ = value;
            }
            onChanged();
          } else {
            attributesBuilder_.mergeFrom(value);
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public Builder clearAttributes() {
          if (attributesBuilder_ == null) {
            attributes_ = null;
            onChanged();
          } else {
            attributes_ = null;
            attributesBuilder_ = null;
          }

          return this;
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public com.google.devtools.cloudtrace.v2.Span.Attributes.Builder getAttributesBuilder() {

          onChanged();
          return getAttributesFieldBuilder().getBuilder();
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
          if (attributesBuilder_ != null) {
            return attributesBuilder_.getMessageOrBuilder();
          } else {
            return attributes_ == null
                ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
                : attributes_;
          }
        }
        /**
         *
         *
         * <pre>
         * A set of attributes on the annotation. You can have up to 4 attributes
         * per Annotation.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 2;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.Span.Attributes,
                com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
                com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
            getAttributesFieldBuilder() {
          if (attributesBuilder_ == null) {
            attributesBuilder_ =
                new com.google.protobuf.SingleFieldBuilderV3<
                    com.google.devtools.cloudtrace.v2.Span.Attributes,
                    com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
                    com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>(
                    getAttributes(), getParentForChildren(), isClean());
            attributes_ = null;
          }
          return attributesBuilder_;
        }

        @java.lang.Override
        public final Builder setUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.setUnknownFields(unknownFields);
        }

        @java.lang.Override
        public final Builder mergeUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.mergeUnknownFields(unknownFields);
        }

        // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
      }

      // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation)
      private static final com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation();
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

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

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

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

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    public interface MessageEventOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * Type of MessageEvent. Indicates whether the message was sent or
       * received.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
       */
      int getTypeValue();
      /**
       *
       *
       * <pre>
       * Type of MessageEvent. Indicates whether the message was sent or
       * received.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
       */
      com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type getType();

      /**
       *
       *
       * <pre>
       * An identifier for the MessageEvent's message that can be used to match
       * SENT and RECEIVED MessageEvents. It is recommended to be unique within
       * a Span.
       * </pre>
       *
       * <code>int64 id = 2;</code>
       */
      long getId();

      /**
       *
       *
       * <pre>
       * The number of uncompressed bytes sent or received.
       * </pre>
       *
       * <code>int64 uncompressed_size_bytes = 3;</code>
       */
      long getUncompressedSizeBytes();

      /**
       *
       *
       * <pre>
       * The number of compressed bytes sent or received. If missing assumed to
       * be the same size as uncompressed.
       * </pre>
       *
       * <code>int64 compressed_size_bytes = 4;</code>
       */
      long getCompressedSizeBytes();
    }
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent}
     */
    public static final class MessageEvent extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
        MessageEventOrBuilder {
      private static final long serialVersionUID = 0L;
      // Use MessageEvent.newBuilder() to construct.
      private MessageEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }

      private MessageEvent() {
        type_ = 0;
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      private MessageEvent(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        this();
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder();
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 8:
                {
                  int rawValue = input.readEnum();

                  type_ = rawValue;
                  break;
                }
              case 16:
                {
                  id_ = input.readInt64();
                  break;
                }
              case 24:
                {
                  uncompressedSizeBytes_ = input.readInt64();
                  break;
                }
              case 32:
                {
                  compressedSizeBytes_ = input.readInt64();
                  break;
                }
              default:
                {
                  if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                    done = true;
                  }
                  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 {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_MessageEvent_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_MessageEvent_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.class,
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder.class);
      }

      /**
       *
       *
       * <pre>
       * Indicates whether the message was sent or received.
       * </pre>
       *
       * Protobuf enum {@code google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type}
       */
      public enum Type implements com.google.protobuf.ProtocolMessageEnum {
        /**
         *
         *
         * <pre>
         * Unknown event type.
         * </pre>
         *
         * <code>TYPE_UNSPECIFIED = 0;</code>
         */
        TYPE_UNSPECIFIED(0),
        /**
         *
         *
         * <pre>
         * Indicates a sent message.
         * </pre>
         *
         * <code>SENT = 1;</code>
         */
        SENT(1),
        /**
         *
         *
         * <pre>
         * Indicates a received message.
         * </pre>
         *
         * <code>RECEIVED = 2;</code>
         */
        RECEIVED(2),
        UNRECOGNIZED(-1),
        ;

        /**
         *
         *
         * <pre>
         * Unknown event type.
         * </pre>
         *
         * <code>TYPE_UNSPECIFIED = 0;</code>
         */
        public static final int TYPE_UNSPECIFIED_VALUE = 0;
        /**
         *
         *
         * <pre>
         * Indicates a sent message.
         * </pre>
         *
         * <code>SENT = 1;</code>
         */
        public static final int SENT_VALUE = 1;
        /**
         *
         *
         * <pre>
         * Indicates a received message.
         * </pre>
         *
         * <code>RECEIVED = 2;</code>
         */
        public static final int RECEIVED_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 Type valueOf(int value) {
          return forNumber(value);
        }

        public static Type forNumber(int value) {
          switch (value) {
            case 0:
              return TYPE_UNSPECIFIED;
            case 1:
              return SENT;
            case 2:
              return RECEIVED;
            default:
              return null;
          }
        }

        public static com.google.protobuf.Internal.EnumLiteMap<Type> internalGetValueMap() {
          return internalValueMap;
        }

        private static final com.google.protobuf.Internal.EnumLiteMap<Type> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<Type>() {
              public Type findValueByNumber(int number) {
                return Type.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.v2.Span.TimeEvent.MessageEvent.getDescriptor()
              .getEnumTypes()
              .get(0);
        }

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

        public static Type 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 Type(int value) {
          this.value = value;
        }

        // @@protoc_insertion_point(enum_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type)
      }

      public static final int TYPE_FIELD_NUMBER = 1;
      private int type_;
      /**
       *
       *
       * <pre>
       * Type of MessageEvent. Indicates whether the message was sent or
       * received.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
       */
      public int getTypeValue() {
        return type_;
      }
      /**
       *
       *
       * <pre>
       * Type of MessageEvent. Indicates whether the message was sent or
       * received.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type getType() {
        @SuppressWarnings("deprecation")
        com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type result =
            com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.valueOf(type_);
        return result == null
            ? com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.UNRECOGNIZED
            : result;
      }

      public static final int ID_FIELD_NUMBER = 2;
      private long id_;
      /**
       *
       *
       * <pre>
       * An identifier for the MessageEvent's message that can be used to match
       * SENT and RECEIVED MessageEvents. It is recommended to be unique within
       * a Span.
       * </pre>
       *
       * <code>int64 id = 2;</code>
       */
      public long getId() {
        return id_;
      }

      public static final int UNCOMPRESSED_SIZE_BYTES_FIELD_NUMBER = 3;
      private long uncompressedSizeBytes_;
      /**
       *
       *
       * <pre>
       * The number of uncompressed bytes sent or received.
       * </pre>
       *
       * <code>int64 uncompressed_size_bytes = 3;</code>
       */
      public long getUncompressedSizeBytes() {
        return uncompressedSizeBytes_;
      }

      public static final int COMPRESSED_SIZE_BYTES_FIELD_NUMBER = 4;
      private long compressedSizeBytes_;
      /**
       *
       *
       * <pre>
       * The number of compressed bytes sent or received. If missing assumed to
       * be the same size as uncompressed.
       * </pre>
       *
       * <code>int64 compressed_size_bytes = 4;</code>
       */
      public long getCompressedSizeBytes() {
        return compressedSizeBytes_;
      }

      private byte memoizedIsInitialized = -1;

      @java.lang.Override
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;

        memoizedIsInitialized = 1;
        return true;
      }

      @java.lang.Override
      public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        if (type_
            != com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.TYPE_UNSPECIFIED
                .getNumber()) {
          output.writeEnum(1, type_);
        }
        if (id_ != 0L) {
          output.writeInt64(2, id_);
        }
        if (uncompressedSizeBytes_ != 0L) {
          output.writeInt64(3, uncompressedSizeBytes_);
        }
        if (compressedSizeBytes_ != 0L) {
          output.writeInt64(4, compressedSizeBytes_);
        }
        unknownFields.writeTo(output);
      }

      @java.lang.Override
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;

        size = 0;
        if (type_
            != com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.TYPE_UNSPECIFIED
                .getNumber()) {
          size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_);
        }
        if (id_ != 0L) {
          size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, id_);
        }
        if (uncompressedSizeBytes_ != 0L) {
          size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, uncompressedSizeBytes_);
        }
        if (compressedSizeBytes_ != 0L) {
          size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, compressedSizeBytes_);
        }
        size += unknownFields.getSerializedSize();
        memoizedSize = size;
        return size;
      }

      @java.lang.Override
      public boolean equals(final java.lang.Object obj) {
        if (obj == this) {
          return true;
        }
        if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)) {
          return super.equals(obj);
        }
        com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent other =
            (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) obj;

        if (type_ != other.type_) return false;
        if (getId() != other.getId()) return false;
        if (getUncompressedSizeBytes() != other.getUncompressedSizeBytes()) return false;
        if (getCompressedSizeBytes() != other.getCompressedSizeBytes()) return false;
        if (!unknownFields.equals(other.unknownFields)) return false;
        return true;
      }

      @java.lang.Override
      public int hashCode() {
        if (memoizedHashCode != 0) {
          return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        hash = (37 * hash) + TYPE_FIELD_NUMBER;
        hash = (53 * hash) + type_;
        hash = (37 * hash) + ID_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getId());
        hash = (37 * hash) + UNCOMPRESSED_SIZE_BYTES_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUncompressedSizeBytes());
        hash = (37 * hash) + COMPRESSED_SIZE_BYTES_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCompressedSizeBytes());
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent 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.v2.Span.TimeEvent.MessageEvent parseFrom(
          byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent 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.v2.Span.TimeEvent.MessageEvent
          parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
          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.v2.Span.TimeEvent.MessageEvent parseFrom(
          com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
            PARSER, input, extensionRegistry);
      }

      @java.lang.Override
      public Builder newBuilderForType() {
        return newBuilder();
      }

      public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
      }

      public static Builder newBuilder(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }

      @java.lang.Override
      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;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_MessageEvent_descriptor;
        }

        @java.lang.Override
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_MessageEvent_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.class,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder.class);
        }

        // Construct using
        // com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }

        private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }

        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
        }

        @java.lang.Override
        public Builder clear() {
          super.clear();
          type_ = 0;

          id_ = 0L;

          uncompressedSizeBytes_ = 0L;

          compressedSizeBytes_ = 0L;

          return this;
        }

        @java.lang.Override
        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
          return com.google.devtools.cloudtrace.v2.TraceProto
              .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_MessageEvent_descriptor;
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
            getDefaultInstanceForType() {
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent build() {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent buildPartial() {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent result =
              new com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent(this);
          result.type_ = type_;
          result.id_ = id_;
          result.uncompressedSizeBytes_ = uncompressedSizeBytes_;
          result.compressedSizeBytes_ = compressedSizeBytes_;
          onBuilt();
          return result;
        }

        @java.lang.Override
        public Builder clone() {
          return super.clone();
        }

        @java.lang.Override
        public Builder setField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.setField(field, value);
        }

        @java.lang.Override
        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
          return super.clearField(field);
        }

        @java.lang.Override
        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
          return super.clearOneof(oneof);
        }

        @java.lang.Override
        public Builder setRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field,
            int index,
            java.lang.Object value) {
          return super.setRepeatedField(field, index, value);
        }

        @java.lang.Override
        public Builder addRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.addRepeatedField(field, value);
        }

        @java.lang.Override
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) {
            return mergeFrom((com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent other) {
          if (other
              == com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance())
            return this;
          if (other.type_ != 0) {
            setTypeValue(other.getTypeValue());
          }
          if (other.getId() != 0L) {
            setId(other.getId());
          }
          if (other.getUncompressedSizeBytes() != 0L) {
            setUncompressedSizeBytes(other.getUncompressedSizeBytes());
          }
          if (other.getCompressedSizeBytes() != 0L) {
            setCompressedSizeBytes(other.getCompressedSizeBytes());
          }
          this.mergeUnknownFields(other.unknownFields);
          onChanged();
          return this;
        }

        @java.lang.Override
        public final boolean isInitialized() {
          return true;
        }

        @java.lang.Override
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage =
                (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
                    e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }

        private int type_ = 0;
        /**
         *
         *
         * <pre>
         * Type of MessageEvent. Indicates whether the message was sent or
         * received.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
         */
        public int getTypeValue() {
          return type_;
        }
        /**
         *
         *
         * <pre>
         * Type of MessageEvent. Indicates whether the message was sent or
         * received.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
         */
        public Builder setTypeValue(int value) {
          type_ = value;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Type of MessageEvent. Indicates whether the message was sent or
         * received.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
         */
        public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type getType() {
          @SuppressWarnings("deprecation")
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type result =
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.valueOf(type_);
          return result == null
              ? com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type.UNRECOGNIZED
              : result;
        }
        /**
         *
         *
         * <pre>
         * Type of MessageEvent. Indicates whether the message was sent or
         * received.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
         */
        public Builder setType(
            com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type value) {
          if (value == null) {
            throw new NullPointerException();
          }

          type_ = value.getNumber();
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Type of MessageEvent. Indicates whether the message was sent or
         * received.
         * </pre>
         *
         * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;</code>
         */
        public Builder clearType() {

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

        private long id_;
        /**
         *
         *
         * <pre>
         * An identifier for the MessageEvent's message that can be used to match
         * SENT and RECEIVED MessageEvents. It is recommended to be unique within
         * a Span.
         * </pre>
         *
         * <code>int64 id = 2;</code>
         */
        public long getId() {
          return id_;
        }
        /**
         *
         *
         * <pre>
         * An identifier for the MessageEvent's message that can be used to match
         * SENT and RECEIVED MessageEvents. It is recommended to be unique within
         * a Span.
         * </pre>
         *
         * <code>int64 id = 2;</code>
         */
        public Builder setId(long value) {

          id_ = value;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * An identifier for the MessageEvent's message that can be used to match
         * SENT and RECEIVED MessageEvents. It is recommended to be unique within
         * a Span.
         * </pre>
         *
         * <code>int64 id = 2;</code>
         */
        public Builder clearId() {

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

        private long uncompressedSizeBytes_;
        /**
         *
         *
         * <pre>
         * The number of uncompressed bytes sent or received.
         * </pre>
         *
         * <code>int64 uncompressed_size_bytes = 3;</code>
         */
        public long getUncompressedSizeBytes() {
          return uncompressedSizeBytes_;
        }
        /**
         *
         *
         * <pre>
         * The number of uncompressed bytes sent or received.
         * </pre>
         *
         * <code>int64 uncompressed_size_bytes = 3;</code>
         */
        public Builder setUncompressedSizeBytes(long value) {

          uncompressedSizeBytes_ = value;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * The number of uncompressed bytes sent or received.
         * </pre>
         *
         * <code>int64 uncompressed_size_bytes = 3;</code>
         */
        public Builder clearUncompressedSizeBytes() {

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

        private long compressedSizeBytes_;
        /**
         *
         *
         * <pre>
         * The number of compressed bytes sent or received. If missing assumed to
         * be the same size as uncompressed.
         * </pre>
         *
         * <code>int64 compressed_size_bytes = 4;</code>
         */
        public long getCompressedSizeBytes() {
          return compressedSizeBytes_;
        }
        /**
         *
         *
         * <pre>
         * The number of compressed bytes sent or received. If missing assumed to
         * be the same size as uncompressed.
         * </pre>
         *
         * <code>int64 compressed_size_bytes = 4;</code>
         */
        public Builder setCompressedSizeBytes(long value) {

          compressedSizeBytes_ = value;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * The number of compressed bytes sent or received. If missing assumed to
         * be the same size as uncompressed.
         * </pre>
         *
         * <code>int64 compressed_size_bytes = 4;</code>
         */
        public Builder clearCompressedSizeBytes() {

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

        @java.lang.Override
        public final Builder setUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.setUnknownFields(unknownFields);
        }

        @java.lang.Override
        public final Builder mergeUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.mergeUnknownFields(unknownFields);
        }

        // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
      }

      // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent)
      private static final com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent();
      }

      public static com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

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

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

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

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    private int valueCase_ = 0;
    private java.lang.Object value_;

    public enum ValueCase implements com.google.protobuf.Internal.EnumLite {
      ANNOTATION(2),
      MESSAGE_EVENT(3),
      VALUE_NOT_SET(0);
      private final int value;

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

      public static ValueCase forNumber(int value) {
        switch (value) {
          case 2:
            return ANNOTATION;
          case 3:
            return MESSAGE_EVENT;
          case 0:
            return VALUE_NOT_SET;
          default:
            return null;
        }
      }

      public int getNumber() {
        return this.value;
      }
    };

    public ValueCase getValueCase() {
      return ValueCase.forNumber(valueCase_);
    }

    public static final int TIME_FIELD_NUMBER = 1;
    private com.google.protobuf.Timestamp time_;
    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    public boolean hasTime() {
      return time_ != null;
    }
    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    public com.google.protobuf.Timestamp getTime() {
      return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
    }
    /**
     *
     *
     * <pre>
     * The timestamp indicating the time the event occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
      return getTime();
    }

    public static final int ANNOTATION_FIELD_NUMBER = 2;
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    public boolean hasAnnotation() {
      return valueCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation getAnnotation() {
      if (valueCase_ == 2) {
        return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_;
      }
      return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
    }
    /**
     *
     *
     * <pre>
     * Text annotation with a set of attributes.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder
        getAnnotationOrBuilder() {
      if (valueCase_ == 2) {
        return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_;
      }
      return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
    }

    public static final int MESSAGE_EVENT_FIELD_NUMBER = 3;
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    public boolean hasMessageEvent() {
      return valueCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent getMessageEvent() {
      if (valueCase_ == 3) {
        return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_;
      }
      return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
    }
    /**
     *
     *
     * <pre>
     * An event describing a message sent/received between Spans.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder
        getMessageEventOrBuilder() {
      if (valueCase_ == 3) {
        return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_;
      }
      return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (time_ != null) {
        output.writeMessage(1, getTime());
      }
      if (valueCase_ == 2) {
        output.writeMessage(
            2, (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_);
      }
      if (valueCase_ == 3) {
        output.writeMessage(
            3, (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (time_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTime());
      }
      if (valueCase_ == 2) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                2, (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_);
      }
      if (valueCase_ == 3) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                3, (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent)) {
        return super.equals(obj);
      }
      com.google.devtools.cloudtrace.v2.Span.TimeEvent other =
          (com.google.devtools.cloudtrace.v2.Span.TimeEvent) obj;

      if (hasTime() != other.hasTime()) return false;
      if (hasTime()) {
        if (!getTime().equals(other.getTime())) return false;
      }
      if (!getValueCase().equals(other.getValueCase())) return false;
      switch (valueCase_) {
        case 2:
          if (!getAnnotation().equals(other.getAnnotation())) return false;
          break;
        case 3:
          if (!getMessageEvent().equals(other.getMessageEvent())) return false;
          break;
        case 0:
        default:
      }
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (hasTime()) {
        hash = (37 * hash) + TIME_FIELD_NUMBER;
        hash = (53 * hash) + getTime().hashCode();
      }
      switch (valueCase_) {
        case 2:
          hash = (37 * hash) + ANNOTATION_FIELD_NUMBER;
          hash = (53 * hash) + getAnnotation().hashCode();
          break;
        case 3:
          hash = (37 * hash) + MESSAGE_EVENT_FIELD_NUMBER;
          hash = (53 * hash) + getMessageEvent().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent 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.v2.Span.TimeEvent parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent 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.v2.Span.TimeEvent parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent 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.v2.Span.TimeEvent parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span.TimeEvent prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    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;
    }
    /**
     *
     *
     * <pre>
     * A time-stamped annotation or message event in the Span.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvent}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.TimeEvent)
        com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.class,
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder.class);
      }

      // Construct using com.google.devtools.cloudtrace.v2.Span.TimeEvent.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        if (timeBuilder_ == null) {
          time_ = null;
        } else {
          time_ = null;
          timeBuilder_ = null;
        }
        valueCase_ = 0;
        value_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvent_descriptor;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent getDefaultInstanceForType() {
        return com.google.devtools.cloudtrace.v2.Span.TimeEvent.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent build() {
        com.google.devtools.cloudtrace.v2.Span.TimeEvent result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent buildPartial() {
        com.google.devtools.cloudtrace.v2.Span.TimeEvent result =
            new com.google.devtools.cloudtrace.v2.Span.TimeEvent(this);
        if (timeBuilder_ == null) {
          result.time_ = time_;
        } else {
          result.time_ = timeBuilder_.build();
        }
        if (valueCase_ == 2) {
          if (annotationBuilder_ == null) {
            result.value_ = value_;
          } else {
            result.value_ = annotationBuilder_.build();
          }
        }
        if (valueCase_ == 3) {
          if (messageEventBuilder_ == null) {
            result.value_ = value_;
          } else {
            result.value_ = messageEventBuilder_.build();
          }
        }
        result.valueCase_ = valueCase_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvent) {
          return mergeFrom((com.google.devtools.cloudtrace.v2.Span.TimeEvent) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.TimeEvent other) {
        if (other == com.google.devtools.cloudtrace.v2.Span.TimeEvent.getDefaultInstance())
          return this;
        if (other.hasTime()) {
          mergeTime(other.getTime());
        }
        switch (other.getValueCase()) {
          case ANNOTATION:
            {
              mergeAnnotation(other.getAnnotation());
              break;
            }
          case MESSAGE_EVENT:
            {
              mergeMessageEvent(other.getMessageEvent());
              break;
            }
          case VALUE_NOT_SET:
            {
              break;
            }
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.devtools.cloudtrace.v2.Span.TimeEvent parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage =
              (com.google.devtools.cloudtrace.v2.Span.TimeEvent) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int valueCase_ = 0;
      private java.lang.Object value_;

      public ValueCase getValueCase() {
        return ValueCase.forNumber(valueCase_);
      }

      public Builder clearValue() {
        valueCase_ = 0;
        value_ = null;
        onChanged();
        return this;
      }

      private com.google.protobuf.Timestamp time_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          timeBuilder_;
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public boolean hasTime() {
        return timeBuilder_ != null || time_ != null;
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public com.google.protobuf.Timestamp getTime() {
        if (timeBuilder_ == null) {
          return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
        } else {
          return timeBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder setTime(com.google.protobuf.Timestamp value) {
        if (timeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          time_ = value;
          onChanged();
        } else {
          timeBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
        if (timeBuilder_ == null) {
          time_ = builderForValue.build();
          onChanged();
        } else {
          timeBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder mergeTime(com.google.protobuf.Timestamp value) {
        if (timeBuilder_ == null) {
          if (time_ != null) {
            time_ = com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial();
          } else {
            time_ = value;
          }
          onChanged();
        } else {
          timeBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder clearTime() {
        if (timeBuilder_ == null) {
          time_ = null;
          onChanged();
        } else {
          time_ = null;
          timeBuilder_ = null;
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public com.google.protobuf.Timestamp.Builder getTimeBuilder() {

        onChanged();
        return getTimeFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
        if (timeBuilder_ != null) {
          return timeBuilder_.getMessageOrBuilder();
        } else {
          return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
        }
      }
      /**
       *
       *
       * <pre>
       * The timestamp indicating the time the event occurred.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          getTimeFieldBuilder() {
        if (timeBuilder_ == null) {
          timeBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.protobuf.Timestamp,
                  com.google.protobuf.Timestamp.Builder,
                  com.google.protobuf.TimestampOrBuilder>(
                  getTime(), getParentForChildren(), isClean());
          time_ = null;
        }
        return timeBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder>
          annotationBuilder_;
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public boolean hasAnnotation() {
        return valueCase_ == 2;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation getAnnotation() {
        if (annotationBuilder_ == null) {
          if (valueCase_ == 2) {
            return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_;
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
        } else {
          if (valueCase_ == 2) {
            return annotationBuilder_.getMessage();
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public Builder setAnnotation(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation value) {
        if (annotationBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          value_ = value;
          onChanged();
        } else {
          annotationBuilder_.setMessage(value);
        }
        valueCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public Builder setAnnotation(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder builderForValue) {
        if (annotationBuilder_ == null) {
          value_ = builderForValue.build();
          onChanged();
        } else {
          annotationBuilder_.setMessage(builderForValue.build());
        }
        valueCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public Builder mergeAnnotation(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation value) {
        if (annotationBuilder_ == null) {
          if (valueCase_ == 2
              && value_
                  != com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation
                      .getDefaultInstance()) {
            value_ =
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.newBuilder(
                        (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            value_ = value;
          }
          onChanged();
        } else {
          if (valueCase_ == 2) {
            annotationBuilder_.mergeFrom(value);
          }
          annotationBuilder_.setMessage(value);
        }
        valueCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public Builder clearAnnotation() {
        if (annotationBuilder_ == null) {
          if (valueCase_ == 2) {
            valueCase_ = 0;
            value_ = null;
            onChanged();
          }
        } else {
          if (valueCase_ == 2) {
            valueCase_ = 0;
            value_ = null;
          }
          annotationBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder
          getAnnotationBuilder() {
        return getAnnotationFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder
          getAnnotationOrBuilder() {
        if ((valueCase_ == 2) && (annotationBuilder_ != null)) {
          return annotationBuilder_.getMessageOrBuilder();
        } else {
          if (valueCase_ == 2) {
            return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_;
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * Text annotation with a set of attributes.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation annotation = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder>
          getAnnotationFieldBuilder() {
        if (annotationBuilder_ == null) {
          if (!(valueCase_ == 2)) {
            value_ =
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.getDefaultInstance();
          }
          annotationBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.Builder,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationOrBuilder>(
                  (com.google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) value_,
                  getParentForChildren(),
                  isClean());
          value_ = null;
        }
        valueCase_ = 2;
        onChanged();
        ;
        return annotationBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder>
          messageEventBuilder_;
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public boolean hasMessageEvent() {
        return valueCase_ == 3;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent getMessageEvent() {
        if (messageEventBuilder_ == null) {
          if (valueCase_ == 3) {
            return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_;
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
        } else {
          if (valueCase_ == 3) {
            return messageEventBuilder_.getMessage();
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public Builder setMessageEvent(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent value) {
        if (messageEventBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          value_ = value;
          onChanged();
        } else {
          messageEventBuilder_.setMessage(value);
        }
        valueCase_ = 3;
        return this;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public Builder setMessageEvent(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder builderForValue) {
        if (messageEventBuilder_ == null) {
          value_ = builderForValue.build();
          onChanged();
        } else {
          messageEventBuilder_.setMessage(builderForValue.build());
        }
        valueCase_ = 3;
        return this;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public Builder mergeMessageEvent(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent value) {
        if (messageEventBuilder_ == null) {
          if (valueCase_ == 3
              && value_
                  != com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
                      .getDefaultInstance()) {
            value_ =
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.newBuilder(
                        (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            value_ = value;
          }
          onChanged();
        } else {
          if (valueCase_ == 3) {
            messageEventBuilder_.mergeFrom(value);
          }
          messageEventBuilder_.setMessage(value);
        }
        valueCase_ = 3;
        return this;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public Builder clearMessageEvent() {
        if (messageEventBuilder_ == null) {
          if (valueCase_ == 3) {
            valueCase_ = 0;
            value_ = null;
            onChanged();
          }
        } else {
          if (valueCase_ == 3) {
            valueCase_ = 0;
            value_ = null;
          }
          messageEventBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder
          getMessageEventBuilder() {
        return getMessageEventFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder
          getMessageEventOrBuilder() {
        if ((valueCase_ == 3) && (messageEventBuilder_ != null)) {
          return messageEventBuilder_.getMessageOrBuilder();
        } else {
          if (valueCase_ == 3) {
            return (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_;
          }
          return com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * An event describing a message sent/received between Spans.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent message_event = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder>
          getMessageEventFieldBuilder() {
        if (messageEventBuilder_ == null) {
          if (!(valueCase_ == 3)) {
            value_ =
                com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.getDefaultInstance();
          }
          messageEventBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Builder,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventOrBuilder>(
                  (com.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) value_,
                  getParentForChildren(),
                  isClean());
          value_ = null;
        }
        valueCase_ = 3;
        onChanged();
        ;
        return messageEventBuilder_;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.TimeEvent)
    }

    // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent)
    private static final com.google.devtools.cloudtrace.v2.Span.TimeEvent DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.TimeEvent();
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvent getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface TimeEventsOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.TimeEvents)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent> getTimeEventList();
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEvent getTimeEvent(int index);
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    int getTimeEventCount();
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>
        getTimeEventOrBuilderList();
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder getTimeEventOrBuilder(int index);

    /**
     *
     *
     * <pre>
     * The number of dropped annotations in all the included time events.
     * If the value is 0, then no annotations were dropped.
     * </pre>
     *
     * <code>int32 dropped_annotations_count = 2;</code>
     */
    int getDroppedAnnotationsCount();

    /**
     *
     *
     * <pre>
     * The number of dropped message events in all the included time events.
     * If the value is 0, then no message events were dropped.
     * </pre>
     *
     * <code>int32 dropped_message_events_count = 3;</code>
     */
    int getDroppedMessageEventsCount();
  }
  /**
   *
   *
   * <pre>
   * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
   * on the span, consisting of either user-supplied key:value pairs, or
   * details of a message sent/received between Spans.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvents}
   */
  public static final class TimeEvents extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.TimeEvents)
      TimeEventsOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use TimeEvents.newBuilder() to construct.
    private TimeEvents(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private TimeEvents() {
      timeEvent_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private TimeEvents(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                  timeEvent_ =
                      new java.util.ArrayList<com.google.devtools.cloudtrace.v2.Span.TimeEvent>();
                  mutable_bitField0_ |= 0x00000001;
                }
                timeEvent_.add(
                    input.readMessage(
                        com.google.devtools.cloudtrace.v2.Span.TimeEvent.parser(),
                        extensionRegistry));
                break;
              }
            case 16:
              {
                droppedAnnotationsCount_ = input.readInt32();
                break;
              }
            case 24:
              {
                droppedMessageEventsCount_ = input.readInt32();
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                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 {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          timeEvent_ = java.util.Collections.unmodifiableList(timeEvent_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvents_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvents_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.TimeEvents.class,
              com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder.class);
    }

    private int bitField0_;
    public static final int TIME_EVENT_FIELD_NUMBER = 1;
    private java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent> timeEvent_;
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    public java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent> getTimeEventList() {
      return timeEvent_;
    }
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    public java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>
        getTimeEventOrBuilderList() {
      return timeEvent_;
    }
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    public int getTimeEventCount() {
      return timeEvent_.size();
    }
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvent getTimeEvent(int index) {
      return timeEvent_.get(index);
    }
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder getTimeEventOrBuilder(
        int index) {
      return timeEvent_.get(index);
    }

    public static final int DROPPED_ANNOTATIONS_COUNT_FIELD_NUMBER = 2;
    private int droppedAnnotationsCount_;
    /**
     *
     *
     * <pre>
     * The number of dropped annotations in all the included time events.
     * If the value is 0, then no annotations were dropped.
     * </pre>
     *
     * <code>int32 dropped_annotations_count = 2;</code>
     */
    public int getDroppedAnnotationsCount() {
      return droppedAnnotationsCount_;
    }

    public static final int DROPPED_MESSAGE_EVENTS_COUNT_FIELD_NUMBER = 3;
    private int droppedMessageEventsCount_;
    /**
     *
     *
     * <pre>
     * The number of dropped message events in all the included time events.
     * If the value is 0, then no message events were dropped.
     * </pre>
     *
     * <code>int32 dropped_message_events_count = 3;</code>
     */
    public int getDroppedMessageEventsCount() {
      return droppedMessageEventsCount_;
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      for (int i = 0; i < timeEvent_.size(); i++) {
        output.writeMessage(1, timeEvent_.get(i));
      }
      if (droppedAnnotationsCount_ != 0) {
        output.writeInt32(2, droppedAnnotationsCount_);
      }
      if (droppedMessageEventsCount_ != 0) {
        output.writeInt32(3, droppedMessageEventsCount_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < timeEvent_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, timeEvent_.get(i));
      }
      if (droppedAnnotationsCount_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, droppedAnnotationsCount_);
      }
      if (droppedMessageEventsCount_ != 0) {
        size +=
            com.google.protobuf.CodedOutputStream.computeInt32Size(3, droppedMessageEventsCount_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvents)) {
        return super.equals(obj);
      }
      com.google.devtools.cloudtrace.v2.Span.TimeEvents other =
          (com.google.devtools.cloudtrace.v2.Span.TimeEvents) obj;

      if (!getTimeEventList().equals(other.getTimeEventList())) return false;
      if (getDroppedAnnotationsCount() != other.getDroppedAnnotationsCount()) return false;
      if (getDroppedMessageEventsCount() != other.getDroppedMessageEventsCount()) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getTimeEventCount() > 0) {
        hash = (37 * hash) + TIME_EVENT_FIELD_NUMBER;
        hash = (53 * hash) + getTimeEventList().hashCode();
      }
      hash = (37 * hash) + DROPPED_ANNOTATIONS_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + getDroppedAnnotationsCount();
      hash = (37 * hash) + DROPPED_MESSAGE_EVENTS_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + getDroppedMessageEventsCount();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents 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.v2.Span.TimeEvents parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents 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.v2.Span.TimeEvents parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents 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.v2.Span.TimeEvents parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span.TimeEvents prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    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;
    }
    /**
     *
     *
     * <pre>
     * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
     * on the span, consisting of either user-supplied key:value pairs, or
     * details of a message sent/received between Spans.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.TimeEvents}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.TimeEvents)
        com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvents_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvents_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.TimeEvents.class,
                com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder.class);
      }

      // Construct using com.google.devtools.cloudtrace.v2.Span.TimeEvents.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
          getTimeEventFieldBuilder();
        }
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        if (timeEventBuilder_ == null) {
          timeEvent_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          timeEventBuilder_.clear();
        }
        droppedAnnotationsCount_ = 0;

        droppedMessageEventsCount_ = 0;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_TimeEvents_descriptor;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvents getDefaultInstanceForType() {
        return com.google.devtools.cloudtrace.v2.Span.TimeEvents.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvents build() {
        com.google.devtools.cloudtrace.v2.Span.TimeEvents result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.TimeEvents buildPartial() {
        com.google.devtools.cloudtrace.v2.Span.TimeEvents result =
            new com.google.devtools.cloudtrace.v2.Span.TimeEvents(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (timeEventBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)) {
            timeEvent_ = java.util.Collections.unmodifiableList(timeEvent_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.timeEvent_ = timeEvent_;
        } else {
          result.timeEvent_ = timeEventBuilder_.build();
        }
        result.droppedAnnotationsCount_ = droppedAnnotationsCount_;
        result.droppedMessageEventsCount_ = droppedMessageEventsCount_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.devtools.cloudtrace.v2.Span.TimeEvents) {
          return mergeFrom((com.google.devtools.cloudtrace.v2.Span.TimeEvents) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.TimeEvents other) {
        if (other == com.google.devtools.cloudtrace.v2.Span.TimeEvents.getDefaultInstance())
          return this;
        if (timeEventBuilder_ == null) {
          if (!other.timeEvent_.isEmpty()) {
            if (timeEvent_.isEmpty()) {
              timeEvent_ = other.timeEvent_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureTimeEventIsMutable();
              timeEvent_.addAll(other.timeEvent_);
            }
            onChanged();
          }
        } else {
          if (!other.timeEvent_.isEmpty()) {
            if (timeEventBuilder_.isEmpty()) {
              timeEventBuilder_.dispose();
              timeEventBuilder_ = null;
              timeEvent_ = other.timeEvent_;
              bitField0_ = (bitField0_ & ~0x00000001);
              timeEventBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                      ? getTimeEventFieldBuilder()
                      : null;
            } else {
              timeEventBuilder_.addAllMessages(other.timeEvent_);
            }
          }
        }
        if (other.getDroppedAnnotationsCount() != 0) {
          setDroppedAnnotationsCount(other.getDroppedAnnotationsCount());
        }
        if (other.getDroppedMessageEventsCount() != 0) {
          setDroppedMessageEventsCount(other.getDroppedMessageEventsCount());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.devtools.cloudtrace.v2.Span.TimeEvents parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage =
              (com.google.devtools.cloudtrace.v2.Span.TimeEvents) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent> timeEvent_ =
          java.util.Collections.emptyList();

      private void ensureTimeEventIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          timeEvent_ =
              new java.util.ArrayList<com.google.devtools.cloudtrace.v2.Span.TimeEvent>(timeEvent_);
          bitField0_ |= 0x00000001;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>
          timeEventBuilder_;

      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent> getTimeEventList() {
        if (timeEventBuilder_ == null) {
          return java.util.Collections.unmodifiableList(timeEvent_);
        } else {
          return timeEventBuilder_.getMessageList();
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public int getTimeEventCount() {
        if (timeEventBuilder_ == null) {
          return timeEvent_.size();
        } else {
          return timeEventBuilder_.getCount();
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent getTimeEvent(int index) {
        if (timeEventBuilder_ == null) {
          return timeEvent_.get(index);
        } else {
          return timeEventBuilder_.getMessage(index);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder setTimeEvent(
          int index, com.google.devtools.cloudtrace.v2.Span.TimeEvent value) {
        if (timeEventBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTimeEventIsMutable();
          timeEvent_.set(index, value);
          onChanged();
        } else {
          timeEventBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder setTimeEvent(
          int index, com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder builderForValue) {
        if (timeEventBuilder_ == null) {
          ensureTimeEventIsMutable();
          timeEvent_.set(index, builderForValue.build());
          onChanged();
        } else {
          timeEventBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder addTimeEvent(com.google.devtools.cloudtrace.v2.Span.TimeEvent value) {
        if (timeEventBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTimeEventIsMutable();
          timeEvent_.add(value);
          onChanged();
        } else {
          timeEventBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder addTimeEvent(
          int index, com.google.devtools.cloudtrace.v2.Span.TimeEvent value) {
        if (timeEventBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTimeEventIsMutable();
          timeEvent_.add(index, value);
          onChanged();
        } else {
          timeEventBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder addTimeEvent(
          com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder builderForValue) {
        if (timeEventBuilder_ == null) {
          ensureTimeEventIsMutable();
          timeEvent_.add(builderForValue.build());
          onChanged();
        } else {
          timeEventBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder addTimeEvent(
          int index, com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder builderForValue) {
        if (timeEventBuilder_ == null) {
          ensureTimeEventIsMutable();
          timeEvent_.add(index, builderForValue.build());
          onChanged();
        } else {
          timeEventBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder addAllTimeEvent(
          java.lang.Iterable<? extends com.google.devtools.cloudtrace.v2.Span.TimeEvent> values) {
        if (timeEventBuilder_ == null) {
          ensureTimeEventIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeEvent_);
          onChanged();
        } else {
          timeEventBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder clearTimeEvent() {
        if (timeEventBuilder_ == null) {
          timeEvent_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          timeEventBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public Builder removeTimeEvent(int index) {
        if (timeEventBuilder_ == null) {
          ensureTimeEventIsMutable();
          timeEvent_.remove(index);
          onChanged();
        } else {
          timeEventBuilder_.remove(index);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder getTimeEventBuilder(
          int index) {
        return getTimeEventFieldBuilder().getBuilder(index);
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder getTimeEventOrBuilder(
          int index) {
        if (timeEventBuilder_ == null) {
          return timeEvent_.get(index);
        } else {
          return timeEventBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>
          getTimeEventOrBuilderList() {
        if (timeEventBuilder_ != null) {
          return timeEventBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(timeEvent_);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder addTimeEventBuilder() {
        return getTimeEventFieldBuilder()
            .addBuilder(com.google.devtools.cloudtrace.v2.Span.TimeEvent.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder addTimeEventBuilder(
          int index) {
        return getTimeEventFieldBuilder()
            .addBuilder(
                index, com.google.devtools.cloudtrace.v2.Span.TimeEvent.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * A collection of `TimeEvent`s.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
       */
      public java.util.List<com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder>
          getTimeEventBuilderList() {
        return getTimeEventFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.TimeEvent,
              com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder,
              com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>
          getTimeEventFieldBuilder() {
        if (timeEventBuilder_ == null) {
          timeEventBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent,
                  com.google.devtools.cloudtrace.v2.Span.TimeEvent.Builder,
                  com.google.devtools.cloudtrace.v2.Span.TimeEventOrBuilder>(
                  timeEvent_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
          timeEvent_ = null;
        }
        return timeEventBuilder_;
      }

      private int droppedAnnotationsCount_;
      /**
       *
       *
       * <pre>
       * The number of dropped annotations in all the included time events.
       * If the value is 0, then no annotations were dropped.
       * </pre>
       *
       * <code>int32 dropped_annotations_count = 2;</code>
       */
      public int getDroppedAnnotationsCount() {
        return droppedAnnotationsCount_;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped annotations in all the included time events.
       * If the value is 0, then no annotations were dropped.
       * </pre>
       *
       * <code>int32 dropped_annotations_count = 2;</code>
       */
      public Builder setDroppedAnnotationsCount(int value) {

        droppedAnnotationsCount_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped annotations in all the included time events.
       * If the value is 0, then no annotations were dropped.
       * </pre>
       *
       * <code>int32 dropped_annotations_count = 2;</code>
       */
      public Builder clearDroppedAnnotationsCount() {

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

      private int droppedMessageEventsCount_;
      /**
       *
       *
       * <pre>
       * The number of dropped message events in all the included time events.
       * If the value is 0, then no message events were dropped.
       * </pre>
       *
       * <code>int32 dropped_message_events_count = 3;</code>
       */
      public int getDroppedMessageEventsCount() {
        return droppedMessageEventsCount_;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped message events in all the included time events.
       * If the value is 0, then no message events were dropped.
       * </pre>
       *
       * <code>int32 dropped_message_events_count = 3;</code>
       */
      public Builder setDroppedMessageEventsCount(int value) {

        droppedMessageEventsCount_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped message events in all the included time events.
       * If the value is 0, then no message events were dropped.
       * </pre>
       *
       * <code>int32 dropped_message_events_count = 3;</code>
       */
      public Builder clearDroppedMessageEventsCount() {

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

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.TimeEvents)
    }

    // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvents)
    private static final com.google.devtools.cloudtrace.v2.Span.TimeEvents DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.TimeEvents();
    }

    public static com.google.devtools.cloudtrace.v2.Span.TimeEvents getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span.TimeEvents getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface LinkOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.Link)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The [TRACE_ID] for a trace within a project.
     * </pre>
     *
     * <code>string trace_id = 1;</code>
     */
    java.lang.String getTraceId();
    /**
     *
     *
     * <pre>
     * The [TRACE_ID] for a trace within a project.
     * </pre>
     *
     * <code>string trace_id = 1;</code>
     */
    com.google.protobuf.ByteString getTraceIdBytes();

    /**
     *
     *
     * <pre>
     * The [SPAN_ID] for a span within a trace.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    java.lang.String getSpanId();
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] for a span within a trace.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    com.google.protobuf.ByteString getSpanIdBytes();

    /**
     *
     *
     * <pre>
     * The relationship of the current span relative to the linked span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
     */
    int getTypeValue();
    /**
     *
     *
     * <pre>
     * The relationship of the current span relative to the linked span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.Link.Type getType();

    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    boolean hasAttributes();
    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes();
    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder();
  }
  /**
   *
   *
   * <pre>
   * A pointer from the current span to another span in the same trace or in a
   * different trace. For example, this can be used in batching operations,
   * where a single batch handler processes multiple requests from different
   * traces or when the handler receives a request from a different project.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Link}
   */
  public static final class Link extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.Link)
      LinkOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Link.newBuilder() to construct.
    private Link(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Link() {
      traceId_ = "";
      spanId_ = "";
      type_ = 0;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private Link(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                java.lang.String s = input.readStringRequireUtf8();

                traceId_ = s;
                break;
              }
            case 18:
              {
                java.lang.String s = input.readStringRequireUtf8();

                spanId_ = s;
                break;
              }
            case 24:
              {
                int rawValue = input.readEnum();

                type_ = rawValue;
                break;
              }
            case 34:
              {
                com.google.devtools.cloudtrace.v2.Span.Attributes.Builder subBuilder = null;
                if (attributes_ != null) {
                  subBuilder = attributes_.toBuilder();
                }
                attributes_ =
                    input.readMessage(
                        com.google.devtools.cloudtrace.v2.Span.Attributes.parser(),
                        extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(attributes_);
                  attributes_ = subBuilder.buildPartial();
                }

                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                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 {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Link_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Link_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.Link.class,
              com.google.devtools.cloudtrace.v2.Span.Link.Builder.class);
    }

    /**
     *
     *
     * <pre>
     * The relationship of the current span relative to the linked span: child,
     * parent, or unspecified.
     * </pre>
     *
     * Protobuf enum {@code google.devtools.cloudtrace.v2.Span.Link.Type}
     */
    public enum Type implements com.google.protobuf.ProtocolMessageEnum {
      /**
       *
       *
       * <pre>
       * The relationship of the two spans is unknown.
       * </pre>
       *
       * <code>TYPE_UNSPECIFIED = 0;</code>
       */
      TYPE_UNSPECIFIED(0),
      /**
       *
       *
       * <pre>
       * The linked span is a child of the current span.
       * </pre>
       *
       * <code>CHILD_LINKED_SPAN = 1;</code>
       */
      CHILD_LINKED_SPAN(1),
      /**
       *
       *
       * <pre>
       * The linked span is a parent of the current span.
       * </pre>
       *
       * <code>PARENT_LINKED_SPAN = 2;</code>
       */
      PARENT_LINKED_SPAN(2),
      UNRECOGNIZED(-1),
      ;

      /**
       *
       *
       * <pre>
       * The relationship of the two spans is unknown.
       * </pre>
       *
       * <code>TYPE_UNSPECIFIED = 0;</code>
       */
      public static final int TYPE_UNSPECIFIED_VALUE = 0;
      /**
       *
       *
       * <pre>
       * The linked span is a child of the current span.
       * </pre>
       *
       * <code>CHILD_LINKED_SPAN = 1;</code>
       */
      public static final int CHILD_LINKED_SPAN_VALUE = 1;
      /**
       *
       *
       * <pre>
       * The linked span is a parent of the current span.
       * </pre>
       *
       * <code>PARENT_LINKED_SPAN = 2;</code>
       */
      public static final int PARENT_LINKED_SPAN_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 Type valueOf(int value) {
        return forNumber(value);
      }

      public static Type forNumber(int value) {
        switch (value) {
          case 0:
            return TYPE_UNSPECIFIED;
          case 1:
            return CHILD_LINKED_SPAN;
          case 2:
            return PARENT_LINKED_SPAN;
          default:
            return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<Type> internalGetValueMap() {
        return internalValueMap;
      }

      private static final com.google.protobuf.Internal.EnumLiteMap<Type> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Type>() {
            public Type findValueByNumber(int number) {
              return Type.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.v2.Span.Link.getDescriptor().getEnumTypes().get(0);
      }

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

      public static Type 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 Type(int value) {
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:google.devtools.cloudtrace.v2.Span.Link.Type)
    }

    public static final int TRACE_ID_FIELD_NUMBER = 1;
    private volatile java.lang.Object traceId_;
    /**
     *
     *
     * <pre>
     * The [TRACE_ID] for a trace within a project.
     * </pre>
     *
     * <code>string trace_id = 1;</code>
     */
    public java.lang.String getTraceId() {
      java.lang.Object ref = traceId_;
      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();
        traceId_ = s;
        return s;
      }
    }
    /**
     *
     *
     * <pre>
     * The [TRACE_ID] for a trace within a project.
     * </pre>
     *
     * <code>string trace_id = 1;</code>
     */
    public com.google.protobuf.ByteString getTraceIdBytes() {
      java.lang.Object ref = traceId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        traceId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SPAN_ID_FIELD_NUMBER = 2;
    private volatile java.lang.Object spanId_;
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] for a span within a trace.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public java.lang.String getSpanId() {
      java.lang.Object ref = spanId_;
      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();
        spanId_ = s;
        return s;
      }
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] for a span within a trace.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public com.google.protobuf.ByteString getSpanIdBytes() {
      java.lang.Object ref = spanId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        spanId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int TYPE_FIELD_NUMBER = 3;
    private int type_;
    /**
     *
     *
     * <pre>
     * The relationship of the current span relative to the linked span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
     */
    public int getTypeValue() {
      return type_;
    }
    /**
     *
     *
     * <pre>
     * The relationship of the current span relative to the linked span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Link.Type getType() {
      @SuppressWarnings("deprecation")
      com.google.devtools.cloudtrace.v2.Span.Link.Type result =
          com.google.devtools.cloudtrace.v2.Span.Link.Type.valueOf(type_);
      return result == null
          ? com.google.devtools.cloudtrace.v2.Span.Link.Type.UNRECOGNIZED
          : result;
    }

    public static final int ATTRIBUTES_FIELD_NUMBER = 4;
    private com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    public boolean hasAttributes() {
      return attributes_ != null;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
      return attributes_ == null
          ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
          : attributes_;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the link. You have have up to  32 attributes per
     * link.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
      return getAttributes();
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!getTraceIdBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, traceId_);
      }
      if (!getSpanIdBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spanId_);
      }
      if (type_ != com.google.devtools.cloudtrace.v2.Span.Link.Type.TYPE_UNSPECIFIED.getNumber()) {
        output.writeEnum(3, type_);
      }
      if (attributes_ != null) {
        output.writeMessage(4, getAttributes());
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getTraceIdBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, traceId_);
      }
      if (!getSpanIdBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spanId_);
      }
      if (type_ != com.google.devtools.cloudtrace.v2.Span.Link.Type.TYPE_UNSPECIFIED.getNumber()) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_);
      }
      if (attributes_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttributes());
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.Link)) {
        return super.equals(obj);
      }
      com.google.devtools.cloudtrace.v2.Span.Link other =
          (com.google.devtools.cloudtrace.v2.Span.Link) obj;

      if (!getTraceId().equals(other.getTraceId())) return false;
      if (!getSpanId().equals(other.getSpanId())) return false;
      if (type_ != other.type_) return false;
      if (hasAttributes() != other.hasAttributes()) return false;
      if (hasAttributes()) {
        if (!getAttributes().equals(other.getAttributes())) return false;
      }
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + TRACE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getTraceId().hashCode();
      hash = (37 * hash) + SPAN_ID_FIELD_NUMBER;
      hash = (53 * hash) + getSpanId().hashCode();
      hash = (37 * hash) + TYPE_FIELD_NUMBER;
      hash = (53 * hash) + type_;
      if (hasAttributes()) {
        hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
        hash = (53 * hash) + getAttributes().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link 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.v2.Span.Link parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link 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.v2.Span.Link parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link 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.v2.Span.Link parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span.Link prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    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;
    }
    /**
     *
     *
     * <pre>
     * A pointer from the current span to another span in the same trace or in a
     * different trace. For example, this can be used in batching operations,
     * where a single batch handler processes multiple requests from different
     * traces or when the handler receives a request from a different project.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Link}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.Link)
        com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Link_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Link_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.Link.class,
                com.google.devtools.cloudtrace.v2.Span.Link.Builder.class);
      }

      // Construct using com.google.devtools.cloudtrace.v2.Span.Link.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        traceId_ = "";

        spanId_ = "";

        type_ = 0;

        if (attributesBuilder_ == null) {
          attributes_ = null;
        } else {
          attributes_ = null;
          attributesBuilder_ = null;
        }
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Link_descriptor;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Link getDefaultInstanceForType() {
        return com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Link build() {
        com.google.devtools.cloudtrace.v2.Span.Link result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Link buildPartial() {
        com.google.devtools.cloudtrace.v2.Span.Link result =
            new com.google.devtools.cloudtrace.v2.Span.Link(this);
        result.traceId_ = traceId_;
        result.spanId_ = spanId_;
        result.type_ = type_;
        if (attributesBuilder_ == null) {
          result.attributes_ = attributes_;
        } else {
          result.attributes_ = attributesBuilder_.build();
        }
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.devtools.cloudtrace.v2.Span.Link) {
          return mergeFrom((com.google.devtools.cloudtrace.v2.Span.Link) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.Link other) {
        if (other == com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance()) return this;
        if (!other.getTraceId().isEmpty()) {
          traceId_ = other.traceId_;
          onChanged();
        }
        if (!other.getSpanId().isEmpty()) {
          spanId_ = other.spanId_;
          onChanged();
        }
        if (other.type_ != 0) {
          setTypeValue(other.getTypeValue());
        }
        if (other.hasAttributes()) {
          mergeAttributes(other.getAttributes());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.devtools.cloudtrace.v2.Span.Link parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.devtools.cloudtrace.v2.Span.Link) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private java.lang.Object traceId_ = "";
      /**
       *
       *
       * <pre>
       * The [TRACE_ID] for a trace within a project.
       * </pre>
       *
       * <code>string trace_id = 1;</code>
       */
      public java.lang.String getTraceId() {
        java.lang.Object ref = traceId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          traceId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The [TRACE_ID] for a trace within a project.
       * </pre>
       *
       * <code>string trace_id = 1;</code>
       */
      public com.google.protobuf.ByteString getTraceIdBytes() {
        java.lang.Object ref = traceId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          traceId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The [TRACE_ID] for a trace within a project.
       * </pre>
       *
       * <code>string trace_id = 1;</code>
       */
      public Builder setTraceId(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }

        traceId_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The [TRACE_ID] for a trace within a project.
       * </pre>
       *
       * <code>string trace_id = 1;</code>
       */
      public Builder clearTraceId() {

        traceId_ = getDefaultInstance().getTraceId();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The [TRACE_ID] for a trace within a project.
       * </pre>
       *
       * <code>string trace_id = 1;</code>
       */
      public Builder setTraceIdBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);

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

      private java.lang.Object spanId_ = "";
      /**
       *
       *
       * <pre>
       * The [SPAN_ID] for a span within a trace.
       * </pre>
       *
       * <code>string span_id = 2;</code>
       */
      public java.lang.String getSpanId() {
        java.lang.Object ref = spanId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          spanId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The [SPAN_ID] for a span within a trace.
       * </pre>
       *
       * <code>string span_id = 2;</code>
       */
      public com.google.protobuf.ByteString getSpanIdBytes() {
        java.lang.Object ref = spanId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          spanId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The [SPAN_ID] for a span within a trace.
       * </pre>
       *
       * <code>string span_id = 2;</code>
       */
      public Builder setSpanId(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }

        spanId_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The [SPAN_ID] for a span within a trace.
       * </pre>
       *
       * <code>string span_id = 2;</code>
       */
      public Builder clearSpanId() {

        spanId_ = getDefaultInstance().getSpanId();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The [SPAN_ID] for a span within a trace.
       * </pre>
       *
       * <code>string span_id = 2;</code>
       */
      public Builder setSpanIdBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);

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

      private int type_ = 0;
      /**
       *
       *
       * <pre>
       * The relationship of the current span relative to the linked span.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
       */
      public int getTypeValue() {
        return type_;
      }
      /**
       *
       *
       * <pre>
       * The relationship of the current span relative to the linked span.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
       */
      public Builder setTypeValue(int value) {
        type_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The relationship of the current span relative to the linked span.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Link.Type getType() {
        @SuppressWarnings("deprecation")
        com.google.devtools.cloudtrace.v2.Span.Link.Type result =
            com.google.devtools.cloudtrace.v2.Span.Link.Type.valueOf(type_);
        return result == null
            ? com.google.devtools.cloudtrace.v2.Span.Link.Type.UNRECOGNIZED
            : result;
      }
      /**
       *
       *
       * <pre>
       * The relationship of the current span relative to the linked span.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
       */
      public Builder setType(com.google.devtools.cloudtrace.v2.Span.Link.Type value) {
        if (value == null) {
          throw new NullPointerException();
        }

        type_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The relationship of the current span relative to the linked span.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Link.Type type = 3;</code>
       */
      public Builder clearType() {

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

      private com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.Attributes,
              com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
              com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
          attributesBuilder_;
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public boolean hasAttributes() {
        return attributesBuilder_ != null || attributes_ != null;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
        if (attributesBuilder_ == null) {
          return attributes_ == null
              ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
              : attributes_;
        } else {
          return attributesBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public Builder setAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
        if (attributesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          attributes_ = value;
          onChanged();
        } else {
          attributesBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public Builder setAttributes(
          com.google.devtools.cloudtrace.v2.Span.Attributes.Builder builderForValue) {
        if (attributesBuilder_ == null) {
          attributes_ = builderForValue.build();
          onChanged();
        } else {
          attributesBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
        if (attributesBuilder_ == null) {
          if (attributes_ != null) {
            attributes_ =
                com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            attributes_ = value;
          }
          onChanged();
        } else {
          attributesBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public Builder clearAttributes() {
        if (attributesBuilder_ == null) {
          attributes_ = null;
          onChanged();
        } else {
          attributes_ = null;
          attributesBuilder_ = null;
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Attributes.Builder getAttributesBuilder() {

        onChanged();
        return getAttributesFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
        if (attributesBuilder_ != null) {
          return attributesBuilder_.getMessageOrBuilder();
        } else {
          return attributes_ == null
              ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
              : attributes_;
        }
      }
      /**
       *
       *
       * <pre>
       * A set of attributes on the link. You have have up to  32 attributes per
       * link.
       * </pre>
       *
       * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.Attributes,
              com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
              com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
          getAttributesFieldBuilder() {
        if (attributesBuilder_ == null) {
          attributesBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.devtools.cloudtrace.v2.Span.Attributes,
                  com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
                  com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>(
                  getAttributes(), getParentForChildren(), isClean());
          attributes_ = null;
        }
        return attributesBuilder_;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.Link)
    }

    // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Link)
    private static final com.google.devtools.cloudtrace.v2.Span.Link DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.Link();
    }

    public static com.google.devtools.cloudtrace.v2.Span.Link getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span.Link getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface LinksOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v2.Span.Links)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    java.util.List<com.google.devtools.cloudtrace.v2.Span.Link> getLinkList();
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.Link getLink(int index);
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    int getLinkCount();
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>
        getLinkOrBuilderList();
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder getLinkOrBuilder(int index);

    /**
     *
     *
     * <pre>
     * The number of dropped links after the maximum size was enforced. If
     * this value is 0, then no links were dropped.
     * </pre>
     *
     * <code>int32 dropped_links_count = 2;</code>
     */
    int getDroppedLinksCount();
  }
  /**
   *
   *
   * <pre>
   * A collection of links, which are references from this span to a span
   * in the same or different trace.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Links}
   */
  public static final class Links extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.Span.Links)
      LinksOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Links.newBuilder() to construct.
    private Links(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Links() {
      link_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private Links(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                  link_ = new java.util.ArrayList<com.google.devtools.cloudtrace.v2.Span.Link>();
                  mutable_bitField0_ |= 0x00000001;
                }
                link_.add(
                    input.readMessage(
                        com.google.devtools.cloudtrace.v2.Span.Link.parser(), extensionRegistry));
                break;
              }
            case 16:
              {
                droppedLinksCount_ = input.readInt32();
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                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 {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          link_ = java.util.Collections.unmodifiableList(link_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Links_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_Links_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.Links.class,
              com.google.devtools.cloudtrace.v2.Span.Links.Builder.class);
    }

    private int bitField0_;
    public static final int LINK_FIELD_NUMBER = 1;
    private java.util.List<com.google.devtools.cloudtrace.v2.Span.Link> link_;
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    public java.util.List<com.google.devtools.cloudtrace.v2.Span.Link> getLinkList() {
      return link_;
    }
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    public java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>
        getLinkOrBuilderList() {
      return link_;
    }
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    public int getLinkCount() {
      return link_.size();
    }
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Link getLink(int index) {
      return link_.get(index);
    }
    /**
     *
     *
     * <pre>
     * A collection of links.
     * </pre>
     *
     * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder getLinkOrBuilder(int index) {
      return link_.get(index);
    }

    public static final int DROPPED_LINKS_COUNT_FIELD_NUMBER = 2;
    private int droppedLinksCount_;
    /**
     *
     *
     * <pre>
     * The number of dropped links after the maximum size was enforced. If
     * this value is 0, then no links were dropped.
     * </pre>
     *
     * <code>int32 dropped_links_count = 2;</code>
     */
    public int getDroppedLinksCount() {
      return droppedLinksCount_;
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      for (int i = 0; i < link_.size(); i++) {
        output.writeMessage(1, link_.get(i));
      }
      if (droppedLinksCount_ != 0) {
        output.writeInt32(2, droppedLinksCount_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < link_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, link_.get(i));
      }
      if (droppedLinksCount_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, droppedLinksCount_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.Links)) {
        return super.equals(obj);
      }
      com.google.devtools.cloudtrace.v2.Span.Links other =
          (com.google.devtools.cloudtrace.v2.Span.Links) obj;

      if (!getLinkList().equals(other.getLinkList())) return false;
      if (getDroppedLinksCount() != other.getDroppedLinksCount()) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getLinkCount() > 0) {
        hash = (37 * hash) + LINK_FIELD_NUMBER;
        hash = (53 * hash) + getLinkList().hashCode();
      }
      hash = (37 * hash) + DROPPED_LINKS_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + getDroppedLinksCount();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links 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.v2.Span.Links parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links 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.v2.Span.Links parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links 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.v2.Span.Links parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span.Links prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    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;
    }
    /**
     *
     *
     * <pre>
     * A collection of links, which are references from this span to a span
     * in the same or different trace.
     * </pre>
     *
     * Protobuf type {@code google.devtools.cloudtrace.v2.Span.Links}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span.Links)
        com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Links_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Links_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.devtools.cloudtrace.v2.Span.Links.class,
                com.google.devtools.cloudtrace.v2.Span.Links.Builder.class);
      }

      // Construct using com.google.devtools.cloudtrace.v2.Span.Links.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
          getLinkFieldBuilder();
        }
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        if (linkBuilder_ == null) {
          link_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          linkBuilder_.clear();
        }
        droppedLinksCount_ = 0;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.devtools.cloudtrace.v2.TraceProto
            .internal_static_google_devtools_cloudtrace_v2_Span_Links_descriptor;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Links getDefaultInstanceForType() {
        return com.google.devtools.cloudtrace.v2.Span.Links.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Links build() {
        com.google.devtools.cloudtrace.v2.Span.Links result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.devtools.cloudtrace.v2.Span.Links buildPartial() {
        com.google.devtools.cloudtrace.v2.Span.Links result =
            new com.google.devtools.cloudtrace.v2.Span.Links(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (linkBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)) {
            link_ = java.util.Collections.unmodifiableList(link_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.link_ = link_;
        } else {
          result.link_ = linkBuilder_.build();
        }
        result.droppedLinksCount_ = droppedLinksCount_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.devtools.cloudtrace.v2.Span.Links) {
          return mergeFrom((com.google.devtools.cloudtrace.v2.Span.Links) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.Links other) {
        if (other == com.google.devtools.cloudtrace.v2.Span.Links.getDefaultInstance()) return this;
        if (linkBuilder_ == null) {
          if (!other.link_.isEmpty()) {
            if (link_.isEmpty()) {
              link_ = other.link_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureLinkIsMutable();
              link_.addAll(other.link_);
            }
            onChanged();
          }
        } else {
          if (!other.link_.isEmpty()) {
            if (linkBuilder_.isEmpty()) {
              linkBuilder_.dispose();
              linkBuilder_ = null;
              link_ = other.link_;
              bitField0_ = (bitField0_ & ~0x00000001);
              linkBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                      ? getLinkFieldBuilder()
                      : null;
            } else {
              linkBuilder_.addAllMessages(other.link_);
            }
          }
        }
        if (other.getDroppedLinksCount() != 0) {
          setDroppedLinksCount(other.getDroppedLinksCount());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.devtools.cloudtrace.v2.Span.Links parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.devtools.cloudtrace.v2.Span.Links) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private java.util.List<com.google.devtools.cloudtrace.v2.Span.Link> link_ =
          java.util.Collections.emptyList();

      private void ensureLinkIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          link_ = new java.util.ArrayList<com.google.devtools.cloudtrace.v2.Span.Link>(link_);
          bitField0_ |= 0x00000001;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.Link,
              com.google.devtools.cloudtrace.v2.Span.Link.Builder,
              com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>
          linkBuilder_;

      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public java.util.List<com.google.devtools.cloudtrace.v2.Span.Link> getLinkList() {
        if (linkBuilder_ == null) {
          return java.util.Collections.unmodifiableList(link_);
        } else {
          return linkBuilder_.getMessageList();
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public int getLinkCount() {
        if (linkBuilder_ == null) {
          return link_.size();
        } else {
          return linkBuilder_.getCount();
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Link getLink(int index) {
        if (linkBuilder_ == null) {
          return link_.get(index);
        } else {
          return linkBuilder_.getMessage(index);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder setLink(int index, com.google.devtools.cloudtrace.v2.Span.Link value) {
        if (linkBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureLinkIsMutable();
          link_.set(index, value);
          onChanged();
        } else {
          linkBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder setLink(
          int index, com.google.devtools.cloudtrace.v2.Span.Link.Builder builderForValue) {
        if (linkBuilder_ == null) {
          ensureLinkIsMutable();
          link_.set(index, builderForValue.build());
          onChanged();
        } else {
          linkBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder addLink(com.google.devtools.cloudtrace.v2.Span.Link value) {
        if (linkBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureLinkIsMutable();
          link_.add(value);
          onChanged();
        } else {
          linkBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder addLink(int index, com.google.devtools.cloudtrace.v2.Span.Link value) {
        if (linkBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureLinkIsMutable();
          link_.add(index, value);
          onChanged();
        } else {
          linkBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder addLink(com.google.devtools.cloudtrace.v2.Span.Link.Builder builderForValue) {
        if (linkBuilder_ == null) {
          ensureLinkIsMutable();
          link_.add(builderForValue.build());
          onChanged();
        } else {
          linkBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder addLink(
          int index, com.google.devtools.cloudtrace.v2.Span.Link.Builder builderForValue) {
        if (linkBuilder_ == null) {
          ensureLinkIsMutable();
          link_.add(index, builderForValue.build());
          onChanged();
        } else {
          linkBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder addAllLink(
          java.lang.Iterable<? extends com.google.devtools.cloudtrace.v2.Span.Link> values) {
        if (linkBuilder_ == null) {
          ensureLinkIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, link_);
          onChanged();
        } else {
          linkBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder clearLink() {
        if (linkBuilder_ == null) {
          link_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          linkBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public Builder removeLink(int index) {
        if (linkBuilder_ == null) {
          ensureLinkIsMutable();
          link_.remove(index);
          onChanged();
        } else {
          linkBuilder_.remove(index);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Link.Builder getLinkBuilder(int index) {
        return getLinkFieldBuilder().getBuilder(index);
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder getLinkOrBuilder(int index) {
        if (linkBuilder_ == null) {
          return link_.get(index);
        } else {
          return linkBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public java.util.List<? extends com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>
          getLinkOrBuilderList() {
        if (linkBuilder_ != null) {
          return linkBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(link_);
        }
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Link.Builder addLinkBuilder() {
        return getLinkFieldBuilder()
            .addBuilder(com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public com.google.devtools.cloudtrace.v2.Span.Link.Builder addLinkBuilder(int index) {
        return getLinkFieldBuilder()
            .addBuilder(index, com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * A collection of links.
       * </pre>
       *
       * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code>
       */
      public java.util.List<com.google.devtools.cloudtrace.v2.Span.Link.Builder>
          getLinkBuilderList() {
        return getLinkFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.devtools.cloudtrace.v2.Span.Link,
              com.google.devtools.cloudtrace.v2.Span.Link.Builder,
              com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>
          getLinkFieldBuilder() {
        if (linkBuilder_ == null) {
          linkBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.devtools.cloudtrace.v2.Span.Link,
                  com.google.devtools.cloudtrace.v2.Span.Link.Builder,
                  com.google.devtools.cloudtrace.v2.Span.LinkOrBuilder>(
                  link_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
          link_ = null;
        }
        return linkBuilder_;
      }

      private int droppedLinksCount_;
      /**
       *
       *
       * <pre>
       * The number of dropped links after the maximum size was enforced. If
       * this value is 0, then no links were dropped.
       * </pre>
       *
       * <code>int32 dropped_links_count = 2;</code>
       */
      public int getDroppedLinksCount() {
        return droppedLinksCount_;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped links after the maximum size was enforced. If
       * this value is 0, then no links were dropped.
       * </pre>
       *
       * <code>int32 dropped_links_count = 2;</code>
       */
      public Builder setDroppedLinksCount(int value) {

        droppedLinksCount_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The number of dropped links after the maximum size was enforced. If
       * this value is 0, then no links were dropped.
       * </pre>
       *
       * <code>int32 dropped_links_count = 2;</code>
       */
      public Builder clearDroppedLinksCount() {

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

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span.Links)
    }

    // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Links)
    private static final com.google.devtools.cloudtrace.v2.Span.Links DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span.Links();
    }

    public static com.google.devtools.cloudtrace.v2.Span.Links getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span.Links getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The resource name of the span in the following format:
   *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
   * [TRACE_ID] is a unique identifier for a trace within a project;
   * it is a 32-character hexadecimal encoding of a 16-byte array.
   * [SPAN_ID] is a unique identifier for a span within a trace; it
   * is a 16-character hexadecimal encoding of an 8-byte array.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  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;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name of the span in the following format:
   *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
   * [TRACE_ID] is a unique identifier for a trace within a project;
   * it is a 32-character hexadecimal encoding of a 16-byte array.
   * [SPAN_ID] is a unique identifier for a span within a trace; it
   * is a 16-character hexadecimal encoding of an 8-byte array.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  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 SPAN_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object spanId_;
  /**
   *
   *
   * <pre>
   * The [SPAN_ID] portion of the span's resource name.
   * </pre>
   *
   * <code>string span_id = 2;</code>
   */
  public java.lang.String getSpanId() {
    java.lang.Object ref = spanId_;
    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();
      spanId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The [SPAN_ID] portion of the span's resource name.
   * </pre>
   *
   * <code>string span_id = 2;</code>
   */
  public com.google.protobuf.ByteString getSpanIdBytes() {
    java.lang.Object ref = spanId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      spanId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PARENT_SPAN_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object parentSpanId_;
  /**
   *
   *
   * <pre>
   * The [SPAN_ID] of this span's parent span. If this is a root span,
   * then this field must be empty.
   * </pre>
   *
   * <code>string parent_span_id = 3;</code>
   */
  public java.lang.String getParentSpanId() {
    java.lang.Object ref = parentSpanId_;
    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();
      parentSpanId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The [SPAN_ID] of this span's parent span. If this is a root span,
   * then this field must be empty.
   * </pre>
   *
   * <code>string parent_span_id = 3;</code>
   */
  public com.google.protobuf.ByteString getParentSpanIdBytes() {
    java.lang.Object ref = parentSpanId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parentSpanId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISPLAY_NAME_FIELD_NUMBER = 4;
  private com.google.devtools.cloudtrace.v2.TruncatableString displayName_;
  /**
   *
   *
   * <pre>
   * A description of the span's operation (up to 128 bytes).
   * Stackdriver Trace displays the description in the
   * {% dynamic print site_values.console_name %}.
   * For example, the display name can be a qualified method name or a file name
   * and a line number where the operation is called. A best practice is to use
   * the same display name within an application and at the same call point.
   * This makes it easier to correlate spans in different traces.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
   */
  public boolean hasDisplayName() {
    return displayName_ != null;
  }
  /**
   *
   *
   * <pre>
   * A description of the span's operation (up to 128 bytes).
   * Stackdriver Trace displays the description in the
   * {% dynamic print site_values.console_name %}.
   * For example, the display name can be a qualified method name or a file name
   * and a line number where the operation is called. A best practice is to use
   * the same display name within an application and at the same call point.
   * This makes it easier to correlate spans in different traces.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
   */
  public com.google.devtools.cloudtrace.v2.TruncatableString getDisplayName() {
    return displayName_ == null
        ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
        : displayName_;
  }
  /**
   *
   *
   * <pre>
   * A description of the span's operation (up to 128 bytes).
   * Stackdriver Trace displays the description in the
   * {% dynamic print site_values.console_name %}.
   * For example, the display name can be a qualified method name or a file name
   * and a line number where the operation is called. A best practice is to use
   * the same display name within an application and at the same call point.
   * This makes it easier to correlate spans in different traces.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
   */
  public com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder getDisplayNameOrBuilder() {
    return getDisplayName();
  }

  public static final int START_TIME_FIELD_NUMBER = 5;
  private com.google.protobuf.Timestamp startTime_;
  /**
   *
   *
   * <pre>
   * The start time of the span. On the client side, this is the time kept by
   * the local machine where the span execution starts. On the server side, this
   * is the time when the server's application handler starts running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 5;</code>
   */
  public boolean hasStartTime() {
    return startTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * The start time of the span. On the client side, this is the time kept by
   * the local machine where the span execution starts. On the server side, this
   * is the time when the server's application handler starts running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 5;</code>
   */
  public com.google.protobuf.Timestamp getStartTime() {
    return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
  }
  /**
   *
   *
   * <pre>
   * The start time of the span. On the client side, this is the time kept by
   * the local machine where the span execution starts. On the server side, this
   * is the time when the server's application handler starts running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 5;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
    return getStartTime();
  }

  public static final int END_TIME_FIELD_NUMBER = 6;
  private com.google.protobuf.Timestamp endTime_;
  /**
   *
   *
   * <pre>
   * The end time of the span. On the client side, this is the time kept by
   * the local machine where the span execution ends. On the server side, this
   * is the time when the server application handler stops running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp end_time = 6;</code>
   */
  public boolean hasEndTime() {
    return endTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * The end time of the span. On the client side, this is the time kept by
   * the local machine where the span execution ends. On the server side, this
   * is the time when the server application handler stops running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp end_time = 6;</code>
   */
  public com.google.protobuf.Timestamp getEndTime() {
    return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
  }
  /**
   *
   *
   * <pre>
   * The end time of the span. On the client side, this is the time kept by
   * the local machine where the span execution ends. On the server side, this
   * is the time when the server application handler stops running.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp end_time = 6;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
    return getEndTime();
  }

  public static final int ATTRIBUTES_FIELD_NUMBER = 7;
  private com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
  /**
   *
   *
   * <pre>
   * A set of attributes on the span. You can have up to 32 attributes per
   * span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
   */
  public boolean hasAttributes() {
    return attributes_ != null;
  }
  /**
   *
   *
   * <pre>
   * A set of attributes on the span. You can have up to 32 attributes per
   * span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
    return attributes_ == null
        ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
        : attributes_;
  }
  /**
   *
   *
   * <pre>
   * A set of attributes on the span. You can have up to 32 attributes per
   * span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
    return getAttributes();
  }

  public static final int STACK_TRACE_FIELD_NUMBER = 8;
  private com.google.devtools.cloudtrace.v2.StackTrace stackTrace_;
  /**
   *
   *
   * <pre>
   * Stack trace captured at the start of the span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
   */
  public boolean hasStackTrace() {
    return stackTrace_ != null;
  }
  /**
   *
   *
   * <pre>
   * Stack trace captured at the start of the span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
   */
  public com.google.devtools.cloudtrace.v2.StackTrace getStackTrace() {
    return stackTrace_ == null
        ? com.google.devtools.cloudtrace.v2.StackTrace.getDefaultInstance()
        : stackTrace_;
  }
  /**
   *
   *
   * <pre>
   * Stack trace captured at the start of the span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
   */
  public com.google.devtools.cloudtrace.v2.StackTraceOrBuilder getStackTraceOrBuilder() {
    return getStackTrace();
  }

  public static final int TIME_EVENTS_FIELD_NUMBER = 9;
  private com.google.devtools.cloudtrace.v2.Span.TimeEvents timeEvents_;
  /**
   *
   *
   * <pre>
   * A set of time events. You can have up to 32 annotations and 128 message
   * events per span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
   */
  public boolean hasTimeEvents() {
    return timeEvents_ != null;
  }
  /**
   *
   *
   * <pre>
   * A set of time events. You can have up to 32 annotations and 128 message
   * events per span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.TimeEvents getTimeEvents() {
    return timeEvents_ == null
        ? com.google.devtools.cloudtrace.v2.Span.TimeEvents.getDefaultInstance()
        : timeEvents_;
  }
  /**
   *
   *
   * <pre>
   * A set of time events. You can have up to 32 annotations and 128 message
   * events per span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder getTimeEventsOrBuilder() {
    return getTimeEvents();
  }

  public static final int LINKS_FIELD_NUMBER = 10;
  private com.google.devtools.cloudtrace.v2.Span.Links links_;
  /**
   *
   *
   * <pre>
   * Links associated with the span. You can have up to 128 links per Span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
   */
  public boolean hasLinks() {
    return links_ != null;
  }
  /**
   *
   *
   * <pre>
   * Links associated with the span. You can have up to 128 links per Span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.Links getLinks() {
    return links_ == null
        ? com.google.devtools.cloudtrace.v2.Span.Links.getDefaultInstance()
        : links_;
  }
  /**
   *
   *
   * <pre>
   * Links associated with the span. You can have up to 128 links per Span.
   * </pre>
   *
   * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
   */
  public com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder getLinksOrBuilder() {
    return getLinks();
  }

  public static final int STATUS_FIELD_NUMBER = 11;
  private com.google.rpc.Status status_;
  /**
   *
   *
   * <pre>
   * An optional final status for this span.
   * </pre>
   *
   * <code>.google.rpc.Status status = 11;</code>
   */
  public boolean hasStatus() {
    return status_ != null;
  }
  /**
   *
   *
   * <pre>
   * An optional final status for this span.
   * </pre>
   *
   * <code>.google.rpc.Status status = 11;</code>
   */
  public com.google.rpc.Status getStatus() {
    return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
  }
  /**
   *
   *
   * <pre>
   * An optional final status for this span.
   * </pre>
   *
   * <code>.google.rpc.Status status = 11;</code>
   */
  public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
    return getStatus();
  }

  public static final int SAME_PROCESS_AS_PARENT_SPAN_FIELD_NUMBER = 12;
  private com.google.protobuf.BoolValue sameProcessAsParentSpan_;
  /**
   *
   *
   * <pre>
   * (Optional) Set this parameter to indicate whether this span is in
   * the same process as its parent. If you do not set this parameter,
   * Stackdriver Trace is unable to take advantage of this helpful
   * information.
   * </pre>
   *
   * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
   */
  public boolean hasSameProcessAsParentSpan() {
    return sameProcessAsParentSpan_ != null;
  }
  /**
   *
   *
   * <pre>
   * (Optional) Set this parameter to indicate whether this span is in
   * the same process as its parent. If you do not set this parameter,
   * Stackdriver Trace is unable to take advantage of this helpful
   * information.
   * </pre>
   *
   * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
   */
  public com.google.protobuf.BoolValue getSameProcessAsParentSpan() {
    return sameProcessAsParentSpan_ == null
        ? com.google.protobuf.BoolValue.getDefaultInstance()
        : sameProcessAsParentSpan_;
  }
  /**
   *
   *
   * <pre>
   * (Optional) Set this parameter to indicate whether this span is in
   * the same process as its parent. If you do not set this parameter,
   * Stackdriver Trace is unable to take advantage of this helpful
   * information.
   * </pre>
   *
   * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
   */
  public com.google.protobuf.BoolValueOrBuilder getSameProcessAsParentSpanOrBuilder() {
    return getSameProcessAsParentSpan();
  }

  public static final int CHILD_SPAN_COUNT_FIELD_NUMBER = 13;
  private com.google.protobuf.Int32Value childSpanCount_;
  /**
   *
   *
   * <pre>
   * An optional number of child spans that were generated while this span
   * was active. If set, allows implementation to detect missing child spans.
   * </pre>
   *
   * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
   */
  public boolean hasChildSpanCount() {
    return childSpanCount_ != null;
  }
  /**
   *
   *
   * <pre>
   * An optional number of child spans that were generated while this span
   * was active. If set, allows implementation to detect missing child spans.
   * </pre>
   *
   * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
   */
  public com.google.protobuf.Int32Value getChildSpanCount() {
    return childSpanCount_ == null
        ? com.google.protobuf.Int32Value.getDefaultInstance()
        : childSpanCount_;
  }
  /**
   *
   *
   * <pre>
   * An optional number of child spans that were generated while this span
   * was active. If set, allows implementation to detect missing child spans.
   * </pre>
   *
   * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
   */
  public com.google.protobuf.Int32ValueOrBuilder getChildSpanCountOrBuilder() {
    return getChildSpanCount();
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!getSpanIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spanId_);
    }
    if (!getParentSpanIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, parentSpanId_);
    }
    if (displayName_ != null) {
      output.writeMessage(4, getDisplayName());
    }
    if (startTime_ != null) {
      output.writeMessage(5, getStartTime());
    }
    if (endTime_ != null) {
      output.writeMessage(6, getEndTime());
    }
    if (attributes_ != null) {
      output.writeMessage(7, getAttributes());
    }
    if (stackTrace_ != null) {
      output.writeMessage(8, getStackTrace());
    }
    if (timeEvents_ != null) {
      output.writeMessage(9, getTimeEvents());
    }
    if (links_ != null) {
      output.writeMessage(10, getLinks());
    }
    if (status_ != null) {
      output.writeMessage(11, getStatus());
    }
    if (sameProcessAsParentSpan_ != null) {
      output.writeMessage(12, getSameProcessAsParentSpan());
    }
    if (childSpanCount_ != null) {
      output.writeMessage(13, getChildSpanCount());
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!getSpanIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spanId_);
    }
    if (!getParentSpanIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, parentSpanId_);
    }
    if (displayName_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDisplayName());
    }
    if (startTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartTime());
    }
    if (endTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndTime());
    }
    if (attributes_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAttributes());
    }
    if (stackTrace_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStackTrace());
    }
    if (timeEvents_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTimeEvents());
    }
    if (links_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getLinks());
    }
    if (status_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getStatus());
    }
    if (sameProcessAsParentSpan_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              12, getSameProcessAsParentSpan());
    }
    if (childSpanCount_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getChildSpanCount());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span)) {
      return super.equals(obj);
    }
    com.google.devtools.cloudtrace.v2.Span other = (com.google.devtools.cloudtrace.v2.Span) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getSpanId().equals(other.getSpanId())) return false;
    if (!getParentSpanId().equals(other.getParentSpanId())) return false;
    if (hasDisplayName() != other.hasDisplayName()) return false;
    if (hasDisplayName()) {
      if (!getDisplayName().equals(other.getDisplayName())) return false;
    }
    if (hasStartTime() != other.hasStartTime()) return false;
    if (hasStartTime()) {
      if (!getStartTime().equals(other.getStartTime())) return false;
    }
    if (hasEndTime() != other.hasEndTime()) return false;
    if (hasEndTime()) {
      if (!getEndTime().equals(other.getEndTime())) return false;
    }
    if (hasAttributes() != other.hasAttributes()) return false;
    if (hasAttributes()) {
      if (!getAttributes().equals(other.getAttributes())) return false;
    }
    if (hasStackTrace() != other.hasStackTrace()) return false;
    if (hasStackTrace()) {
      if (!getStackTrace().equals(other.getStackTrace())) return false;
    }
    if (hasTimeEvents() != other.hasTimeEvents()) return false;
    if (hasTimeEvents()) {
      if (!getTimeEvents().equals(other.getTimeEvents())) return false;
    }
    if (hasLinks() != other.hasLinks()) return false;
    if (hasLinks()) {
      if (!getLinks().equals(other.getLinks())) return false;
    }
    if (hasStatus() != other.hasStatus()) return false;
    if (hasStatus()) {
      if (!getStatus().equals(other.getStatus())) return false;
    }
    if (hasSameProcessAsParentSpan() != other.hasSameProcessAsParentSpan()) return false;
    if (hasSameProcessAsParentSpan()) {
      if (!getSameProcessAsParentSpan().equals(other.getSameProcessAsParentSpan())) return false;
    }
    if (hasChildSpanCount() != other.hasChildSpanCount()) return false;
    if (hasChildSpanCount()) {
      if (!getChildSpanCount().equals(other.getChildSpanCount())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + SPAN_ID_FIELD_NUMBER;
    hash = (53 * hash) + getSpanId().hashCode();
    hash = (37 * hash) + PARENT_SPAN_ID_FIELD_NUMBER;
    hash = (53 * hash) + getParentSpanId().hashCode();
    if (hasDisplayName()) {
      hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
      hash = (53 * hash) + getDisplayName().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();
    }
    if (hasAttributes()) {
      hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
      hash = (53 * hash) + getAttributes().hashCode();
    }
    if (hasStackTrace()) {
      hash = (37 * hash) + STACK_TRACE_FIELD_NUMBER;
      hash = (53 * hash) + getStackTrace().hashCode();
    }
    if (hasTimeEvents()) {
      hash = (37 * hash) + TIME_EVENTS_FIELD_NUMBER;
      hash = (53 * hash) + getTimeEvents().hashCode();
    }
    if (hasLinks()) {
      hash = (37 * hash) + LINKS_FIELD_NUMBER;
      hash = (53 * hash) + getLinks().hashCode();
    }
    if (hasStatus()) {
      hash = (37 * hash) + STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getStatus().hashCode();
    }
    if (hasSameProcessAsParentSpan()) {
      hash = (37 * hash) + SAME_PROCESS_AS_PARENT_SPAN_FIELD_NUMBER;
      hash = (53 * hash) + getSameProcessAsParentSpan().hashCode();
    }
    if (hasChildSpanCount()) {
      hash = (37 * hash) + CHILD_SPAN_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + getChildSpanCount().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.devtools.cloudtrace.v2.Span 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.v2.Span parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.devtools.cloudtrace.v2.Span 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.v2.Span parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.devtools.cloudtrace.v2.Span 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.v2.Span parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.devtools.cloudtrace.v2.Span parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.devtools.cloudtrace.v2.Span prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  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;
  }
  /**
   *
   *
   * <pre>
   * A span represents a single operation within a trace. Spans can be
   * nested to form a trace tree. Often, a trace contains a root span
   * that describes the end-to-end latency, and one or more subspans for
   * its sub-operations. A trace can also contain multiple root spans,
   * or none at all. Spans do not need to be contiguous&amp;mdash;there may be
   * gaps or overlaps between spans in a trace.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudtrace.v2.Span}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.devtools.cloudtrace.v2.Span)
      com.google.devtools.cloudtrace.v2.SpanOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.devtools.cloudtrace.v2.Span.class,
              com.google.devtools.cloudtrace.v2.Span.Builder.class);
    }

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

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      name_ = "";

      spanId_ = "";

      parentSpanId_ = "";

      if (displayNameBuilder_ == null) {
        displayName_ = null;
      } else {
        displayName_ = null;
        displayNameBuilder_ = null;
      }
      if (startTimeBuilder_ == null) {
        startTime_ = null;
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }
      if (endTimeBuilder_ == null) {
        endTime_ = null;
      } else {
        endTime_ = null;
        endTimeBuilder_ = null;
      }
      if (attributesBuilder_ == null) {
        attributes_ = null;
      } else {
        attributes_ = null;
        attributesBuilder_ = null;
      }
      if (stackTraceBuilder_ == null) {
        stackTrace_ = null;
      } else {
        stackTrace_ = null;
        stackTraceBuilder_ = null;
      }
      if (timeEventsBuilder_ == null) {
        timeEvents_ = null;
      } else {
        timeEvents_ = null;
        timeEventsBuilder_ = null;
      }
      if (linksBuilder_ == null) {
        links_ = null;
      } else {
        links_ = null;
        linksBuilder_ = null;
      }
      if (statusBuilder_ == null) {
        status_ = null;
      } else {
        status_ = null;
        statusBuilder_ = null;
      }
      if (sameProcessAsParentSpanBuilder_ == null) {
        sameProcessAsParentSpan_ = null;
      } else {
        sameProcessAsParentSpan_ = null;
        sameProcessAsParentSpanBuilder_ = null;
      }
      if (childSpanCountBuilder_ == null) {
        childSpanCount_ = null;
      } else {
        childSpanCount_ = null;
        childSpanCountBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.devtools.cloudtrace.v2.TraceProto
          .internal_static_google_devtools_cloudtrace_v2_Span_descriptor;
    }

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span getDefaultInstanceForType() {
      return com.google.devtools.cloudtrace.v2.Span.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span build() {
      com.google.devtools.cloudtrace.v2.Span result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.devtools.cloudtrace.v2.Span buildPartial() {
      com.google.devtools.cloudtrace.v2.Span result =
          new com.google.devtools.cloudtrace.v2.Span(this);
      result.name_ = name_;
      result.spanId_ = spanId_;
      result.parentSpanId_ = parentSpanId_;
      if (displayNameBuilder_ == null) {
        result.displayName_ = displayName_;
      } else {
        result.displayName_ = displayNameBuilder_.build();
      }
      if (startTimeBuilder_ == null) {
        result.startTime_ = startTime_;
      } else {
        result.startTime_ = startTimeBuilder_.build();
      }
      if (endTimeBuilder_ == null) {
        result.endTime_ = endTime_;
      } else {
        result.endTime_ = endTimeBuilder_.build();
      }
      if (attributesBuilder_ == null) {
        result.attributes_ = attributes_;
      } else {
        result.attributes_ = attributesBuilder_.build();
      }
      if (stackTraceBuilder_ == null) {
        result.stackTrace_ = stackTrace_;
      } else {
        result.stackTrace_ = stackTraceBuilder_.build();
      }
      if (timeEventsBuilder_ == null) {
        result.timeEvents_ = timeEvents_;
      } else {
        result.timeEvents_ = timeEventsBuilder_.build();
      }
      if (linksBuilder_ == null) {
        result.links_ = links_;
      } else {
        result.links_ = linksBuilder_.build();
      }
      if (statusBuilder_ == null) {
        result.status_ = status_;
      } else {
        result.status_ = statusBuilder_.build();
      }
      if (sameProcessAsParentSpanBuilder_ == null) {
        result.sameProcessAsParentSpan_ = sameProcessAsParentSpan_;
      } else {
        result.sameProcessAsParentSpan_ = sameProcessAsParentSpanBuilder_.build();
      }
      if (childSpanCountBuilder_ == null) {
        result.childSpanCount_ = childSpanCount_;
      } else {
        result.childSpanCount_ = childSpanCountBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.devtools.cloudtrace.v2.Span) {
        return mergeFrom((com.google.devtools.cloudtrace.v2.Span) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span other) {
      if (other == com.google.devtools.cloudtrace.v2.Span.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (!other.getSpanId().isEmpty()) {
        spanId_ = other.spanId_;
        onChanged();
      }
      if (!other.getParentSpanId().isEmpty()) {
        parentSpanId_ = other.parentSpanId_;
        onChanged();
      }
      if (other.hasDisplayName()) {
        mergeDisplayName(other.getDisplayName());
      }
      if (other.hasStartTime()) {
        mergeStartTime(other.getStartTime());
      }
      if (other.hasEndTime()) {
        mergeEndTime(other.getEndTime());
      }
      if (other.hasAttributes()) {
        mergeAttributes(other.getAttributes());
      }
      if (other.hasStackTrace()) {
        mergeStackTrace(other.getStackTrace());
      }
      if (other.hasTimeEvents()) {
        mergeTimeEvents(other.getTimeEvents());
      }
      if (other.hasLinks()) {
        mergeLinks(other.getLinks());
      }
      if (other.hasStatus()) {
        mergeStatus(other.getStatus());
      }
      if (other.hasSameProcessAsParentSpan()) {
        mergeSameProcessAsParentSpan(other.getSameProcessAsParentSpan());
      }
      if (other.hasChildSpanCount()) {
        mergeChildSpanCount(other.getChildSpanCount());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource name of the span in the following format:
     *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
     * [TRACE_ID] is a unique identifier for a trace within a project;
     * it is a 32-character hexadecimal encoding of a 16-byte array.
     * [SPAN_ID] is a unique identifier for a span within a trace; it
     * is a 16-character hexadecimal encoding of an 8-byte array.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    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;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the span in the following format:
     *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
     * [TRACE_ID] is a unique identifier for a trace within a project;
     * it is a 32-character hexadecimal encoding of a 16-byte array.
     * [SPAN_ID] is a unique identifier for a span within a trace; it
     * is a 16-character hexadecimal encoding of an 8-byte array.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    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;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the span in the following format:
     *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
     * [TRACE_ID] is a unique identifier for a trace within a project;
     * it is a 32-character hexadecimal encoding of a 16-byte array.
     * [SPAN_ID] is a unique identifier for a span within a trace; it
     * is a 16-character hexadecimal encoding of an 8-byte array.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the span in the following format:
     *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
     * [TRACE_ID] is a unique identifier for a trace within a project;
     * it is a 32-character hexadecimal encoding of a 16-byte array.
     * [SPAN_ID] is a unique identifier for a span within a trace; it
     * is a 16-character hexadecimal encoding of an 8-byte array.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the span in the following format:
     *     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
     * [TRACE_ID] is a unique identifier for a trace within a project;
     * it is a 32-character hexadecimal encoding of a 16-byte array.
     * [SPAN_ID] is a unique identifier for a span within a trace; it
     * is a 16-character hexadecimal encoding of an 8-byte array.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object spanId_ = "";
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] portion of the span's resource name.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public java.lang.String getSpanId() {
      java.lang.Object ref = spanId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        spanId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] portion of the span's resource name.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public com.google.protobuf.ByteString getSpanIdBytes() {
      java.lang.Object ref = spanId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        spanId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] portion of the span's resource name.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public Builder setSpanId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      spanId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] portion of the span's resource name.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public Builder clearSpanId() {

      spanId_ = getDefaultInstance().getSpanId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] portion of the span's resource name.
     * </pre>
     *
     * <code>string span_id = 2;</code>
     */
    public Builder setSpanIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object parentSpanId_ = "";
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] of this span's parent span. If this is a root span,
     * then this field must be empty.
     * </pre>
     *
     * <code>string parent_span_id = 3;</code>
     */
    public java.lang.String getParentSpanId() {
      java.lang.Object ref = parentSpanId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parentSpanId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] of this span's parent span. If this is a root span,
     * then this field must be empty.
     * </pre>
     *
     * <code>string parent_span_id = 3;</code>
     */
    public com.google.protobuf.ByteString getParentSpanIdBytes() {
      java.lang.Object ref = parentSpanId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parentSpanId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] of this span's parent span. If this is a root span,
     * then this field must be empty.
     * </pre>
     *
     * <code>string parent_span_id = 3;</code>
     */
    public Builder setParentSpanId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parentSpanId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] of this span's parent span. If this is a root span,
     * then this field must be empty.
     * </pre>
     *
     * <code>string parent_span_id = 3;</code>
     */
    public Builder clearParentSpanId() {

      parentSpanId_ = getDefaultInstance().getParentSpanId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The [SPAN_ID] of this span's parent span. If this is a root span,
     * then this field must be empty.
     * </pre>
     *
     * <code>string parent_span_id = 3;</code>
     */
    public Builder setParentSpanIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.devtools.cloudtrace.v2.TruncatableString displayName_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.TruncatableString,
            com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
            com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>
        displayNameBuilder_;
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public boolean hasDisplayName() {
      return displayNameBuilder_ != null || displayName_ != null;
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public com.google.devtools.cloudtrace.v2.TruncatableString getDisplayName() {
      if (displayNameBuilder_ == null) {
        return displayName_ == null
            ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
            : displayName_;
      } else {
        return displayNameBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public Builder setDisplayName(com.google.devtools.cloudtrace.v2.TruncatableString value) {
      if (displayNameBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        displayName_ = value;
        onChanged();
      } else {
        displayNameBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public Builder setDisplayName(
        com.google.devtools.cloudtrace.v2.TruncatableString.Builder builderForValue) {
      if (displayNameBuilder_ == null) {
        displayName_ = builderForValue.build();
        onChanged();
      } else {
        displayNameBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public Builder mergeDisplayName(com.google.devtools.cloudtrace.v2.TruncatableString value) {
      if (displayNameBuilder_ == null) {
        if (displayName_ != null) {
          displayName_ =
              com.google.devtools.cloudtrace.v2.TruncatableString.newBuilder(displayName_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          displayName_ = value;
        }
        onChanged();
      } else {
        displayNameBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public Builder clearDisplayName() {
      if (displayNameBuilder_ == null) {
        displayName_ = null;
        onChanged();
      } else {
        displayName_ = null;
        displayNameBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public com.google.devtools.cloudtrace.v2.TruncatableString.Builder getDisplayNameBuilder() {

      onChanged();
      return getDisplayNameFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    public com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder getDisplayNameOrBuilder() {
      if (displayNameBuilder_ != null) {
        return displayNameBuilder_.getMessageOrBuilder();
      } else {
        return displayName_ == null
            ? com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()
            : displayName_;
      }
    }
    /**
     *
     *
     * <pre>
     * A description of the span's operation (up to 128 bytes).
     * Stackdriver Trace displays the description in the
     * {% dynamic print site_values.console_name %}.
     * For example, the display name can be a qualified method name or a file name
     * and a line number where the operation is called. A best practice is to use
     * the same display name within an application and at the same call point.
     * This makes it easier to correlate spans in different traces.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.TruncatableString,
            com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
            com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>
        getDisplayNameFieldBuilder() {
      if (displayNameBuilder_ == null) {
        displayNameBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.TruncatableString,
                com.google.devtools.cloudtrace.v2.TruncatableString.Builder,
                com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>(
                getDisplayName(), getParentForChildren(), isClean());
        displayName_ = null;
      }
      return displayNameBuilder_;
    }

    private com.google.protobuf.Timestamp startTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        startTimeBuilder_;
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public boolean hasStartTime() {
      return startTimeBuilder_ != null || startTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public com.google.protobuf.Timestamp getStartTime() {
      if (startTimeBuilder_ == null) {
        return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      } else {
        return startTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    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;
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (startTimeBuilder_ == null) {
        startTime_ = builderForValue.build();
        onChanged();
      } else {
        startTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    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;
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public Builder clearStartTime() {
      if (startTimeBuilder_ == null) {
        startTime_ = null;
        onChanged();
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() {

      onChanged();
      return getStartTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
      if (startTimeBuilder_ != null) {
        return startTimeBuilder_.getMessageOrBuilder();
      } else {
        return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * The start time of the span. On the client side, this is the time kept by
     * the local machine where the span execution starts. On the server side, this
     * is the time when the server's application handler starts running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 5;</code>
     */
    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_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        endTimeBuilder_;
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public boolean hasEndTime() {
      return endTimeBuilder_ != null || endTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public com.google.protobuf.Timestamp getEndTime() {
      if (endTimeBuilder_ == null) {
        return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
      } else {
        return endTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    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;
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (endTimeBuilder_ == null) {
        endTime_ = builderForValue.build();
        onChanged();
      } else {
        endTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    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;
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public Builder clearEndTime() {
      if (endTimeBuilder_ == null) {
        endTime_ = null;
        onChanged();
      } else {
        endTime_ = null;
        endTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() {

      onChanged();
      return getEndTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
      if (endTimeBuilder_ != null) {
        return endTimeBuilder_.getMessageOrBuilder();
      } else {
        return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * The end time of the span. On the client side, this is the time kept by
     * the local machine where the span execution ends. On the server side, this
     * is the time when the server application handler stops running.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp end_time = 6;</code>
     */
    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 com.google.devtools.cloudtrace.v2.Span.Attributes attributes_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.Attributes,
            com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
            com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
        attributesBuilder_;
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public boolean hasAttributes() {
      return attributesBuilder_ != null || attributes_ != null;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Attributes getAttributes() {
      if (attributesBuilder_ == null) {
        return attributes_ == null
            ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
            : attributes_;
      } else {
        return attributesBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public Builder setAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
      if (attributesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        attributes_ = value;
        onChanged();
      } else {
        attributesBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public Builder setAttributes(
        com.google.devtools.cloudtrace.v2.Span.Attributes.Builder builderForValue) {
      if (attributesBuilder_ == null) {
        attributes_ = builderForValue.build();
        onChanged();
      } else {
        attributesBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public Builder mergeAttributes(com.google.devtools.cloudtrace.v2.Span.Attributes value) {
      if (attributesBuilder_ == null) {
        if (attributes_ != null) {
          attributes_ =
              com.google.devtools.cloudtrace.v2.Span.Attributes.newBuilder(attributes_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          attributes_ = value;
        }
        onChanged();
      } else {
        attributesBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public Builder clearAttributes() {
      if (attributesBuilder_ == null) {
        attributes_ = null;
        onChanged();
      } else {
        attributes_ = null;
        attributesBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Attributes.Builder getAttributesBuilder() {

      onChanged();
      return getAttributesFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() {
      if (attributesBuilder_ != null) {
        return attributesBuilder_.getMessageOrBuilder();
      } else {
        return attributes_ == null
            ? com.google.devtools.cloudtrace.v2.Span.Attributes.getDefaultInstance()
            : attributes_;
      }
    }
    /**
     *
     *
     * <pre>
     * A set of attributes on the span. You can have up to 32 attributes per
     * span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.Attributes,
            com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
            com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>
        getAttributesFieldBuilder() {
      if (attributesBuilder_ == null) {
        attributesBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.Span.Attributes,
                com.google.devtools.cloudtrace.v2.Span.Attributes.Builder,
                com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder>(
                getAttributes(), getParentForChildren(), isClean());
        attributes_ = null;
      }
      return attributesBuilder_;
    }

    private com.google.devtools.cloudtrace.v2.StackTrace stackTrace_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.StackTrace,
            com.google.devtools.cloudtrace.v2.StackTrace.Builder,
            com.google.devtools.cloudtrace.v2.StackTraceOrBuilder>
        stackTraceBuilder_;
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public boolean hasStackTrace() {
      return stackTraceBuilder_ != null || stackTrace_ != null;
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public com.google.devtools.cloudtrace.v2.StackTrace getStackTrace() {
      if (stackTraceBuilder_ == null) {
        return stackTrace_ == null
            ? com.google.devtools.cloudtrace.v2.StackTrace.getDefaultInstance()
            : stackTrace_;
      } else {
        return stackTraceBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public Builder setStackTrace(com.google.devtools.cloudtrace.v2.StackTrace value) {
      if (stackTraceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        stackTrace_ = value;
        onChanged();
      } else {
        stackTraceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public Builder setStackTrace(
        com.google.devtools.cloudtrace.v2.StackTrace.Builder builderForValue) {
      if (stackTraceBuilder_ == null) {
        stackTrace_ = builderForValue.build();
        onChanged();
      } else {
        stackTraceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public Builder mergeStackTrace(com.google.devtools.cloudtrace.v2.StackTrace value) {
      if (stackTraceBuilder_ == null) {
        if (stackTrace_ != null) {
          stackTrace_ =
              com.google.devtools.cloudtrace.v2.StackTrace.newBuilder(stackTrace_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          stackTrace_ = value;
        }
        onChanged();
      } else {
        stackTraceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public Builder clearStackTrace() {
      if (stackTraceBuilder_ == null) {
        stackTrace_ = null;
        onChanged();
      } else {
        stackTrace_ = null;
        stackTraceBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public com.google.devtools.cloudtrace.v2.StackTrace.Builder getStackTraceBuilder() {

      onChanged();
      return getStackTraceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    public com.google.devtools.cloudtrace.v2.StackTraceOrBuilder getStackTraceOrBuilder() {
      if (stackTraceBuilder_ != null) {
        return stackTraceBuilder_.getMessageOrBuilder();
      } else {
        return stackTrace_ == null
            ? com.google.devtools.cloudtrace.v2.StackTrace.getDefaultInstance()
            : stackTrace_;
      }
    }
    /**
     *
     *
     * <pre>
     * Stack trace captured at the start of the span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.StackTrace,
            com.google.devtools.cloudtrace.v2.StackTrace.Builder,
            com.google.devtools.cloudtrace.v2.StackTraceOrBuilder>
        getStackTraceFieldBuilder() {
      if (stackTraceBuilder_ == null) {
        stackTraceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.StackTrace,
                com.google.devtools.cloudtrace.v2.StackTrace.Builder,
                com.google.devtools.cloudtrace.v2.StackTraceOrBuilder>(
                getStackTrace(), getParentForChildren(), isClean());
        stackTrace_ = null;
      }
      return stackTraceBuilder_;
    }

    private com.google.devtools.cloudtrace.v2.Span.TimeEvents timeEvents_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.TimeEvents,
            com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder,
            com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder>
        timeEventsBuilder_;
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public boolean hasTimeEvents() {
      return timeEventsBuilder_ != null || timeEvents_ != null;
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvents getTimeEvents() {
      if (timeEventsBuilder_ == null) {
        return timeEvents_ == null
            ? com.google.devtools.cloudtrace.v2.Span.TimeEvents.getDefaultInstance()
            : timeEvents_;
      } else {
        return timeEventsBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public Builder setTimeEvents(com.google.devtools.cloudtrace.v2.Span.TimeEvents value) {
      if (timeEventsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        timeEvents_ = value;
        onChanged();
      } else {
        timeEventsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public Builder setTimeEvents(
        com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder builderForValue) {
      if (timeEventsBuilder_ == null) {
        timeEvents_ = builderForValue.build();
        onChanged();
      } else {
        timeEventsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public Builder mergeTimeEvents(com.google.devtools.cloudtrace.v2.Span.TimeEvents value) {
      if (timeEventsBuilder_ == null) {
        if (timeEvents_ != null) {
          timeEvents_ =
              com.google.devtools.cloudtrace.v2.Span.TimeEvents.newBuilder(timeEvents_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          timeEvents_ = value;
        }
        onChanged();
      } else {
        timeEventsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public Builder clearTimeEvents() {
      if (timeEventsBuilder_ == null) {
        timeEvents_ = null;
        onChanged();
      } else {
        timeEvents_ = null;
        timeEventsBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder getTimeEventsBuilder() {

      onChanged();
      return getTimeEventsFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder getTimeEventsOrBuilder() {
      if (timeEventsBuilder_ != null) {
        return timeEventsBuilder_.getMessageOrBuilder();
      } else {
        return timeEvents_ == null
            ? com.google.devtools.cloudtrace.v2.Span.TimeEvents.getDefaultInstance()
            : timeEvents_;
      }
    }
    /**
     *
     *
     * <pre>
     * A set of time events. You can have up to 32 annotations and 128 message
     * events per span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.TimeEvents,
            com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder,
            com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder>
        getTimeEventsFieldBuilder() {
      if (timeEventsBuilder_ == null) {
        timeEventsBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.Span.TimeEvents,
                com.google.devtools.cloudtrace.v2.Span.TimeEvents.Builder,
                com.google.devtools.cloudtrace.v2.Span.TimeEventsOrBuilder>(
                getTimeEvents(), getParentForChildren(), isClean());
        timeEvents_ = null;
      }
      return timeEventsBuilder_;
    }

    private com.google.devtools.cloudtrace.v2.Span.Links links_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.Links,
            com.google.devtools.cloudtrace.v2.Span.Links.Builder,
            com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder>
        linksBuilder_;
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public boolean hasLinks() {
      return linksBuilder_ != null || links_ != null;
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Links getLinks() {
      if (linksBuilder_ == null) {
        return links_ == null
            ? com.google.devtools.cloudtrace.v2.Span.Links.getDefaultInstance()
            : links_;
      } else {
        return linksBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public Builder setLinks(com.google.devtools.cloudtrace.v2.Span.Links value) {
      if (linksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        links_ = value;
        onChanged();
      } else {
        linksBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public Builder setLinks(com.google.devtools.cloudtrace.v2.Span.Links.Builder builderForValue) {
      if (linksBuilder_ == null) {
        links_ = builderForValue.build();
        onChanged();
      } else {
        linksBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public Builder mergeLinks(com.google.devtools.cloudtrace.v2.Span.Links value) {
      if (linksBuilder_ == null) {
        if (links_ != null) {
          links_ =
              com.google.devtools.cloudtrace.v2.Span.Links.newBuilder(links_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          links_ = value;
        }
        onChanged();
      } else {
        linksBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public Builder clearLinks() {
      if (linksBuilder_ == null) {
        links_ = null;
        onChanged();
      } else {
        links_ = null;
        linksBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.Links.Builder getLinksBuilder() {

      onChanged();
      return getLinksFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    public com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder getLinksOrBuilder() {
      if (linksBuilder_ != null) {
        return linksBuilder_.getMessageOrBuilder();
      } else {
        return links_ == null
            ? com.google.devtools.cloudtrace.v2.Span.Links.getDefaultInstance()
            : links_;
      }
    }
    /**
     *
     *
     * <pre>
     * Links associated with the span. You can have up to 128 links per Span.
     * </pre>
     *
     * <code>.google.devtools.cloudtrace.v2.Span.Links links = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.devtools.cloudtrace.v2.Span.Links,
            com.google.devtools.cloudtrace.v2.Span.Links.Builder,
            com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder>
        getLinksFieldBuilder() {
      if (linksBuilder_ == null) {
        linksBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.devtools.cloudtrace.v2.Span.Links,
                com.google.devtools.cloudtrace.v2.Span.Links.Builder,
                com.google.devtools.cloudtrace.v2.Span.LinksOrBuilder>(
                getLinks(), getParentForChildren(), isClean());
        links_ = null;
      }
      return linksBuilder_;
    }

    private com.google.rpc.Status status_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        statusBuilder_;
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public boolean hasStatus() {
      return statusBuilder_ != null || status_ != null;
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public com.google.rpc.Status getStatus() {
      if (statusBuilder_ == null) {
        return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
      } else {
        return statusBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public Builder setStatus(com.google.rpc.Status value) {
      if (statusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        status_ = value;
        onChanged();
      } else {
        statusBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
      if (statusBuilder_ == null) {
        status_ = builderForValue.build();
        onChanged();
      } else {
        statusBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public Builder mergeStatus(com.google.rpc.Status value) {
      if (statusBuilder_ == null) {
        if (status_ != null) {
          status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial();
        } else {
          status_ = value;
        }
        onChanged();
      } else {
        statusBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public Builder clearStatus() {
      if (statusBuilder_ == null) {
        status_ = null;
        onChanged();
      } else {
        status_ = null;
        statusBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public com.google.rpc.Status.Builder getStatusBuilder() {

      onChanged();
      return getStatusFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
      if (statusBuilder_ != null) {
        return statusBuilder_.getMessageOrBuilder();
      } else {
        return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
      }
    }
    /**
     *
     *
     * <pre>
     * An optional final status for this span.
     * </pre>
     *
     * <code>.google.rpc.Status status = 11;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        getStatusFieldBuilder() {
      if (statusBuilder_ == null) {
        statusBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.rpc.Status,
                com.google.rpc.Status.Builder,
                com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean());
        status_ = null;
      }
      return statusBuilder_;
    }

    private com.google.protobuf.BoolValue sameProcessAsParentSpan_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.BoolValue,
            com.google.protobuf.BoolValue.Builder,
            com.google.protobuf.BoolValueOrBuilder>
        sameProcessAsParentSpanBuilder_;
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public boolean hasSameProcessAsParentSpan() {
      return sameProcessAsParentSpanBuilder_ != null || sameProcessAsParentSpan_ != null;
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public com.google.protobuf.BoolValue getSameProcessAsParentSpan() {
      if (sameProcessAsParentSpanBuilder_ == null) {
        return sameProcessAsParentSpan_ == null
            ? com.google.protobuf.BoolValue.getDefaultInstance()
            : sameProcessAsParentSpan_;
      } else {
        return sameProcessAsParentSpanBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public Builder setSameProcessAsParentSpan(com.google.protobuf.BoolValue value) {
      if (sameProcessAsParentSpanBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        sameProcessAsParentSpan_ = value;
        onChanged();
      } else {
        sameProcessAsParentSpanBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public Builder setSameProcessAsParentSpan(
        com.google.protobuf.BoolValue.Builder builderForValue) {
      if (sameProcessAsParentSpanBuilder_ == null) {
        sameProcessAsParentSpan_ = builderForValue.build();
        onChanged();
      } else {
        sameProcessAsParentSpanBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public Builder mergeSameProcessAsParentSpan(com.google.protobuf.BoolValue value) {
      if (sameProcessAsParentSpanBuilder_ == null) {
        if (sameProcessAsParentSpan_ != null) {
          sameProcessAsParentSpan_ =
              com.google.protobuf.BoolValue.newBuilder(sameProcessAsParentSpan_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          sameProcessAsParentSpan_ = value;
        }
        onChanged();
      } else {
        sameProcessAsParentSpanBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public Builder clearSameProcessAsParentSpan() {
      if (sameProcessAsParentSpanBuilder_ == null) {
        sameProcessAsParentSpan_ = null;
        onChanged();
      } else {
        sameProcessAsParentSpan_ = null;
        sameProcessAsParentSpanBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public com.google.protobuf.BoolValue.Builder getSameProcessAsParentSpanBuilder() {

      onChanged();
      return getSameProcessAsParentSpanFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    public com.google.protobuf.BoolValueOrBuilder getSameProcessAsParentSpanOrBuilder() {
      if (sameProcessAsParentSpanBuilder_ != null) {
        return sameProcessAsParentSpanBuilder_.getMessageOrBuilder();
      } else {
        return sameProcessAsParentSpan_ == null
            ? com.google.protobuf.BoolValue.getDefaultInstance()
            : sameProcessAsParentSpan_;
      }
    }
    /**
     *
     *
     * <pre>
     * (Optional) Set this parameter to indicate whether this span is in
     * the same process as its parent. If you do not set this parameter,
     * Stackdriver Trace is unable to take advantage of this helpful
     * information.
     * </pre>
     *
     * <code>.google.protobuf.BoolValue same_process_as_parent_span = 12;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.BoolValue,
            com.google.protobuf.BoolValue.Builder,
            com.google.protobuf.BoolValueOrBuilder>
        getSameProcessAsParentSpanFieldBuilder() {
      if (sameProcessAsParentSpanBuilder_ == null) {
        sameProcessAsParentSpanBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.BoolValue,
                com.google.protobuf.BoolValue.Builder,
                com.google.protobuf.BoolValueOrBuilder>(
                getSameProcessAsParentSpan(), getParentForChildren(), isClean());
        sameProcessAsParentSpan_ = null;
      }
      return sameProcessAsParentSpanBuilder_;
    }

    private com.google.protobuf.Int32Value childSpanCount_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Int32Value,
            com.google.protobuf.Int32Value.Builder,
            com.google.protobuf.Int32ValueOrBuilder>
        childSpanCountBuilder_;
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public boolean hasChildSpanCount() {
      return childSpanCountBuilder_ != null || childSpanCount_ != null;
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public com.google.protobuf.Int32Value getChildSpanCount() {
      if (childSpanCountBuilder_ == null) {
        return childSpanCount_ == null
            ? com.google.protobuf.Int32Value.getDefaultInstance()
            : childSpanCount_;
      } else {
        return childSpanCountBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public Builder setChildSpanCount(com.google.protobuf.Int32Value value) {
      if (childSpanCountBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        childSpanCount_ = value;
        onChanged();
      } else {
        childSpanCountBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public Builder setChildSpanCount(com.google.protobuf.Int32Value.Builder builderForValue) {
      if (childSpanCountBuilder_ == null) {
        childSpanCount_ = builderForValue.build();
        onChanged();
      } else {
        childSpanCountBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public Builder mergeChildSpanCount(com.google.protobuf.Int32Value value) {
      if (childSpanCountBuilder_ == null) {
        if (childSpanCount_ != null) {
          childSpanCount_ =
              com.google.protobuf.Int32Value.newBuilder(childSpanCount_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          childSpanCount_ = value;
        }
        onChanged();
      } else {
        childSpanCountBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public Builder clearChildSpanCount() {
      if (childSpanCountBuilder_ == null) {
        childSpanCount_ = null;
        onChanged();
      } else {
        childSpanCount_ = null;
        childSpanCountBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public com.google.protobuf.Int32Value.Builder getChildSpanCountBuilder() {

      onChanged();
      return getChildSpanCountFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    public com.google.protobuf.Int32ValueOrBuilder getChildSpanCountOrBuilder() {
      if (childSpanCountBuilder_ != null) {
        return childSpanCountBuilder_.getMessageOrBuilder();
      } else {
        return childSpanCount_ == null
            ? com.google.protobuf.Int32Value.getDefaultInstance()
            : childSpanCount_;
      }
    }
    /**
     *
     *
     * <pre>
     * An optional number of child spans that were generated while this span
     * was active. If set, allows implementation to detect missing child spans.
     * </pre>
     *
     * <code>.google.protobuf.Int32Value child_span_count = 13;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Int32Value,
            com.google.protobuf.Int32Value.Builder,
            com.google.protobuf.Int32ValueOrBuilder>
        getChildSpanCountFieldBuilder() {
      if (childSpanCountBuilder_ == null) {
        childSpanCountBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Int32Value,
                com.google.protobuf.Int32Value.Builder,
                com.google.protobuf.Int32ValueOrBuilder>(
                getChildSpanCount(), getParentForChildren(), isClean());
        childSpanCount_ = null;
      }
      return childSpanCountBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.devtools.cloudtrace.v2.Span)
  }

  // @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span)
  private static final com.google.devtools.cloudtrace.v2.Span DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.devtools.cloudtrace.v2.Span();
  }

  public static com.google.devtools.cloudtrace.v2.Span getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.devtools.cloudtrace.v2.Span getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
