Class Callables

java.lang.Object
dev.mccue.guava.concurrent.Callables

public final class Callables extends Object
Static utility methods pertaining to the Callable interface.
Since:
1.0
Author:
Isaac Shum
  • Method Details

    • returning

      public static <T extends @Nullable Object> Callable<T> returning(T value)
      Creates a Callable which immediately returns a preset value each time it is called.
    • asAsyncCallable

      public static <T extends @Nullable Object> AsyncCallable<T> asAsyncCallable(Callable<T> callable, ListeningExecutorService listeningExecutorService)
      Creates an AsyncCallable from a Callable.

      The AsyncCallable returns the ListenableFuture resulting from ListeningExecutorService#submit(Callable).

      Since:
      20.0