Class SameExecutorCompletionStage<T>

  • All Implemented Interfaces:
    java.util.concurrent.CompletionStage<T>

    final class SameExecutorCompletionStage<T>
    extends java.lang.Object
    implements java.util.concurrent.CompletionStage<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.Executor defaultExecutor  
      private java.util.concurrent.CompletionStage<T> delegate  
    • Constructor Summary

      Constructors 
      Constructor Description
      SameExecutorCompletionStage​(java.util.concurrent.CompletionStage<T> delegate, java.util.concurrent.Executor defaultExecutor)  
    • Method Summary

      All Methods Static 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)  
      (package private) static <T> SameExecutorCompletionStage<T> of​(java.util.concurrent.CompletionStage<T> delegate, java.util.concurrent.Executor defaultExecutor)  
      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.CompletableFuture<T> toCompletableFuture()  
      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
    • Field Detail

      • delegate

        private final java.util.concurrent.CompletionStage<T> delegate
      • defaultExecutor

        private final java.util.concurrent.Executor defaultExecutor
    • Constructor Detail

      • SameExecutorCompletionStage

        SameExecutorCompletionStage​(java.util.concurrent.CompletionStage<T> delegate,
                                    java.util.concurrent.Executor defaultExecutor)
    • Method Detail

      • of

        static final <T> SameExecutorCompletionStage<T> of​(java.util.concurrent.CompletionStage<T> delegate,
                                                           java.util.concurrent.Executor defaultExecutor)
      • thenApply

        public final <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 final <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 final <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 final 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 final 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 final 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 final java.util.concurrent.CompletionStage<java.lang.Void> thenRun​(java.lang.Runnable action)
        Specified by:
        thenRun in interface java.util.concurrent.CompletionStage<T>
      • thenRunAsync

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

        public final 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 final <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 final <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 final <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 final <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 final <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 final <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 final 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 final 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 final 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 final <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 final <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 final <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 final 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 final 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 final 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 final 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 final 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 final 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 final <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 final <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 final <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 final 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 final 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 final 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 final 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 final <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 final <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 final <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>
      • toCompletableFuture

        public final java.util.concurrent.CompletableFuture<T> toCompletableFuture()
        Specified by:
        toCompletableFuture in interface java.util.concurrent.CompletionStage<T>