Top Description Methods
io.opentelemetry.api.baggage

public Interface BaggageBuilder

Known Direct Implementers
io.opentelemetry.api.baggage.ImmutableBaggage.Builder

A builder of Baggage.
See Also
Baggage#builder()

Method Summary

Modifier and TypeMethod and Description
public Baggage

Returns:

a Baggage with the same entries as this builder.
build
()

Creates a Baggage from this builder.

public BaggageBuilder

Returns:

this
put
(String
the String key which will be set.
key
,
String
the String value to set for the given key.
value
,
BaggageEntryMetadata
the BaggageEntryMetadata metadata to set for the given key.
entryMetadata
)

Adds the key/value pair and metadata regardless of whether the key is present.

public default BaggageBuilder

Returns:

this
put
(String
the String key which will be set.
key
,
String
the String value to set for the given key.
value
)

Adds the key/value pair with empty metadata regardless of whether the key is present.

public BaggageBuilder

Returns:

this
remove
(String
the String key which will be removed.
key
)

Removes the key if it exists.

Method Detail

buildback to summary
public Baggage build()

Creates a Baggage from this builder.

Returns:Baggage

a Baggage with the same entries as this builder.

putback to summary
public BaggageBuilder put(String key, String value, BaggageEntryMetadata entryMetadata)

Adds the key/value pair and metadata regardless of whether the key is present.

Parameters
key:String

the String key which will be set.

value:String

the String value to set for the given key.

entryMetadata:BaggageEntryMetadata

the BaggageEntryMetadata metadata to set for the given key.

Returns:BaggageBuilder

this

putback to summary
public default BaggageBuilder put(String key, String value)

Adds the key/value pair with empty metadata regardless of whether the key is present.

Parameters
key:String

the String key which will be set.

value:String

the String value to set for the given key.

Returns:BaggageBuilder

this

removeback to summary
public BaggageBuilder remove(String key)

Removes the key if it exists.

Parameters
key:String

the String key which will be removed.

Returns:BaggageBuilder

this