Class ExceptionTransformingUnaryCallable<RequestT,ResponseT>
java.lang.Object
com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT>
com.google.ads.googleads.lib.stubs.callables.ExceptionTransformingUnaryCallable<RequestT,ResponseT>
public class ExceptionTransformingUnaryCallable<RequestT,ResponseT>
extends com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT>
Wrapper around a
UnaryCallable which invokes an ExceptionTransformation for
Throwables which occur on the stream.
NOTE: This class could be pushed into the gax library, as it is not specific to the Google Ads API.
-
Constructor Summary
ConstructorsConstructorDescriptionExceptionTransformingUnaryCallable(com.google.api.gax.rpc.UnaryCallable<RequestT, ResponseT> callable, ExceptionTransformation transformation, Executor transformationExecutor) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.core.ApiFuture<ResponseT>futureCall(RequestT request, com.google.api.gax.rpc.ApiCallContext inputContext) Methods inherited from class com.google.api.gax.rpc.UnaryCallable
call, call, futureCall, withDefaultCallContext
-
Constructor Details
-
ExceptionTransformingUnaryCallable
public ExceptionTransformingUnaryCallable(com.google.api.gax.rpc.UnaryCallable<RequestT, ResponseT> callable, ExceptionTransformation transformation, Executor transformationExecutor) Constructs a new instance. ThetransformationExecutorshould be the executor for the callable'sClientContext.- Parameters:
callable- the Callable that may throw an exception.transformation- the transformation to perform on any thrown exceptions.transformationExecutor- the Executor to use to execute thetransformation.
-
-
Method Details