Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.
This repository was archived by the owner on May 23, 2023. It is now read-only.

Add unwrap to interfaces #282

@jpkrohling

Description

@jpkrohling

It would be useful to have a <T extends Span> unwrap() method on the Span interface (and similar methods on similar interfaces), similar to JPA's. It would make it easier to call implementation-specific methods.

Before:

    Span span = tracer.buildSpan("test-operation").start();
    long traceId = ((JaegerSpanContext) span.context()).getTraceId();

After:

    Span span = tracer.buildSpan("test-operation").start();
    long traceId = span.context().<JaegerSpanContext>unwrap().getTraceId();

Before:

    JaegerSpanContext expectedContext = (JaegerSpanContext) jaegerSpan.context();

After:

    JaegerSpanContext expectedContext = jaegerSpan.context().unwrap();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions