Package org.ovirt.vdsm.jsonrpc.client
Class JsonRpcResponse
java.lang.Object
org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse
Java bean representing response object.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonRpcResponse(com.fasterxml.jackson.databind.JsonNode result, com.fasterxml.jackson.databind.JsonNode error, com.fasterxml.jackson.databind.JsonNode id) Creates response object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JsonRpcResponsefromByteArray(byte[] message) Validates and buildsJsonRpcResponsebased on provided json node.static JsonRpcResponsefromJsonNode(com.fasterxml.jackson.databind.JsonNode node) Validates and buildsJsonRpcResponsebased on provided json node.com.fasterxml.jackson.databind.JsonNodegetError()com.fasterxml.jackson.databind.JsonNodegetId()com.fasterxml.jackson.databind.JsonNodeinthashCode()voidsetError(com.fasterxml.jackson.databind.JsonNode error) voidsetId(com.fasterxml.jackson.databind.JsonNode node) voidsetResult(com.fasterxml.jackson.databind.JsonNode result) byte[]private ObjecttoPrintableResult(com.fasterxml.jackson.databind.JsonNode result) toString()
-
Field Details
-
MAPPER
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER -
result
private com.fasterxml.jackson.databind.JsonNode result -
error
private com.fasterxml.jackson.databind.JsonNode error -
id
private com.fasterxml.jackson.databind.JsonNode id
-
-
Constructor Details
-
JsonRpcResponse
public JsonRpcResponse(com.fasterxml.jackson.databind.JsonNode result, com.fasterxml.jackson.databind.JsonNode error, com.fasterxml.jackson.databind.JsonNode id) Creates response object.- Parameters:
result- -JsonNodecontaining response message.error- -JsonNodecontaining error code and message.id- - Unique identifier of the message which is exactly the same as in request.
-
-
Method Details
-
getResult
public com.fasterxml.jackson.databind.JsonNode getResult() -
setResult
public void setResult(com.fasterxml.jackson.databind.JsonNode result) -
getError
public com.fasterxml.jackson.databind.JsonNode getError() -
setError
public void setError(com.fasterxml.jackson.databind.JsonNode error) -
getId
public com.fasterxml.jackson.databind.JsonNode getId() -
setId
public void setId(com.fasterxml.jackson.databind.JsonNode node) -
fromByteArray
Validates and buildsJsonRpcResponsebased on provided json node.- Parameters:
message- - byte array containing the response.- Returns:
- Response object.
-
fromJsonNode
Validates and buildsJsonRpcResponsebased on provided json node.- Parameters:
node- - Json representation of the response.- Returns:
- Response object.
-
toByteArray
public byte[] toByteArray()- Returns:
- Byte array representation of this
JsonRpcResponse.
-
toString
-
toPrintableResult
-
equals
-
hashCode
public int hashCode()
-