Class JsonRpcNotification


  • public class JsonRpcNotification
    extends JsonRpcMessage
    This class models a JSON-RPC Notification.
    • Method Detail

      • create

        public static JsonRpcNotification create​(String method)
        Creates a new JSON-RPC notification without parameters.
        Parameters:
        method - the method name
        Returns:
        the notification
      • create

        public static JsonRpcNotification create​(String method,
                                                 Map<String,​?> params)
        Creates a new JSON-RPC notification with parameters as a JSON object.
        Parameters:
        method - the method name
        params - the parameters
        Returns:
        the notification
      • create

        public static JsonRpcNotification create​(String method,
                                                 List<?> params)
        Creates a new JSON-RPC notification with parameters as a JSON array.
        Parameters:
        method - the method name
        params - the parameters
        Returns:
        the notification
      • getMethod

        public String getMethod()
        Returns the method name.
        Returns:
        the method name
      • getMapParams

        public Map<?,​?> getMapParams()
        Returns the parameters, if the notification contains parameters as a JSON object. If the notification has no parameters, or it has parameters as a JSON array, this method returns null.
        Returns:
        the parameters as a JSON object or null
        See Also:
        getListParams()
      • getListParams

        public List<?> getListParams()
        Returns the parameters, if the notification contains parameters as a JSON array. If the notification has no parameters, or it has parameters as a JSON object, this method returns null.
        Returns:
        the parameters as a JSON array or null
        See Also:
        getMapParams()