Java java.util.concurrent CompletableFuture fields, constructors, methods, implement or subclass

Example usage for Java java.util.concurrent CompletableFuture fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util.concurrent CompletableFuture.

The text is from its open source code.

Subclass

java.util.concurrent.CompletableFuture has subclasses.
Click this link to see all its subclasses.

Constructor

CompletableFuture()
Creates a new incomplete CompletableFuture.

Method

CompletableFutureallOf(CompletableFuture... cfs)
Returns a new CompletableFuture that is completed when all of the given CompletableFutures complete.
CompletableFutureanyOf(CompletableFuture... cfs)
Returns a new CompletableFuture that is completed when any of the given CompletableFutures complete, with the same result.
booleancancel(boolean mayInterruptIfRunning)
If not already completed, completes this CompletableFuture with a CancellationException .
booleancomplete(T value)
If not already completed, sets the value returned by #get() and related methods to the given value.
CompletableFuturecompletedFuture(U value)
Returns a new CompletableFuture that is already completed with the given value.
booleancompleteExceptionally(Throwable ex)
If not already completed, causes invocations of #get() and related methods to throw the given exception.
CompletableFutureexceptionally(Function fn)
Tget()
Waits if necessary for this future to complete, and then returns its result.
Tget(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
TgetNow(T valueIfAbsent)
Returns the result value (or throws any encountered exception) if completed, else returns the given valueIfAbsent.
CompletableFuturehandle(BiFunction fn)
CompletableFuturehandleAsync(BiFunction fn)
inthashCode()
Returns a hash code value for the object.
booleanisCancelled()
Returns true if this CompletableFuture was cancelled before it completed normally.
booleanisCompletedExceptionally()
Returns true if this CompletableFuture completed exceptionally, in any way.
booleanisDone()
Returns true if completed in any fashion: normally, exceptionally, or via cancellation.
Tjoin()
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally.
voidobtrudeException(Throwable ex)
Forcibly causes subsequent invocations of method #get() and related methods to throw the given exception, whether or not already completed.
CompletableFuturerunAsync(Runnable runnable, Executor executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.
CompletableFuturerunAsync(Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() after it runs the given action.
CompletableFuturesupplyAsync(Supplier supplier, Executor executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.
CompletableFuturesupplyAsync(Supplier supplier)
Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() with the value obtained by calling the given Supplier.
CompletableFuturethenAccept(Consumer action)
CompletableFuturethenAcceptAsync(Consumer action)
CompletableFuturethenAcceptAsync(Consumer action, Executor executor)
CompletableFuturethenApply(Function fn)
CompletableFuturethenApplyAsync(Function fn, Executor executor)
CompletableFuturethenApplyAsync(Function fn)
CompletableFuturethenCombine(CompletionStage other, BiFunction fn)
CompletableFuturethenCompose(Function> fn)
CompletableFuturethenComposeAsync(Function> fn, Executor executor)
CompletableFuturethenComposeAsync(Function> fn)
CompletableFuturethenRun(Runnable action)
voidwait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
CompletableFuturewhenComplete(BiConsumer action)
CompletableFuturewhenCompleteAsync(BiConsumer action, Executor executor)