Package io.opentelemetry.api.trace
Interface TraceStateBuilder
-
public interface TraceStateBuilder
A 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 TraceState
build()
Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.TraceStateBuilder
put(String key, String value)
Adds or updates theEntry
that has the givenkey
if it is present.TraceStateBuilder
remove(String key)
Removes theEntry
that has the givenkey
if it is present.
-
-
-
Method Detail
-
put
TraceStateBuilder put(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
TraceStateBuilder 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
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.
-
-