public V1Span convert(Span value) {
    md.parse(value);
    result
        .clear()
        .traceId(value.traceId())
        .parentId(value.parentId())
        .id(value.id())
        .name(value.name())
        .debug(value.debug());

    // Don't report timestamp and duration on shared spans (should be server, but not necessarily)
    if (!Boolean.TRUE.equals(value.shared())) {
      result.timestamp(value.timestampAsLong());
      result.duration(value.durationAsLong());
    }

    boolean beginAnnotation = md.startTs != 0L && md.begin != null;
    boolean endAnnotation = md.endTs != 0L && md.end != null;
    Endpoint ep = value.localEndpoint();
    int annotationCount = value.annotations().size();
    if (beginAnnotation) {
      annotationCount++;
      result.addAnnotation(md.startTs, md.begin, ep);
    }
    for (int i = 0, length = value.annotations().size(); i < length; i++) {
      Annotation a = value.annotations().get(i);
      if (beginAnnotation && a.value().equals(md.begin)) continue;
      if (endAnnotation && a.value().equals(md.end)) continue;
      result.addAnnotation(a.timestamp(), a.value(), ep);
    }
    if (endAnnotation) {
      annotationCount++;
      result.addAnnotation(md.endTs, md.end, ep);
    }

    for (Map.Entry<String, String> b : value.tags().entrySet()) {
      result.addBinaryAnnotation(b.getKey(), b.getValue(), ep);
    }

    boolean writeLocalComponent = annotationCount == 0 && ep != null && value.tags().isEmpty();
    boolean hasRemoteEndpoint = md.addr != null && value.remoteEndpoint() != null;

    // write an empty "lc" annotation to avoid missing the localEndpoint in an in-process span
    if (writeLocalComponent) result.addBinaryAnnotation("lc", "", ep);
    if (hasRemoteEndpoint) result.addBinaryAnnotation(md.addr, value.remoteEndpoint());
    return result.build();
  }
Allows you convert a v2 span into a v1 span. This is helpful for legacy storage which still use
annotations. This shouldn't be used by new code.

<p>This type isn't thread-safe: it re-uses state to avoid re-allocations in conversion loops.
zipkin/src/main/java/zipkin2/v1/V2SpanConverter.java