Package eu.woolplatform.utils.json.rpc
Class JsonRpcResponse.Error
- java.lang.Object
-
- eu.woolplatform.utils.json.rpc.JsonRpcResponse.Error
-
- Enclosing class:
- JsonRpcResponse
public static class JsonRpcResponse.Error extends Object
An error in a response message.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonRpcResponse.Errorcreate(int code, String message)Creates a new error.static JsonRpcResponse.Errorcreate(int code, String message, Object data)Creates a new error.intgetCode()Returns the error code.ObjectgetData()Returns additional data about the error.StringgetMessage()Returns the error message.static JsonRpcResponse.Errorread(Map<?,?> map)Reads an error from the specified map, which should represent a JSON object.
-
-
-
Method Detail
-
read
public static JsonRpcResponse.Error read(Map<?,?> map) throws ParseException
Reads an error from the specified map, which should represent a JSON object.- Parameters:
map- the map- Returns:
- the error
- Throws:
ParseException- if the map is not a valid error
-
create
public static JsonRpcResponse.Error create(int code, String message)
Creates a new error.- Parameters:
code- the error codemessage- the error message- Returns:
- the error
-
create
public static JsonRpcResponse.Error create(int code, String message, Object data)
Creates a new error.- Parameters:
code- the error codemessage- the error messagedata- additional data about the error or null- Returns:
- the error
-
getCode
public int getCode()
Returns the error code.- Returns:
- the error code
-
getMessage
public String getMessage()
Returns the error message.- Returns:
- the error message
-
getData
public Object getData()
Returns additional data about the error. This may be null.- Returns:
- additional data about the error or null
-
-