Package io.opentelemetry.api.trace
Interface TraceStateBuilder
public interface TraceStateBuilder
A builder of
TraceState. This implementation does full validation of the keys and values
in the entries, and will ignore any entries that do not conform to the W3C specification.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.Adds or updates theEntrythat has the givenkeyif it is present.Removes theEntrythat has the givenkeyif it is present.
-
Method Details
-
put
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
Removes theEntrythat has the givenkeyif it is present.- Parameters:
key- the key for theEntryto be removed.- Returns:
- this.
-
build
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.
-