Package io.opentelemetry.api.baggage
Class ImmutableBaggage.Builder
- java.lang.Object
-
- io.opentelemetry.api.baggage.ImmutableBaggage.Builder
-
- All Implemented Interfaces:
BaggageBuilder
- Enclosing class:
- ImmutableBaggage
static class ImmutableBaggage.Builder extends java.lang.Object implements BaggageBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Object>data
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Baggagebuild()Creates aBaggagefrom this builder.BaggageBuilderput(java.lang.String key, java.lang.String value, BaggageEntryMetadata entryMetadata)Adds the key/value pair and metadata regardless of whether the key is present.BaggageBuilderremove(java.lang.String key)Removes the key if it exists.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.api.baggage.BaggageBuilder
put
-
-
-
-
Method Detail
-
put
public BaggageBuilder put(java.lang.String key, java.lang.String value, BaggageEntryMetadata entryMetadata)
Description copied from interface:BaggageBuilderAdds the key/value pair and metadata regardless of whether the key is present.- Specified by:
putin interfaceBaggageBuilder- 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
-
remove
public BaggageBuilder remove(java.lang.String key)
Description copied from interface:BaggageBuilderRemoves the key if it exists.- Specified by:
removein interfaceBaggageBuilder- Parameters:
key- theStringkey which will be removed.- Returns:
- this
-
build
public Baggage build()
Description copied from interface:BaggageBuilderCreates aBaggagefrom this builder.- Specified by:
buildin interfaceBaggageBuilder- Returns:
- a
Baggagewith the same entries as this builder.
-
-