Package org.aksw.commons.util.concurrent
Class CompletableFutureDelegate<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- org.aksw.commons.util.concurrent.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Field Summary
Fields Modifier and Type Field Description protected Future<?>delegateprotected BooleanisCancelled
-
Constructor Summary
Constructors Constructor Description CompletableFutureDelegate()CompletableFutureDelegate(Future<?> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)voidsetDelegate(Future<?> delegate)-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Constructor Detail
-
CompletableFutureDelegate
public CompletableFutureDelegate()
-
CompletableFutureDelegate
public CompletableFutureDelegate(Future<?> delegate)
-
-