Package io.opentelemetry.api.trace
Interface TraceStateBuilder
-
public interface TraceStateBuilderA builder ofTraceState. 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
All Methods Instance Methods Abstract 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(java.lang.String key)Removes theEntrythat has the givenkeyif it is present.TraceStateBuilderset(java.lang.String key, java.lang.String value)Adds or updates theEntrythat has the givenkeyif it is present.
-
-
-
Method Detail
-
set
TraceStateBuilder set(java.lang.String key, java.lang.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
TraceStateBuilder remove(java.lang.String key)
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.
-
-