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 Baggage
build()
Creates aBaggage
from this builder.BaggageBuilder
put(java.lang.String key, java.lang.String value, BaggageEntryMetadata entryMetadata)
Adds the key/value pair and metadata regardless of whether the key is present.BaggageBuilder
remove(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:BaggageBuilder
Adds the key/value pair and metadata regardless of whether the key is present.- Specified by:
put
in interfaceBaggageBuilder
- 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
-
remove
public BaggageBuilder remove(java.lang.String key)
Description copied from interface:BaggageBuilder
Removes the key if it exists.- Specified by:
remove
in interfaceBaggageBuilder
- Parameters:
key
- theString
key which will be removed.- Returns:
- this
-
build
public Baggage build()
Description copied from interface:BaggageBuilder
Creates aBaggage
from this builder.- Specified by:
build
in interfaceBaggageBuilder
- Returns:
- a
Baggage
with the same entries as this builder.
-
-