public final class SucceededFuture<V> extends CompleteFuture<V>
CompleteFuture which is succeeded already. It is
recommended to use EventExecutor.newSucceededFuture(Object) instead of
calling the constructor of this future.| Constructor and Description |
|---|
SucceededFuture(EventExecutor executor,
V result)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
cause()
Returns the cause of the failed I/O operation if the I/O operation has
failed.
|
V |
getNow()
Return the result without blocking.
|
boolean |
isSuccess()
Returns
true if and only if the I/O operation was completed
successfully. |
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListeners, sync, syncUninterruptiblyget, getpublic SucceededFuture(EventExecutor executor, V result)
executor - the EventExecutor associated with this futurepublic java.lang.Throwable cause()
Futurenull if succeeded or this future is not
completed yet.public boolean isSuccess()
Futuretrue if and only if the I/O operation was completed
successfully.public V getNow()
Futurenull.
As it is possible that a null value is used to mark the future as successful you also need to check
if the future is really done with Future.isDone() and not relay on the returned null value.Copyright © 2008–2018 The Netty Project. All rights reserved.