public final class AlgoSuccess extends AlgoResponse
| Constructor and Description |
|---|
AlgoSuccess(com.google.gson.JsonElement result,
Metadata metadata,
java.lang.String rawOutput,
AlgoAsyncResponse asyncResponse) |
| 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() |
aspublic AlgoSuccess(com.google.gson.JsonElement result,
Metadata metadata,
java.lang.String rawOutput,
AlgoAsyncResponse asyncResponse)
public boolean isSuccess()
isSuccess in class AlgoResponsepublic boolean isFailure()
isFailure in class AlgoResponsepublic Metadata getMetadata()
getMetadata in class AlgoResponsepublic AlgoAsyncResponse getAsyncResponse() throws AlgorithmException
getAsyncResponse in class AlgoResponseAlgorithmExceptionprotected <T> T as(java.lang.Class<T> returnClass)
AlgoResponseas in class AlgoResponseT - the type that the response will be deserialized intoreturnClass - the class used by the deserializer (should correspond with T)protected <T> T as(java.lang.reflect.Type returnType)
AlgoResponseas in class AlgoResponseT - the type that the response will be deserialized intoreturnType - the type used by the deserializer (should correspond with T)public java.lang.String asJsonString()
AlgoResponseasJsonString in class AlgoResponsepublic java.lang.String asString()
AlgoResponseasString in class AlgoResponsepublic java.lang.String getRawOutput()
throws AlgorithmException
AlgoResponsegetRawOutput in class AlgoResponseAlgorithmException - the error, if this is AlgoFailure