Class AsyncResultImpl<T>
- java.lang.Object
-
- org.apache.curator.x.async.details.AsyncResultImpl<T>
-
- All Implemented Interfaces:
AsyncResult<T>
public class AsyncResultImpl<T> extends java.lang.Object implements AsyncResult<T>
-
-
Constructor Summary
Constructors Constructor Description AsyncResultImpl()AsyncResultImpl(java.lang.Throwable exception)AsyncResultImpl(org.apache.zookeeper.KeeperException.Code code)AsyncResultImpl(T value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckError()If there was a general exception or aKeeperExceptionaRuntimeExceptionis thrown that wraps the exception.voidcheckException()If there was a general exception (but not aKeeperException) aRuntimeExceptionis thrown that wraps the exception.booleanequals(java.lang.Object o)org.apache.zookeeper.KeeperException.CodegetCode()Return the ZooKeeper result code.java.util.Optional<java.lang.Throwable>getException()An optional wrapper around any general exceptionjava.lang.ThrowablegetRawException()Return any general exception ornullTgetRawValue()Returns the raw result of the ZooKeeper method ornulljava.util.Optional<T>getValue()An optional wrapper around the ZooKeeper method resultinthashCode()java.lang.StringtoString()
-
-
-
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:AsyncResultReturns the raw result of the ZooKeeper method ornull- Specified by:
getRawValuein interfaceAsyncResult<T>- Returns:
- result or
null
-
getValue
public java.util.Optional<T> getValue()
Description copied from interface:AsyncResultAn optional wrapper around the ZooKeeper method result- Specified by:
getValuein interfaceAsyncResult<T>- Returns:
- wrapped result
-
getCode
public org.apache.zookeeper.KeeperException.Code getCode()
Description copied from interface:AsyncResultReturn the ZooKeeper result code. If the method was successful,KeeperException.Code.OKis returned. If there was a general exceptionKeeperException.Code.SYSTEMERRORis returned.- Specified by:
getCodein interfaceAsyncResult<T>- Returns:
- result code
-
getRawException
public java.lang.Throwable getRawException()
Description copied from interface:AsyncResultReturn any general exception ornull- Specified by:
getRawExceptionin interfaceAsyncResult<T>- Returns:
- exception or
null
-
getException
public java.util.Optional<java.lang.Throwable> getException()
Description copied from interface:AsyncResultAn optional wrapper around any general exception- Specified by:
getExceptionin interfaceAsyncResult<T>- Returns:
- wrapped exception
-
checkException
public void checkException()
Description copied from interface:AsyncResultIf there was a general exception (but not aKeeperException) aRuntimeExceptionis thrown that wraps the exception. Otherwise, the method returns without any action being performed.- Specified by:
checkExceptionin interfaceAsyncResult<T>
-
checkError
public void checkError()
Description copied from interface:AsyncResultIf there was a general exception or aKeeperExceptionaRuntimeExceptionis thrown that wraps the exception. Otherwise, the method returns without any action being performed.- Specified by:
checkErrorin interfaceAsyncResult<T>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-