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 TraceStatebuild()Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.TraceState.Builderremove(String key)Removes theEntrythat has the givenkeyif it is present.TraceState.Builderset(String key, String value)Adds or updates theEntrythat has the givenkeyif it is present.
-
-
-
Method Detail
-
set
public TraceState.Builder set(String key, String value)
Adds or updates theEntrythat has the givenkeyif it is present. The newEntrywill always be added in the front of the list of entries.- Parameters:
key- the key for theEntryto be added.value- the value for theEntryto be added.- Returns:
- this.
-
remove
public TraceState.Builder remove(String key)
Removes theEntrythat has the givenkeyif it is present.- Parameters:
key- the key for theEntryto 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.
-
-