public abstract class AlgoResponse
extends java.lang.Object
Constructor and Description |
---|
AlgoResponse() |
Modifier and Type | Method and Description |
---|---|
protected abstract <T> T |
as(java.lang.Class<T> returnClass)
Convert the result to a specific class
|
protected abstract <T> T |
as(java.lang.reflect.Type returnType)
Convert the result to a specific type
|
<T> T |
as(TypeToken typeToken)
Convert the result to a specific type.
|
abstract Metadata |
getMetadata() |
abstract boolean |
isFailure() |
abstract boolean |
isSuccess() |
java.lang.String |
toString()
Get string representation of the result or throw an exception
|
public abstract boolean isSuccess()
public abstract boolean isFailure()
public abstract Metadata getMetadata() throws AlgorithmException
AlgorithmException
protected abstract <T> T as(java.lang.Class<T> returnClass) throws AlgorithmException
T
- the type that the response will be deserialized intoreturnClass
- the class used by the deserializer (should correspond with T)AlgorithmException
- the error, if this is AlgoFailureprotected abstract <T> T as(java.lang.reflect.Type returnType) throws AlgorithmException
T
- the type that the response will be deserialized intoreturnType
- the type used by the deserializer (should correspond with T)AlgorithmException
- the error, if this is AlgoFailurepublic <T> T as(TypeToken typeToken) throws AlgorithmException
new TypeToken<MyClass>(){}
T
- the type that the response will be deserialized intotypeToken
- the type used by the deserializer (should correspond with T)AlgorithmException
- the error, if this is AlgoFailurepublic java.lang.String toString()
toString
in class java.lang.Object