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 intMAX_VENDOR_ID_SIZE
-
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.TraceStateBuilderremove(String key)Removes theEntrythat has the givenkeyif it is present.TraceStateBuilderset(String key, String value)Adds or updates theEntrythat has the givenkeyif 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 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 TraceStateBuilder 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.
-
-