T
- The type of object in this Future
.public class DoneFuture<T> extends Object implements RunnableFuture<T>
Future
that is always done and will just yield the object that was given at creation
time.Modifier | Constructor and Description |
---|---|
protected |
DoneFuture(T payload) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
static <T> DoneFuture<T> |
of(T result) |
void |
run() |
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public void run()
run
in interface Runnable
run
in interface RunnableFuture<T>
public static <T> DoneFuture<T> of(@Nullable T result)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.