Class SucceededFuture<V>

    • Constructor Detail

      • SucceededFuture

        public SucceededFuture​(V result)
    • Method Detail

      • isSuccess

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

        public Throwable cause()
        Description copied from interface: Future
        Returns the cause of the failed operation if the operation has failed.
        Returns:
        the cause of the failure. null if succeeded or this future is not completed yet.
      • 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 relay on the returned null value.