Span implements Closeable, Serializable { public List<TimestampedAnnotation> getTimestampedAnnotations() { return unmodifiableAnnotations; } Span(String traceId, String parentSpanId, String spanId, String spanName, boolean sampleable, String userId,
                SpanPurpose spanPurpose, long spanStartTimeEpochMicros, Long spanStartTimeNanos, Long durationNanos,
                Map<String,String> tags, List<TimestampedAnnotation> annotations
    ); protected  Span(); static Builder generateRootSpanForNewTrace(String spanName, SpanPurpose spanPurpose); Span generateChildSpan(String spanName, SpanPurpose spanPurpose); static Builder newBuilder(String spanName, SpanPurpose spanPurpose); static Builder newBuilder(Span copy); String getTraceId(); String getSpanId(); String getParentSpanId(); String getSpanName(); boolean isSampleable(); String getUserId(); long getSpanStartTimeEpochMicros(); long getSpanStartTimeNanos(); SpanPurpose getSpanPurpose(); boolean isCompleted(); Long getDurationNanos(); TracerManagedSpanStatus getCurrentTracerManagedSpanStatus(); Map<String,String> getTags(); void putTag(String key, String value); void removeTag(String key); List<TimestampedAnnotation> getTimestampedAnnotations(); void addTimestampedAnnotationForCurrentTime(String value); void addTimestampedAnnotation(TimestampedAnnotation timestampedAnnotation); @Override String toString(); String toKeyValueString(); String toJSON(); @Override void close(); @Override boolean equals(Object o); @Override int hashCode(); @Deprecated static Span fromKeyValueString(String keyValueStr); @Deprecated static Span fromJSON(String json); @Deprecated
    static final String TRACE_ID_FIELD; @Deprecated
    static final String PARENT_SPAN_ID_FIELD; @Deprecated
    static final String SPAN_ID_FIELD; @Deprecated
    static final String SPAN_NAME_FIELD; @Deprecated
    static final String SAMPLEABLE_FIELD; @Deprecated
    static final String USER_ID_FIELD; @Deprecated
    static final String SPAN_PURPOSE_FIELD; @Deprecated
    static final String START_TIME_EPOCH_MICROS_FIELD; @Deprecated
    static final String DURATION_NANOS_FIELD; }
@Test public void public_constructor_uses_empty_annotations_list_when_annotations_argument_is_null() { Span span = new Span(traceId, parentSpanId, spanId, spanName, true, userId, null, 42, null, null, null, null); assertThat(span.getTimestampedAnnotations()) .isNotNull() .isEmpty(); }
@Test public void getTimestampedAnnotations_returns_unmodifiable_list() { Span span = createFilledOutSpan(false); Throwable ex1 = catchThrowable(() -> span.getTimestampedAnnotations().add(mock(TimestampedAnnotation.class))); Throwable ex2 = catchThrowable(() -> span.getTimestampedAnnotations().remove(0)); Throwable ex3 = catchThrowable(() -> span.getTimestampedAnnotations().clear()); assertThat(ex1).isInstanceOf(UnsupportedOperationException.class); assertThat(ex2).isInstanceOf(UnsupportedOperationException.class); assertThat(ex3).isInstanceOf(UnsupportedOperationException.class); }