ikrs.json.rpc
Interface JSONRPCResponse

All Superinterfaces:
JSONValue
All Known Implementing Classes:
DefaultJSONRPCResponse

public interface JSONRPCResponse
extends JSONValue


Field Summary
 
Fields inherited from interface ikrs.json.JSONValue
FALSE, NULL, TRUE, TYPE_ARRAY, TYPE_BOOLEAN, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING
 
Method Summary
 JSONValue getError()
          Get the error object from the response (if result is null).
 JSONValue getID()
          Get the ID of this response.
 JSONValue getResult()
          Get the RPC result of the call.
 JSONValue getVersion()
          This method returns the value of the 'jsonrpc' field from this request.
 
Methods inherited from interface ikrs.json.JSONValue
asJSONArray, asJSONBoolean, asJSONNumber, asJSONObject, asJSONString, getArray, getBoolean, getNumber, getObject, getString, isArray, isBoolean, isNull, isNumber, isObject, isString, toJSONString, write
 

Method Detail

getVersion

JSONValue getVersion()
This method returns the value of the 'jsonrpc' field from this request.

Returns:
null if the request has no 'jsonrpc' field.

getResult

JSONValue getResult()
Get the RPC result of the call. Due to the specification the result MUST be null if there were errors.

Returns:
The RPC result or JSON-null/Java-null on errors.

getError

JSONValue getError()
Get the error object from the response (if result is null). Due to the specification the error object MUST be null if there were no errors.

Returns:
The error result if there were errors.

getID

JSONValue getID()
Get the ID of this response. Each response identifies the related request by the use of it's unique ID. Note that 'notifications' are special requests that expect no response. A notification is a request without an ID. Server MUST NOT response to notifications.

Returns:
The ID of this response (must not be null).