public final class AlgoFailure extends AlgoResponse
Modifier and Type | Field and Description |
---|---|
AlgorithmException |
error |
Constructor and Description |
---|
AlgoFailure(AlgorithmException error) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
as(java.lang.Class<T> returnClass)
Convert the result to a specific class
|
protected <T> T |
as(java.lang.reflect.Type returnType)
Convert the result to a specific type
|
java.lang.String |
asJsonString()
Return JSON representation of the result.
|
java.lang.String |
asString()
Return String representation of the result.
|
AlgoAsyncResponse |
getAsyncResponse() |
Metadata |
getMetadata() |
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.
|
boolean |
isFailure() |
boolean |
isSuccess() |
as
public AlgorithmException error
public AlgoFailure(AlgorithmException error)
public boolean isSuccess()
isSuccess
in class AlgoResponse
public boolean isFailure()
isFailure
in class AlgoResponse
public Metadata getMetadata() throws AlgorithmException
getMetadata
in class AlgoResponse
AlgorithmException
public AlgoAsyncResponse getAsyncResponse() throws AlgorithmException
getAsyncResponse
in class AlgoResponse
AlgorithmException
protected <T> T as(java.lang.Class<T> returnClass) throws AlgorithmException
AlgoResponse
as
in class AlgoResponse
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 <T> T as(java.lang.reflect.Type returnType) throws AlgorithmException
AlgoResponse
as
in class AlgoResponse
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 java.lang.String asJsonString() throws AlgorithmException
AlgoResponse
asJsonString
in class AlgoResponse
AlgorithmException
- the error, if this is AlgoFailurepublic java.lang.String asString() throws AlgorithmException
AlgoResponse
asString
in class AlgoResponse
AlgorithmException
- the error, if this is AlgoFailurepublic java.lang.String getRawOutput() throws AlgorithmException
AlgoResponse
getRawOutput
in class AlgoResponse
AlgorithmException
- the error, if this is AlgoFailure