Class JsonRpcRequest

  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    @Beta
    public class JsonRpcRequest
    extends GenericData
    Beta
    JSON-RPC 2.0 request object.

    Implementation is not thread-safe.

    Since:
    1.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object id
      Identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
      private java.lang.String jsonrpc
      Version of the JSON-RPC protocol which is "2.0".
      private java.lang.String method
      Name of the method to be invoked.
      private java.lang.Object params
      Structured value that holds the parameter values to be used during the invocation of the method or null for none.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonRpcRequest()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JsonRpcRequest clone()
      Makes a "deep" clone of the generic data, in which the clone is completely independent of the original.
      java.lang.Object getId()
      Returns the identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
      java.lang.String getMethod()
      Returns the name of the method to be invoked.
      java.lang.Object getParameters()
      Returns the structured value that holds the parameter values to be used during the invocation of the method or null for none.
      java.lang.String getVersion()
      Returns the version of the JSON-RPC protocol which is "2.0".
      JsonRpcRequest set​(java.lang.String fieldName, java.lang.Object value)
      Sets the given field value (may be null) for the given field name.
      void setId​(java.lang.Object id)
      Sets the identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
      void setMethod​(java.lang.String method)
      Sets the name of the method to be invoked.
      void setParameters​(java.lang.Object parameters)
      Sets the structured value that holds the parameter values to be used during the invocation of the method or null for none.
      • Methods inherited from class java.util.AbstractMap

        clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • jsonrpc

        private final java.lang.String jsonrpc
        Version of the JSON-RPC protocol which is "2.0".
        See Also:
        Constant Field Values
      • id

        private java.lang.Object id
        Identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
      • method

        private java.lang.String method
        Name of the method to be invoked.
      • params

        private java.lang.Object params
        Structured value that holds the parameter values to be used during the invocation of the method or null for none.
    • Constructor Detail

      • JsonRpcRequest

        public JsonRpcRequest()
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
        Returns the version of the JSON-RPC protocol which is "2.0".
        Since:
        1.5
      • getId

        public java.lang.Object getId()
        Returns the identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
        Since:
        1.5
      • setId

        public void setId​(java.lang.Object id)
        Sets the identifier established by the client that must be a string or a number or null for a notification and therefore not expect to receive a response.
        Since:
        1.5
      • getMethod

        public java.lang.String getMethod()
        Returns the name of the method to be invoked.
        Since:
        1.5
      • setMethod

        public void setMethod​(java.lang.String method)
        Sets the name of the method to be invoked.
        Since:
        1.5
      • getParameters

        public java.lang.Object getParameters()
        Returns the structured value that holds the parameter values to be used during the invocation of the method or null for none.
        Since:
        1.5
      • setParameters

        public void setParameters​(java.lang.Object parameters)
        Sets the structured value that holds the parameter values to be used during the invocation of the method or null for none.
        Since:
        1.5
      • set

        public JsonRpcRequest set​(java.lang.String fieldName,
                                  java.lang.Object value)
        Description copied from class: GenericData
        Sets the given field value (may be null) for the given field name. Any existing value for the field will be overwritten. It may be more slightly more efficient than GenericData.put(String, Object) because it avoids accessing the field's original value.

        Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

        Overrides:
        set in class GenericData
      • clone

        public JsonRpcRequest clone()
        Description copied from class: GenericData
        Makes a "deep" clone of the generic data, in which the clone is completely independent of the original.
        Overrides:
        clone in class GenericData