RpcResponseDeserializer
public class RpcResponseDeserializerImpl extends Object implements RpcResponseDeserializer
Constructor | Description |
---|---|
RpcResponseDeserializerImpl() |
|
RpcResponseDeserializerImpl(com.google.gson.Gson gson) |
Modifier and Type | Method | Description |
---|---|---|
<R extends RpcResponse> |
deserialize(String response,
Class<R> responseClass) |
Deserializes the raw response string given from the node into the appropriate
RpcResponse object, or
throws the relevant RpcException exception if an error is returned. |
com.google.gson.Gson |
getGsonInstance() |
|
RpcException |
parseException(String msg) |
public RpcResponseDeserializerImpl()
public RpcResponseDeserializerImpl(com.google.gson.Gson gson)
public com.google.gson.Gson getGsonInstance()
public <R extends RpcResponse> R deserialize(String response, Class<R> responseClass) throws RpcException
RpcResponseDeserializer
RpcResponse
object, or
throws the relevant RpcException
exception if an error is returned.deserialize
in interface RpcResponseDeserializer
R
- the response classresponse
- the raw response data sent from the noderesponseClass
- the expected response class to populate the data intoRpcException
- if an exception occurs during parsing, or if an error is returned by the nodepublic RpcException parseException(String msg)
Copyright © 2020. All rights reserved.