Package io.opentelemetry.api.baggage
Interface BaggageBuilder
public interface BaggageBuilder
A builder of
Baggage
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates aBaggage
from this builder.default BaggageBuilder
Adds the key/value pair with empty metadata regardless of whether the key is present.put
(String key, String value, BaggageEntryMetadata entryMetadata) Adds the key/value pair and metadata regardless of whether the key is present.Removes the key if it exists.
-
Method Details
-
put
Adds the key/value pair and metadata regardless of whether the key is present.- Parameters:
key
- theString
key which will be set.value
- theString
value to set for the given key.entryMetadata
- theBaggageEntryMetadata
metadata to set for the given key.- Returns:
- this
-
put
Adds the key/value pair with empty metadata regardless of whether the key is present.- Parameters:
key
- theString
key which will be set.value
- theString
value to set for the given key.- Returns:
- this
-
remove
Removes the key if it exists.- Parameters:
key
- theString
key which will be removed.- Returns:
- this
-
build
Baggage build()Creates aBaggage
from this builder.- Returns:
- a
Baggage
with the same entries as this builder.
-