public final class ContextUtils extends Object
TagContext contained in the Context.
Most code should interact with the current context via the public APIs in TagContext and avoid accessing TAG_CONTEXT_KEY directly.
| Modifier and Type | Method and Description |
|---|---|
static TagContext |
getValue(io.grpc.Context context)
Returns the value from the specified
Context. |
static io.grpc.Context |
withValue(io.grpc.Context context,
TagContext tagContext)
Creates a new
Context with the given value set. |
public static io.grpc.Context withValue(io.grpc.Context context,
@Nullable
TagContext tagContext)
Context with the given value set.context - the parent Context.tagContext - the value to be set.public static TagContext getValue(io.grpc.Context context)
Context.context - the specified Context.Context.