@Beta public final class SettableFuture<V> extends AbstractListenableFuture<V>
ValueFuture)| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
static <V> SettableFuture<V> |
create()
Creates a new
SettableFuture in the default state. |
boolean |
set(V newValue)
Sets the value of this future.
|
boolean |
setException(Throwable t)
Sets the future to having failed with the given exception.
|
addListener, donecancel, get, get, isCancelled, isDoneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, get, isCancelled, isDonepublic static <V> SettableFuture<V> create()
SettableFuture in the default state.public boolean set(@Nullable
V newValue)
true if
the value was successfully set, or false if the future has already
been set or cancelled.set in class AbstractFuture<V>newValue - the value the future should hold.public boolean setException(Throwable t)
true if the exception was successfully set,
or false if the future has already been set or cancelled.setException in class AbstractFuture<V>t - the exception the future should hold.Copyright © 2010-2012. All Rights Reserved.