Package io.opentelemetry.api.baggage
Interface BaggageBuilder
-
public interface BaggageBuilder
A builder ofBaggage
.- See Also:
Baggage.builder()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Baggage
build()
Creates aBaggage
from this builder.default BaggageBuilder
put(String key, String value)
Adds the key/value pair with empty metadata regardless of whether the key is present.BaggageBuilder
put(String key, String value, BaggageEntryMetadata entryMetadata)
Adds the key/value pair and metadata regardless of whether the key is present.BaggageBuilder
remove(String key)
Removes the key if it exists.
-
-
-
Method Detail
-
put
BaggageBuilder put(String key, String value, BaggageEntryMetadata entryMetadata)
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
default BaggageBuilder put(String key, String value)
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
BaggageBuilder remove(String key)
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.
-
-