Interface JsonRpcClientRequest

All Superinterfaces:
ClientRequest<JsonRpcClientRequest>

public interface JsonRpcClientRequest extends ClientRequest<JsonRpcClientRequest>
A representation of JSON-RPC client request.
  • Method Details

    • rpcMethod

      JsonRpcClientRequest rpcMethod(String rpcMethod)
      Set a JSON-RPC method on this request. Normally this is done using either via JsonRpcClient or JsonRpcClientBatchRequest.
      Parameters:
      rpcMethod - the JSON-RPC method
      Returns:
      this request
      See Also:
    • rpcId

      Set a JSON-RPC ID on this request.
      Parameters:
      value - the ID as a JSON value
      Returns:
      this request
    • rpcId

      default JsonRpcClientRequest rpcId(int value)
      Set an int JSON-RPC ID on this request.
      Parameters:
      value - the ID as an int
      Returns:
      this request
    • rpcId

      default JsonRpcClientRequest rpcId(String value)
      Set a string JSON-RPC ID on this request.
      Parameters:
      value - the ID as a string
      Returns:
      this request
    • param

      JsonRpcClientRequest param(String name, JsonValue value)
      Set a named param on this request.
      Parameters:
      name - the name
      value - the value as a JSON value
      Returns:
      this request
    • param

      default JsonRpcClientRequest param(String name, String value)
      Set a named param of type string on this request.
      Parameters:
      name - the name
      value - the value as a string
      Returns:
      this request
    • param

      default JsonRpcClientRequest param(String name, int value)
      Set a named param of type int on this request.
      Parameters:
      name - the name
      value - the value as an int
      Returns:
      this request
    • addParam

      Add an array param value on this request.
      Parameters:
      value - the value as JSON value
      Returns:
      this request
    • addParam

      default JsonRpcClientRequest addParam(int value)
      Add an array param value of type int to this request.
      Parameters:
      value - the value as int value
      Returns:
      this request
    • addParam

      default JsonRpcClientRequest addParam(String value)
      Add an array param value of type string to this request.
      Parameters:
      value - the value as a string
      Returns:
      this request
    • submit

      Submit this request to the server and get a response.
      Returns:
      a response
    • addToBatch

      Add this request to the current batch.
      Returns:
      the batch
      Throws:
      IllegalStateException - if not part of a batch
    • asJsonObject

      JsonObject asJsonObject()
      Get a complete representation of this request as a JSON object.
      Returns:
      this request as a JSON object