public abstract class AlgoResponse
extends java.lang.Object
implements java.io.Serializable
| 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 java.lang.String |
asJsonString()
Return JSON representation of the result.
|
abstract java.lang.String |
asString()
Return String representation of the result.
|
abstract AlgoAsyncResponse |
getAsyncResponse() |
abstract Metadata |
getMetadata() |
abstract java.lang.String |
getRawOutput()
Return the raw output of the algorithm if it was called with AlgorithmOutputType.RAW
This is the only valid way to retrieve a result from a RAW request.
|
abstract boolean |
isFailure() |
abstract boolean |
isSuccess() |
public abstract boolean isSuccess()
public abstract boolean isFailure()
public abstract Metadata getMetadata() throws AlgorithmException
AlgorithmExceptionpublic abstract AlgoAsyncResponse getAsyncResponse() throws AlgorithmException
AlgorithmExceptionprotected 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 abstract java.lang.String asJsonString()
throws AlgorithmException
AlgorithmException - the error, if this is AlgoFailurepublic abstract java.lang.String asString()
throws AlgorithmException
AlgorithmException - the error, if this is AlgoFailurepublic abstract java.lang.String getRawOutput()
throws AlgorithmException
AlgorithmException - the error, if this is AlgoFailure