Package io.opentelemetry.api.baggage
Class ImmutableBaggage
- java.lang.Object
-
- io.opentelemetry.api.internal.ImmutableKeyValuePairs<java.lang.String,BaggageEntry>
-
- io.opentelemetry.api.baggage.ImmutableBaggage
-
- All Implemented Interfaces:
Baggage
,ImplicitContextKeyed
@Immutable final class ImmutableBaggage extends ImmutableKeyValuePairs<java.lang.String,BaggageEntry> implements Baggage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ImmutableBaggage.Builder
-
Constructor Summary
Constructors Modifier Constructor Description private
ImmutableBaggage(java.lang.Object[] data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static BaggageBuilder
builder()
Creates a newBaggageBuilder
for creating Baggage.(package private) static Baggage
empty()
Baggage with no entries.BaggageEntry
getEntry(java.lang.String entryKey)
Returns theBaggageEntry
associated with the given key.java.lang.String
getEntryValue(java.lang.String entryKey)
Returns theString
value associated with the given key, without metadata.private static Baggage
sortAndFilterToBaggage(java.lang.Object[] data)
BaggageBuilder
toBuilder()
Create a Builder pre-initialized with the contents of this Baggage.-
Methods inherited from class io.opentelemetry.api.internal.ImmutableKeyValuePairs
asMap, data, equals, forEach, get, getData, hashCode, isEmpty, size, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.api.baggage.Baggage
asMap, forEach, isEmpty, size, storeInContext
-
Methods inherited from interface io.opentelemetry.context.ImplicitContextKeyed
makeCurrent
-
-
-
-
Field Detail
-
EMPTY
private static final Baggage EMPTY
-
-
Method Detail
-
builder
static BaggageBuilder builder()
Description copied from interface:Baggage
Creates a newBaggageBuilder
for creating Baggage.
-
getEntryValue
@Nullable public java.lang.String getEntryValue(java.lang.String entryKey)
Description copied from interface:Baggage
Returns theString
value associated with the given key, without metadata.- Specified by:
getEntryValue
in interfaceBaggage
- Parameters:
entryKey
- entry key to return the value for.- Returns:
- the value associated with the given key, or
null
if noEntry
with the givenentryKey
is in thisBaggage
.
-
getEntry
@Nullable public BaggageEntry getEntry(java.lang.String entryKey)
Description copied from interface:Baggage
Returns theBaggageEntry
associated with the given key.
-
toBuilder
public BaggageBuilder toBuilder()
Description copied from interface:Baggage
Create a Builder pre-initialized with the contents of this Baggage. The returned Builder will be set to not use an implicit parent, so any parent assignment must be done manually.
-
sortAndFilterToBaggage
private static Baggage sortAndFilterToBaggage(java.lang.Object[] data)
-
-