Interface SingleLineValue
-
public interface SingleLineValueWrapper for supporting injecting and extracting single-string values.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.lang.Stringformat(long traceId, long spanId, java.lang.Long parentSpanId)Formats the provided trace information.static java.lang.Stringformat(java.lang.String traceIdHex, java.lang.String spanIdHex, java.lang.String parentSpanIdHex)Formats the provided trace information.static java.lang.Stringformat(java.lang.String traceIdHex, java.lang.String spanIdHex, java.lang.String parentSpanIdHex, boolean isSampled)Formats the provided trace information.java.lang.Stringget()Gets the value.static SingleLineValueof(java.lang.String value)Returns aSingleLineValuebacked by a fixed string.voidset(java.lang.String value)Sets the value.static SingleLineValueto(java.util.function.Consumer<java.lang.String> consumer)Returns aSingleLineValuewhich supports injection.
-
-
-
Method Detail
-
get
@Nullable java.lang.String get()
Gets the value.- Returns:
- the value
-
set
void set(java.lang.String value)
Sets the value.- Parameters:
value- the value
-
of
static SingleLineValue of(@Nullable java.lang.String value)
Returns aSingleLineValuebacked by a fixed string.- Parameters:
value- string value- Returns:
- a read-only
SingleLineValue
-
to
static SingleLineValue to(java.util.function.Consumer<java.lang.String> consumer)
Returns aSingleLineValuewhich supports injection.- Parameters:
consumer- consumer to call when a value is injected- Returns:
- a write-only
SingleLineValue
-
format
static java.lang.String format(long traceId, long spanId, @Nullable java.lang.Long parentSpanId)Formats the provided trace information.- Parameters:
traceId- the trace ID.spanId- the span ID.parentSpanId- the parent span ID, ornullif none available.- Returns:
- the formatted trace information as
String.
-
format
static java.lang.String format(java.lang.String traceIdHex, java.lang.String spanIdHex, @Nullable java.lang.String parentSpanIdHex)Formats the provided trace information.- Parameters:
traceIdHex- the trace ID as HEXString.spanIdHex- the span ID as HEXString.parentSpanIdHex- the parent span ID as HEXString, ornullif none available.- Returns:
- the formatted trace information as
String.
-
format
static java.lang.String format(java.lang.String traceIdHex, java.lang.String spanIdHex, @Nullable java.lang.String parentSpanIdHex, boolean isSampled)Formats the provided trace information.- Parameters:
traceIdHex- the trace ID as HEXString.spanIdHex- the span ID as HEXString.parentSpanIdHex- the parent span ID as HEXString, ornullif none available.isSampled-trueif the span is sampled.- Returns:
- the formatted trace information as
String.
-
-