Class CompletableFutureDelegate<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    CompletionStage<T>, Future<T>

    public class CompletableFutureDelegate<T>
    extends CompletableFuture<T>
    CompletableFuture with a delegate that can be set at most once. If this future was cancelled before the delegate was set, then the delegate will be cancelled immediately when it is set.
    Author:
    raven
    • Field Detail

      • delegate

        protected Future<?> delegate
      • isCancelled

        protected Boolean isCancelled
    • Constructor Detail

      • CompletableFutureDelegate

        public CompletableFutureDelegate()
      • CompletableFutureDelegate

        public CompletableFutureDelegate​(Future<?> delegate)
    • Method Detail

      • setDelegate

        public void setDelegate​(Future<?> delegate)