@BetaApi(value="Reference ApiCallContext instead - this class is likely to experience breaking changes") @InternalExtensionOnly public final class GrpcCallContext extends Object implements com.google.api.gax.rpc.ApiCallContext
GrpcCallContext is immutable in the sense that none of its methods modifies the
GrpcCallContext itself or the underlying data. Methods of the form withX, such as withTransportChannel(com.google.api.gax.rpc.TransportChannel), return copies of the object, but with one field changed. The immutability
and thread safety of the arguments solely depends on the arguments themselves.
| Modifier and Type | Method and Description |
|---|---|
static GrpcCallContext |
createDefault()
Returns an empty instance with a null channel and default
CallOptions. |
boolean |
equals(Object o) |
io.grpc.CallOptions |
getCallOptions()
The
CallOptions set on this context. |
io.grpc.Channel |
getChannel()
The
Channel set on this context. |
int |
hashCode() |
com.google.api.gax.rpc.ApiCallContext |
merge(com.google.api.gax.rpc.ApiCallContext inputCallContext) |
GrpcCallContext |
nullToSelf(com.google.api.gax.rpc.ApiCallContext inputContext)
Returns inputContext cast to
GrpcCallContext, or an empty GrpcCallContext if
inputContext is null. |
static GrpcCallContext |
of(io.grpc.Channel channel,
io.grpc.CallOptions callOptions)
Returns an instance with the given channel and
CallOptions. |
GrpcCallContext |
withCallOptions(io.grpc.CallOptions newCallOptions)
Returns a new instance with the call options set to the given call options.
|
GrpcCallContext |
withChannel(io.grpc.Channel newChannel)
Returns a new instance with the channel set to the given channel.
|
GrpcCallContext |
withCredentials(com.google.auth.Credentials newCredentials) |
GrpcCallContext |
withRequestParamsDynamicHeaderOption(String requestParams) |
GrpcCallContext |
withTimeout(org.threeten.bp.Duration rpcTimeout) |
GrpcCallContext |
withTransportChannel(com.google.api.gax.rpc.TransportChannel inputChannel) |
public static GrpcCallContext createDefault()
CallOptions.public static GrpcCallContext of(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
CallOptions.public GrpcCallContext nullToSelf(com.google.api.gax.rpc.ApiCallContext inputContext)
GrpcCallContext, or an empty GrpcCallContext if
inputContext is null.nullToSelf in interface com.google.api.gax.rpc.ApiCallContextinputContext - the ApiCallContext to cast if it is not nullpublic GrpcCallContext withCredentials(com.google.auth.Credentials newCredentials)
withCredentials in interface com.google.api.gax.rpc.ApiCallContextpublic GrpcCallContext withTransportChannel(com.google.api.gax.rpc.TransportChannel inputChannel)
withTransportChannel in interface com.google.api.gax.rpc.ApiCallContextpublic GrpcCallContext withTimeout(org.threeten.bp.Duration rpcTimeout)
withTimeout in interface com.google.api.gax.rpc.ApiCallContextpublic com.google.api.gax.rpc.ApiCallContext merge(com.google.api.gax.rpc.ApiCallContext inputCallContext)
merge in interface com.google.api.gax.rpc.ApiCallContextpublic io.grpc.Channel getChannel()
Channel set on this context.public io.grpc.CallOptions getCallOptions()
CallOptions set on this context.public GrpcCallContext withChannel(io.grpc.Channel newChannel)
public GrpcCallContext withCallOptions(io.grpc.CallOptions newCallOptions)
public GrpcCallContext withRequestParamsDynamicHeaderOption(String requestParams)