Package com.mindee.v1.parsing
Class LocalResponse
- java.lang.Object
-
- com.mindee.parsing.BaseLocalResponse
-
- com.mindee.v1.parsing.LocalResponse
-
public class LocalResponse extends BaseLocalResponse
A Mindee response saved locally.
-
-
Field Summary
-
Fields inherited from class com.mindee.parsing.BaseLocalResponse
file
-
-
Constructor Summary
Constructors Constructor Description LocalResponse(File input)LocalResponse(InputStream input)LocalResponse(String input)LocalResponse(Path input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Inference>
AsyncPredictResponse<T>deserializeAsyncResponse(Class<T> productClass)Deserialize this local JSON payload into a specificAsyncPredictResponse.<T extends Inference>
PredictResponse<T>deserializeSyncResponse(Class<T> productClass)Deserialize this local JSON payload into a specificPredictResponse.-
Methods inherited from class com.mindee.parsing.BaseLocalResponse
getFile, getHmacSignature, isValidHmacSignature
-
-
-
-
Constructor Detail
-
LocalResponse
public LocalResponse(InputStream input)
-
LocalResponse
public LocalResponse(String input)
-
LocalResponse
public LocalResponse(File input) throws IOException
- Throws:
IOException
-
LocalResponse
public LocalResponse(Path input) throws IOException
- Throws:
IOException
-
-
Method Detail
-
deserializeAsyncResponse
public <T extends Inference> AsyncPredictResponse<T> deserializeAsyncResponse(Class<T> productClass) throws IOException
Deserialize this local JSON payload into a specificAsyncPredictResponse. subtype:InferenceResponse,JobResponse.- Type Parameters:
T- genericInference- Parameters:
productClass- the concrete class to instantiate- Returns:
- A
AsyncPredictResponseinstance. - Throws:
MindeeException- if the payload cannot be deserialized into the requested typeIOException
-
deserializeSyncResponse
public <T extends Inference> PredictResponse<T> deserializeSyncResponse(Class<T> productClass) throws IOException
Deserialize this local JSON payload into a specificPredictResponse.- Type Parameters:
T- genericInference- Parameters:
productClass- the concrete class to instantiate- Returns:
- A
PredictResponseinstance. - Throws:
MindeeException- if the payload cannot be deserialized into the requested typeIOException
-
-