@SuppressWarnings({"deprecation", "InconsistentOverloads"})
  public static SpanData create(
      SpanContext context,
      @Nullable SpanId parentSpanId,
      @Nullable Boolean hasRemoteParent,
      String name,
      @Nullable Kind kind,
      Timestamp startTimestamp,
      Attributes attributes,
      TimedEvents<Annotation> annotations,
      TimedEvents<? extends io.opencensus.trace.BaseMessageEvent> messageOrNetworkEvents,
      Links links,
      @Nullable Integer childSpanCount,
      @Nullable Status status,
      @Nullable Timestamp endTimestamp) {
    Utils.checkNotNull(messageOrNetworkEvents, "messageOrNetworkEvents");
    List<TimedEvent<MessageEvent>> messageEventsList = new ArrayList<TimedEvent<MessageEvent>>();
    for (TimedEvent<? extends io.opencensus.trace.BaseMessageEvent> timedEvent :
        messageOrNetworkEvents.getEvents()) {
      io.opencensus.trace.BaseMessageEvent event = timedEvent.getEvent();
      if (event instanceof MessageEvent) {
        @SuppressWarnings("unchecked")
        TimedEvent<MessageEvent> timedMessageEvent = (TimedEvent<MessageEvent>) timedEvent;
        messageEventsList.add(timedMessageEvent);
      } else {
        messageEventsList.add(
            TimedEvent.<MessageEvent>create(
                timedEvent.getTimestamp(), BaseMessageEventUtils.asMessageEvent(event)));
      }
    }
    TimedEvents<MessageEvent> messageEvents =
        TimedEvents.<MessageEvent>create(
            messageEventsList, messageOrNetworkEvents.getDroppedEventsCount());
    return new AutoValue_SpanData(
        context,
        parentSpanId,
        hasRemoteParent,
        name,
        kind,
        startTimestamp,
        attributes,
        annotations,
        messageEvents,
        links,
        childSpanCount,
        status,
        endTimestamp);
  }
@ SuppressWarnings ( { "deprecation" , "InconsistentOverloads" } ) public static SpanData create ( SpanContext context , @ Nullable SpanId parentSpanId , @ Nullable Boolean hasRemoteParent , String name , @ Nullable Kind kind , Timestamp startTimestamp , Attributes attributes , TimedEvents < Annotation > annotations , TimedEvents < ? extends io . opencensus . trace . BaseMessageEvent > messageOrNetworkEvents , Links links , @ Nullable Integer childSpanCount , @ Nullable Status status , @ Nullable Timestamp endTimestamp ) { Utils . checkNotNull ( messageOrNetworkEvents , "messageOrNetworkEvents" ) ; List < TimedEvent < MessageEvent > > messageEventsList = new ArrayList < TimedEvent < MessageEvent > > ( ) ; for ( TimedEvent < ? extends io . opencensus . trace . BaseMessageEvent > timedEvent : messageOrNetworkEvents . getEvents ( ) ) { io . opencensus . trace . BaseMessageEvent event = timedEvent . getEvent ( ) ; if ( event instanceof MessageEvent ) { @ SuppressWarnings ( "unchecked" ) TimedEvent < MessageEvent > timedMessageEvent = ( TimedEvent < MessageEvent > ) timedEvent ; messageEventsList . add ( timedMessageEvent ) ; } else { messageEventsList . add ( TimedEvent . < MessageEvent > create ( timedEvent . getTimestamp ( ) , BaseMessageEventUtils . asMessageEvent ( event ) ) ) ; } } TimedEvents < MessageEvent > messageEvents = TimedEvents . < MessageEvent > create ( messageEventsList , messageOrNetworkEvents . getDroppedEventsCount ( ) ) ; return new AutoValue_SpanData ( context , parentSpanId , hasRemoteParent , name , kind , startTimestamp , attributes , annotations , messageEvents , links , childSpanCount , status , endTimestamp ) ; }
Returns a new immutable {@code SpanData}.

@param context the {@code SpanContext} of the {@code Span}.
@param parentSpanId the parent {@code SpanId} of the {@code Span}. {@code null} if the {@code
Span} is a root.
@param hasRemoteParent {@code true} if the parent {@code Span} is remote. {@code null} if this
is a root span.
@param name the name of the {@code Span}.
@param kind the kind of the {@code Span}.
@param startTimestamp the start {@code Timestamp} of the {@code Span}.
@param attributes the attributes associated with the {@code Span}.
@param annotations the annotations associated with the {@code Span}.
@param messageOrNetworkEvents the message events (or network events for backward compatibility)
associated with the {@code Span}.
@param links the links associated with the {@code Span}.
@param childSpanCount the number of child spans that were generated while the span was active.
@param status the {@code Status} of the {@code Span}. {@code null} if the {@code Span} is still
active.
@param endTimestamp the end {@code Timestamp} of the {@code Span}. {@code null} if the {@code
Span} is still active.
@return a new immutable {@code SpanData}.
@since 0.14