Package io.opentelemetry.api.trace
Class TraceStateBuilder
- java.lang.Object
-
- io.opentelemetry.api.trace.TraceStateBuilder
-
public final class TraceStateBuilder extends Object
A builder ofTraceState
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_VENDOR_ID_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraceState
build()
Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.TraceStateBuilder
remove(String key)
Removes theEntry
that has the givenkey
if it is present.TraceStateBuilder
set(String key, String value)
Adds or updates theEntry
that has the givenkey
if it is present.
-
-
-
Field Detail
-
MAX_VENDOR_ID_SIZE
public static final int MAX_VENDOR_ID_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
set
public TraceStateBuilder set(String key, String value)
Adds or updates theEntry
that has the givenkey
if it is present. The newEntry
will always be added in the front of the list of entries.- Parameters:
key
- the key for theEntry
to be added.value
- the value for theEntry
to be added.- Returns:
- this.
-
remove
public TraceStateBuilder remove(String key)
Removes theEntry
that has the givenkey
if it is present.- Parameters:
key
- the key for theEntry
to be removed.- Returns:
- this.
-
build
public TraceState build()
Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.- Returns:
- a TraceState with the new entries.
-
-