Class Callables
java.lang.Object
com.google.common.util.concurrent.Callables
Static utility methods pertaining to the
Callable interface.- Since:
- 1.0
- Author:
- Isaac Shum
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends @Nullable Object>
AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallablefrom aCallable.returning(T value) Creates aCallablewhich immediately returns a preset value each time it is called.
-
Method Details
-
returning
-
asAsyncCallable
@GwtIncompatible public static <T extends @Nullable Object> AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallablefrom aCallable.The
AsyncCallablereturns theListenableFutureresulting fromListeningExecutorService.submit(Callable).- Since:
- 20.0
-