Package io.opentelemetry.api.baggage
Interface BaggageBuilder
-
public interface BaggageBuilderA builder ofBaggage.- See Also:
Baggage.builder()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Baggagebuild()Creates aBaggagefrom this builder.default BaggageBuilderput(String key, String value)Adds the key/value pair with empty metadata regardless of whether the key is present.BaggageBuilderput(String key, String value, BaggageEntryMetadata entryMetadata)Adds the key/value pair and metadata regardless of whether the key is present.BaggageBuilderremove(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- theStringkey which will be set.value- theStringvalue to set for the given key.entryMetadata- theBaggageEntryMetadatametadata 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- theStringkey which will be set.value- theStringvalue to set for the given key.- Returns:
- this
-
remove
BaggageBuilder remove(String key)
Removes the key if it exists.- Parameters:
key- theStringkey which will be removed.- Returns:
- this
-
build
Baggage build()
Creates aBaggagefrom this builder.- Returns:
- a
Baggagewith the same entries as this builder.
-
-