Class AbstractAsyncFuture<T>

  • All Implemented Interfaces:
    AsyncFuture<T>, java.util.concurrent.CompletionStage<T>, java.util.concurrent.Future<T>
    Direct Known Subclasses:
    FailedAsyncFuture, SuccessAsyncFuture

    public abstract class AbstractAsyncFuture<T>
    extends java.lang.Object
    implements AsyncFuture<T>
    Created by acurtis on 5/1/18.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEither​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<U> applyToEither​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn)  
      <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn)  
      <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<T> exceptionally​(java.util.function.Function<java.lang.Throwable,​? extends T> fn)  
      <U> java.util.concurrent.CompletionStage<U> handle​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> handleAsync​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> handleAsync​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenAccept​(java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<U> thenApply​(java.util.function.Function<? super T,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn, java.util.concurrent.Executor executor)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombine​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<U> thenCompose​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRun​(java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<T> whenComplete​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action)  
      java.util.concurrent.CompletionStage<T> whenCompleteAsync​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action)  
      java.util.concurrent.CompletionStage<T> whenCompleteAsync​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action, java.util.concurrent.Executor executor)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.CompletionStage

        toCompletableFuture
      • Methods inherited from interface java.util.concurrent.Future

        cancel, get, get, isCancelled, isDone
    • Constructor Detail

      • AbstractAsyncFuture

        public AbstractAsyncFuture()
    • Method Detail

      • thenApply

        public <U> java.util.concurrent.CompletionStage<U> thenApply​(java.util.function.Function<? super T,​? extends U> fn)
        Specified by:
        thenApply in interface java.util.concurrent.CompletionStage<T>
      • thenApplyAsync

        public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn)
        Specified by:
        thenApplyAsync in interface java.util.concurrent.CompletionStage<T>
      • thenApplyAsync

        public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn,
                                                                          java.util.concurrent.Executor executor)
        Specified by:
        thenApplyAsync in interface java.util.concurrent.CompletionStage<T>
      • thenAccept

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept​(java.util.function.Consumer<? super T> action)
        Specified by:
        thenAccept in interface java.util.concurrent.CompletionStage<T>
      • thenAcceptAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action)
        Specified by:
        thenAcceptAsync in interface java.util.concurrent.CompletionStage<T>
      • thenAcceptAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action,
                                                                                    java.util.concurrent.Executor executor)
        Specified by:
        thenAcceptAsync in interface java.util.concurrent.CompletionStage<T>
      • thenRun

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRun​(java.lang.Runnable action)
        Specified by:
        thenRun in interface java.util.concurrent.CompletionStage<T>
      • thenRunAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action)
        Specified by:
        thenRunAsync in interface java.util.concurrent.CompletionStage<T>
      • thenRunAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action,
                                                                                 java.util.concurrent.Executor executor)
        Specified by:
        thenRunAsync in interface java.util.concurrent.CompletionStage<T>
      • thenCombine

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombine​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                               java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)
        Specified by:
        thenCombine in interface java.util.concurrent.CompletionStage<T>
      • thenCombineAsync

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                    java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)
        Specified by:
        thenCombineAsync in interface java.util.concurrent.CompletionStage<T>
      • thenCombineAsync

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                    java.util.function.BiFunction<? super T,​? super U,​? extends V> fn,
                                                                                    java.util.concurrent.Executor executor)
        Specified by:
        thenCombineAsync in interface java.util.concurrent.CompletionStage<T>
      • thenAcceptBoth

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                       java.util.function.BiConsumer<? super T,​? super U> action)
        Specified by:
        thenAcceptBoth in interface java.util.concurrent.CompletionStage<T>
      • thenAcceptBothAsync

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                            java.util.function.BiConsumer<? super T,​? super U> action)
        Specified by:
        thenAcceptBothAsync in interface java.util.concurrent.CompletionStage<T>
      • thenAcceptBothAsync

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                            java.util.function.BiConsumer<? super T,​? super U> action,
                                                                                            java.util.concurrent.Executor executor)
        Specified by:
        thenAcceptBothAsync in interface java.util.concurrent.CompletionStage<T>
      • runAfterBoth

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth​(java.util.concurrent.CompletionStage<?> other,
                                                                                 java.lang.Runnable action)
        Specified by:
        runAfterBoth in interface java.util.concurrent.CompletionStage<T>
      • runAfterBothAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                      java.lang.Runnable action)
        Specified by:
        runAfterBothAsync in interface java.util.concurrent.CompletionStage<T>
      • runAfterBothAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                      java.lang.Runnable action,
                                                                                      java.util.concurrent.Executor executor)
        Specified by:
        runAfterBothAsync in interface java.util.concurrent.CompletionStage<T>
      • applyToEither

        public <U> java.util.concurrent.CompletionStage<U> applyToEither​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                         java.util.function.Function<? super T,​U> fn)
        Specified by:
        applyToEither in interface java.util.concurrent.CompletionStage<T>
      • applyToEitherAsync

        public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                              java.util.function.Function<? super T,​U> fn)
        Specified by:
        applyToEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • applyToEitherAsync

        public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                              java.util.function.Function<? super T,​U> fn,
                                                                              java.util.concurrent.Executor executor)
        Specified by:
        applyToEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • acceptEither

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEither​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                 java.util.function.Consumer<? super T> action)
        Specified by:
        acceptEither in interface java.util.concurrent.CompletionStage<T>
      • acceptEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                      java.util.function.Consumer<? super T> action)
        Specified by:
        acceptEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • acceptEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                      java.util.function.Consumer<? super T> action,
                                                                                      java.util.concurrent.Executor executor)
        Specified by:
        acceptEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • runAfterEither

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither​(java.util.concurrent.CompletionStage<?> other,
                                                                                   java.lang.Runnable action)
        Specified by:
        runAfterEither in interface java.util.concurrent.CompletionStage<T>
      • runAfterEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                        java.lang.Runnable action)
        Specified by:
        runAfterEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • runAfterEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                        java.lang.Runnable action,
                                                                                        java.util.concurrent.Executor executor)
        Specified by:
        runAfterEitherAsync in interface java.util.concurrent.CompletionStage<T>
      • thenCompose

        public <U> java.util.concurrent.CompletionStage<U> thenCompose​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)
        Specified by:
        thenCompose in interface java.util.concurrent.CompletionStage<T>
      • thenComposeAsync

        public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)
        Specified by:
        thenComposeAsync in interface java.util.concurrent.CompletionStage<T>
      • thenComposeAsync

        public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn,
                                                                            java.util.concurrent.Executor executor)
        Specified by:
        thenComposeAsync in interface java.util.concurrent.CompletionStage<T>
      • exceptionally

        public java.util.concurrent.CompletionStage<T> exceptionally​(java.util.function.Function<java.lang.Throwable,​? extends T> fn)
        Specified by:
        exceptionally in interface java.util.concurrent.CompletionStage<T>
      • whenComplete

        public java.util.concurrent.CompletionStage<T> whenComplete​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action)
        Specified by:
        whenComplete in interface java.util.concurrent.CompletionStage<T>
      • whenCompleteAsync

        public java.util.concurrent.CompletionStage<T> whenCompleteAsync​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action)
        Specified by:
        whenCompleteAsync in interface java.util.concurrent.CompletionStage<T>
      • whenCompleteAsync

        public java.util.concurrent.CompletionStage<T> whenCompleteAsync​(java.util.function.BiConsumer<? super T,​? super java.lang.Throwable> action,
                                                                         java.util.concurrent.Executor executor)
        Specified by:
        whenCompleteAsync in interface java.util.concurrent.CompletionStage<T>
      • handle

        public <U> java.util.concurrent.CompletionStage<U> handle​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn)
        Specified by:
        handle in interface java.util.concurrent.CompletionStage<T>
      • handleAsync

        public <U> java.util.concurrent.CompletionStage<U> handleAsync​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn)
        Specified by:
        handleAsync in interface java.util.concurrent.CompletionStage<T>
      • handleAsync

        public <U> java.util.concurrent.CompletionStage<U> handleAsync​(java.util.function.BiFunction<? super T,​java.lang.Throwable,​? extends U> fn,
                                                                       java.util.concurrent.Executor executor)
        Specified by:
        handleAsync in interface java.util.concurrent.CompletionStage<T>