Top Description Methods
io.opentelemetry.api.trace

public Interface TraceStateBuilder

Known Direct Implementers
io.opentelemetry.api.trace.ArrayBasedTraceStateBuilder

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 TypeMethod and Description
public TraceState

Returns:

a TraceState with the new entries.
build
()

Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.

public TraceStateBuilder

Returns:

this.
put
(String
the key for the Entry to be added.
key
,
String
the value for the Entry to be added.
value
)

Adds or updates the Entry that has the given key if it is present.

public TraceStateBuilder

Returns:

this.
remove
(String
the key for the Entry to be removed.
key
)

Removes the Entry that has the given key if it is present.

Method Detail

buildback to summary
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:TraceState

a TraceState with the new entries.

putback to summary
public TraceStateBuilder put(String key, String value)

Adds or updates the Entry that has the given key if it is present. The new Entry will always be added in the front of the list of entries.

Parameters
key:String

the key for the Entry to be added.

value:String

the value for the Entry to be added.

Returns:TraceStateBuilder

this.

removeback to summary
public TraceStateBuilder remove(String key)

Removes the Entry that has the given key if it is present.

Parameters
key:String

the key for the Entry to be removed.

Returns:TraceStateBuilder

this.