public class AbstractBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ERROR |
protected static String |
ID |
protected static String |
JSONRPC |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper
Jackson mapper for JSON processing
|
protected static String |
METHOD |
protected static String |
PARAMS |
protected static String |
RESULT |
protected Transport |
transport
Transport for performing a text request and returning a text response
|
protected static String |
VERSION_2_0 |
| Constructor and Description |
|---|
AbstractBuilder(Transport transport,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.node.ArrayNode |
arrayParams(Object[] values)
Builds request params as a JSON array
|
protected com.fasterxml.jackson.databind.node.ObjectNode |
objectParams(Map<String,?> params)
Builds request params as a JSON object
|
protected com.fasterxml.jackson.databind.node.ObjectNode |
request(com.fasterxml.jackson.databind.node.ValueNode id,
String method,
com.fasterxml.jackson.databind.JsonNode params)
Creates a new JSON-RPC request as a JSON object
|
protected static final String VERSION_2_0
protected static final String RESULT
protected static final String ERROR
protected static final String JSONRPC
protected static final String ID
protected static final String METHOD
protected static final String PARAMS
protected final Transport transport
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public AbstractBuilder(Transport transport, com.fasterxml.jackson.databind.ObjectMapper mapper)
protected com.fasterxml.jackson.databind.node.ArrayNode arrayParams(Object[] values)
values - request paramsprotected com.fasterxml.jackson.databind.node.ObjectNode objectParams(Map<String,?> params)
params - request paramsprotected com.fasterxml.jackson.databind.node.ObjectNode request(com.fasterxml.jackson.databind.node.ValueNode id,
String method,
com.fasterxml.jackson.databind.JsonNode params)
id - request idmethod - request methodparams - request paramsCopyright © 2018. All rights reserved.