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 |
---|---|
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, syncUninterruptibly
get, get
public SucceededFuture(EventExecutor executor, V result)
executor
- the EventExecutor
associated with this futurepublic Throwable cause()
Future
null
if succeeded or this future is not
completed yet.public boolean isSuccess()
Future
true
if and only if the I/O operation was completed
successfully.public V getNow()
Future
null
.
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 rely on the returned null
value.Copyright © 2008–2024 The Netty Project. All rights reserved.