@GwtCompatible(emulated=true) public final class Callables extends java.lang.Object
Callable interface.| Modifier and Type | Method and Description |
|---|---|
static <T> AsyncCallable<T> |
asAsyncCallable(java.util.concurrent.Callable<T> callable,
ListeningExecutorService listeningExecutorService)
Creates an
AsyncCallable from a Callable. |
static <T> java.util.concurrent.Callable<T> |
returning(T value)
Creates a
Callable which immediately returns a preset value each time it is called. |
public static <T> java.util.concurrent.Callable<T> returning(@Nullable
T value)
Callable which immediately returns a preset value each time it is called.@Beta @GwtIncompatible public static <T> AsyncCallable<T> asAsyncCallable(java.util.concurrent.Callable<T> callable, ListeningExecutorService listeningExecutorService)
AsyncCallable from a Callable.
The AsyncCallable returns the ListenableFuture resulting from
ListeningExecutorService.submit(Callable).