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.Constructor and Description |
---|
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> |
nullValue() |
void |
run() |
public DoneFuture(T payload)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
public void run()
run
in interface Runnable
run
in interface RunnableFuture<T>
public static <T> DoneFuture<T> nullValue()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.