Class ListenableFuturesExtra


  • public class ListenableFuturesExtra
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> java.util.concurrent.CompletableFuture<V> toCompletableFuture​(com.google.common.util.concurrent.ListenableFuture<V> future)
      Wrap a ListenableFuture in a CompletableFuture.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ListenableFuturesExtra

        public ListenableFuturesExtra()
    • Method Detail

      • toCompletableFuture

        public static <V> java.util.concurrent.CompletableFuture<V> toCompletableFuture​(com.google.common.util.concurrent.ListenableFuture<V> future)
        Wrap a ListenableFuture in a CompletableFuture. The returned future will complete with the same result or failure as the original future. Completing the returned future does not complete the original future.
        Parameters:
        future - The ListenableFuture to wrap in a CompletableFuture.
        Returns:
        A CompletableFuture that completes when the original future completes.