Span implements Closeable, Serializable { public String toJSON() { if (cachedJsonRepresentation == null) { cachedJsonRepresentation = SpanParser.convertSpanToJSON(this); } return cachedJsonRepresentation; } 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; }
@DataProvider(value = { "true", "false" }) @Test public void toJson_matches_SpanParser_convertSpanToJSON(boolean completed) { Span span = createFilledOutSpan(completed); String jsonFromSpanParser = SpanParser.convertSpanToJSON(span); String jsonFromSpan = span.toJSON(); assertThat(jsonFromSpan).isEqualTo(jsonFromSpanParser); }