Class DefaultInMemoryTraceState
- java.lang.Object
-
- io.servicetalk.opentracing.inmemory.DefaultInMemoryTraceState
-
- All Implemented Interfaces:
InMemoryTraceState
public final class DefaultInMemoryTraceState extends java.lang.Object implements InMemoryTraceState
Default implementation ofInMemoryTraceState
.
-
-
Constructor Summary
Constructors Constructor Description DefaultInMemoryTraceState(java.lang.String traceIdHex, java.lang.String spanIdHex, java.lang.String parentSpanIdHex, boolean sampled)
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSampled()
Determine if this state is sampled.java.lang.String
parentSpanIdHex()
The hex representation of the parent's spanId.java.lang.String
spanIdHex()
The hex representation of the traceId.java.lang.String
traceIdHex()
The hex representation of the traceId.
-
-
-
Constructor Detail
-
DefaultInMemoryTraceState
public DefaultInMemoryTraceState(java.lang.String traceIdHex, java.lang.String spanIdHex, @Nullable java.lang.String parentSpanIdHex, boolean sampled)
Constructs an instance.- Parameters:
traceIdHex
- trace IDspanIdHex
- span IDparentSpanIdHex
- parent span ID, optionalsampled
- whether the trace is sampled
-
-
Method Detail
-
traceIdHex
public java.lang.String traceIdHex()
Description copied from interface:InMemoryTraceState
The hex representation of the traceId.- Specified by:
traceIdHex
in interfaceInMemoryTraceState
- Returns:
- hex representation of the traceId.
-
spanIdHex
public java.lang.String spanIdHex()
Description copied from interface:InMemoryTraceState
The hex representation of the traceId.- Specified by:
spanIdHex
in interfaceInMemoryTraceState
- Returns:
- hex representation of the traceId.
-
parentSpanIdHex
@Nullable public java.lang.String parentSpanIdHex()
Description copied from interface:InMemoryTraceState
The hex representation of the parent's spanId.- Specified by:
parentSpanIdHex
in interfaceInMemoryTraceState
- Returns:
- hex representation of the parent's spanId, or
null
if there is no parent.
-
isSampled
public boolean isSampled()
Description copied from interface:InMemoryTraceState
Determine if this state is sampled.- Specified by:
isSampled
in interfaceInMemoryTraceState
- Returns:
true
if this state is sampled.
-
-