Class JsonRpcResponse.Error

  • Enclosing class:
    JsonRpcResponse

    public static class JsonRpcResponse.Error
    extends Object
    An error in a response message.
    • 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 code
        message - 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 code
        message - the error message
        data - 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