public class ResponseBuilder extends Object
JsonRpcResponse by providing
information like response or error.| Constructor and Description |
|---|
ResponseBuilder(org.codehaus.jackson.JsonNode id)
Creates builder with required response id.
|
| Modifier and Type | Method and Description |
|---|---|
JsonRpcResponse |
build()
Builds
JsonRpcResponse based on provided id, result and error. |
ResponseBuilder |
withError(Map<String,Object> error)
Adds error
Map to the response. |
ResponseBuilder |
withResult(List<Object> result)
Adds result
List to the response. |
ResponseBuilder |
withResult(Map<String,Object> result)
Adds result
Map to the response. |
ResponseBuilder |
withResult(String result)
Adds result
String to the response. |
public ResponseBuilder(org.codehaus.jackson.JsonNode id)
id - - Unique response Id.public ResponseBuilder withResult(Map<String,Object> result)
Map to the response.result - Map with response data.ResponseBuilder to let add more parameters.public ResponseBuilder withResult(String result)
String to the response.result - String with response data.ResponseBuilder to let add more parameters.public ResponseBuilder withResult(List<Object> result)
List to the response.result - List with response data.ResponseBuilder to let add more parameters.public ResponseBuilder withError(Map<String,Object> error)
Map to the response.error - Map with error data.ResponseBuilder to let add more parameters.public JsonRpcResponse build()
JsonRpcResponse based on provided id, result and error.Copyright © 2018. All Rights Reserved.