Class AsyncResultImpl<T>

  • All Implemented Interfaces:
    AsyncResult<T>

    public class AsyncResultImpl<T>
    extends java.lang.Object
    implements AsyncResult<T>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkError()
      If there was a general exception or a KeeperException a RuntimeException is thrown that wraps the exception.
      void checkException()
      If there was a general exception (but not a KeeperException) a RuntimeException is thrown that wraps the exception.
      boolean equals​(java.lang.Object o)  
      org.apache.zookeeper.KeeperException.Code getCode()
      Return the ZooKeeper result code.
      java.util.Optional<java.lang.Throwable> getException()
      An optional wrapper around any general exception
      java.lang.Throwable getRawException()
      Return any general exception or null
      T getRawValue()
      Returns the raw result of the ZooKeeper method or null
      java.util.Optional<T> getValue()
      An optional wrapper around the ZooKeeper method result
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AsyncResultImpl

        public AsyncResultImpl()
      • AsyncResultImpl

        public AsyncResultImpl​(org.apache.zookeeper.KeeperException.Code code)
      • AsyncResultImpl

        public AsyncResultImpl​(T value)
      • AsyncResultImpl

        public AsyncResultImpl​(java.lang.Throwable exception)
    • Method Detail

      • getRawValue

        public T getRawValue()
        Description copied from interface: AsyncResult
        Returns the raw result of the ZooKeeper method or null
        Specified by:
        getRawValue in interface AsyncResult<T>
        Returns:
        result or null
      • getValue

        public java.util.Optional<T> getValue()
        Description copied from interface: AsyncResult
        An optional wrapper around the ZooKeeper method result
        Specified by:
        getValue in interface AsyncResult<T>
        Returns:
        wrapped result
      • getCode

        public org.apache.zookeeper.KeeperException.Code getCode()
        Description copied from interface: AsyncResult
        Return the ZooKeeper result code. If the method was successful, KeeperException.Code.OK is returned. If there was a general exception KeeperException.Code.SYSTEMERROR is returned.
        Specified by:
        getCode in interface AsyncResult<T>
        Returns:
        result code
      • getRawException

        public java.lang.Throwable getRawException()
        Description copied from interface: AsyncResult
        Return any general exception or null
        Specified by:
        getRawException in interface AsyncResult<T>
        Returns:
        exception or null
      • getException

        public java.util.Optional<java.lang.Throwable> getException()
        Description copied from interface: AsyncResult
        An optional wrapper around any general exception
        Specified by:
        getException in interface AsyncResult<T>
        Returns:
        wrapped exception
      • checkException

        public void checkException()
        Description copied from interface: AsyncResult
        If there was a general exception (but not a KeeperException) a RuntimeException is thrown that wraps the exception. Otherwise, the method returns without any action being performed.
        Specified by:
        checkException in interface AsyncResult<T>
      • checkError

        public void checkError()
        Description copied from interface: AsyncResult
        If there was a general exception or a KeeperException a RuntimeException is thrown that wraps the exception. Otherwise, the method returns without any action being performed.
        Specified by:
        checkError in interface AsyncResult<T>
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object