Class SucceededFuture<V>
java.lang.Object
io.netty.util.concurrent.AbstractFuture<V>
io.netty.util.concurrent.CompleteFuture<V>
io.netty.util.concurrent.SucceededFuture<V>
- All Implemented Interfaces:
Future<V>, java.util.concurrent.Future<V>
The
CompleteFuture which is succeeded already. It is
recommended to use EventExecutor.newSucceededFuture(Object) instead of
calling the constructor of this future.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class CompleteFuture
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListeners, sync, syncUninterruptiblyMethods inherited from class AbstractFuture
get, getMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
result
-
-
Constructor Details
-
SucceededFuture
Creates a new instance.- Parameters:
executor- theEventExecutorassociated with this future
-
-
Method Details
-
cause
public java.lang.Throwable cause()Description copied from interface:FutureReturns the cause of the failed I/O operation if the I/O operation has failed.- Returns:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()Description copied from interface:FutureReturnstrueif and only if the I/O operation was completed successfully. -
getNow
Description copied from interface:FutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue.
-