Class SucceededFuture<V>

    • Constructor Detail

      • SucceededFuture

        public SucceededFuture​(EventExecutor executor,
                               V result)
        Creates a new instance.
        Parameters:
        executor - the EventExecutor associated with this future
    • Method Detail

      • cause

        public java.lang.Throwable cause()
        Description copied from interface: Future
        Returns the cause of the failed I/O operation if the I/O operation has failed.
        Returns:
        the cause of the failure. null if succeeded or this future is not completed yet.
      • isSuccess

        public boolean isSuccess()
        Description copied from interface: Future
        Returns true if and only if the I/O operation was completed successfully.
      • getNow

        public V getNow()
        Description copied from interface: Future
        Return the result without blocking. If the future is not done yet this will return 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.