Package io.opentelemetry.api.baggage
Interface BaggageBuilder
public interface BaggageBuilder
A builder of
Baggage.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aBaggagefrom this builder.default BaggageBuilderAdds 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- theStringkey which will be set.value- theStringvalue to set for the given key.entryMetadata- theBaggageEntryMetadatametadata 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- theStringkey which will be set.value- theStringvalue to set for the given key.- Returns:
- this
-
remove
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.
-