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 | Field and Description |
|---|---|
static io.grpc.Context.Key<TagContext> |
TAG_CONTEXT_KEY
Deprecated.
from API since 0.21. Use
withValue(Context, TagContext) and getValue(Context) instead. |
| 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. |
@Deprecated public static final io.grpc.Context.Key<TagContext> TAG_CONTEXT_KEY
withValue(Context, TagContext) and getValue(Context) instead.Context.Key used to interact with the TagContext contained in the
Context.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.