public class AsyncResultImpl<T> extends Object implements AsyncResult<T>
Constructor and Description |
---|
AsyncResultImpl() |
AsyncResultImpl(org.apache.zookeeper.KeeperException.Code code) |
AsyncResultImpl(T value) |
AsyncResultImpl(Throwable exception) |
Modifier and Type | Method and 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(Object o) |
org.apache.zookeeper.KeeperException.Code |
getCode()
Return the ZooKeeper result code.
|
Optional<Throwable> |
getException()
An optional wrapper around any general exception
|
Throwable |
getRawException()
Return any general exception or
null |
T |
getRawValue()
Returns the raw result of the ZooKeeper method or
null |
Optional<T> |
getValue()
An optional wrapper around the ZooKeeper method result
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
of
public AsyncResultImpl()
public AsyncResultImpl(org.apache.zookeeper.KeeperException.Code code)
public AsyncResultImpl(T value)
public AsyncResultImpl(Throwable exception)
public T getRawValue()
AsyncResult
null
getRawValue
in interface AsyncResult<T>
null
public Optional<T> getValue()
AsyncResult
getValue
in interface AsyncResult<T>
public org.apache.zookeeper.KeeperException.Code getCode()
AsyncResult
KeeperException.Code.OK
is returned. If there was a general
exception KeeperException.Code.SYSTEMERROR
is returned.getCode
in interface AsyncResult<T>
public Throwable getRawException()
AsyncResult
null
getRawException
in interface AsyncResult<T>
null
public Optional<Throwable> getException()
AsyncResult
getException
in interface AsyncResult<T>
public void checkException()
AsyncResult
KeeperException
)
a RuntimeException
is thrown that wraps the exception. Otherwise, the method returns
without any action being performed.checkException
in interface AsyncResult<T>
public void checkError()
AsyncResult
KeeperException
a RuntimeException
is thrown that wraps the exception. Otherwise, the method returns
without any action being performed.checkError
in interface AsyncResult<T>
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.