Package io.opentelemetry.api.trace
Class TraceState.Builder
- java.lang.Object
-
- io.opentelemetry.api.trace.TraceState.Builder
-
- Enclosing class:
- TraceState
public static final class TraceState.Builder extends Object
Builder class forTraceState
.
-
-
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.TraceState.Builder
remove(String key)
Removes theEntry
that has the givenkey
if it is present.TraceState.Builder
set(String key, String value)
Adds or updates theEntry
that has the givenkey
if it is present.
-
-
-
Method Detail
-
set
public TraceState.Builder 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 TraceState.Builder 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.
-
-