@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, done
cancel, get, get, isCancelled, isDone
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, isCancelled, isDone
public 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.