@Immutable public final class BaggageUtils extends Object
Baggage contained in the Context.| Modifier and Type | Method and Description |
|---|---|
static io.opentelemetry.context.Scope |
currentContextWith(Baggage baggage)
|
static Baggage |
getBaggage(io.grpc.Context context)
|
static Baggage |
getBaggageWithoutDefault(io.grpc.Context context)
Returns the
Baggage from the specified Context. |
static Baggage |
getCurrentBaggage()
|
static io.grpc.Context |
withBaggage(Baggage baggage,
io.grpc.Context context)
Creates a new
Context with the given value set. |
public static io.grpc.Context withBaggage(Baggage baggage, io.grpc.Context context)
Context with the given value set.baggage - the value to be set.context - the parent Context.public static Baggage getCurrentBaggage()
Baggage from the current context.public static Baggage getBaggage(io.grpc.Context context)
context - the specified Context.Baggage from the specified Context.@Nullable public static Baggage getBaggageWithoutDefault(io.grpc.Context context)
Baggage from the specified Context. If none is found, this method
returns {code null}.context - the specified Context.Baggage from the specified Context.