public interface JsonrpcRequestMessage extends JsonrpcMessage
| Modifier and Type | Method and Description |
|---|---|
static JsonrpcRequestMessage |
fromJson(Object source)
Reads an instance from specified source.
|
@NotBlank String |
getMethod()
Returns current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property. |
<T> List<T> |
getParamsAsArray(Class<T> elementClass)
Returns current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property as a list of
specified element type. |
<T> T |
getParamsAsObject(Class<T> objectClass)
Returns current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property as an instance of
specified object type. |
boolean |
hasParams()
Indicates this message has a value for
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property. |
default @AssertFalse boolean |
isMethodReservedForRpcInternal()
Indicates that current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property is
considered to be reserved for rpc-internal. |
default boolean |
isNotification()
Indicates whether this message is a notification.
|
@AssertTrue boolean |
isParamsContextuallyValid()
Indicate whether current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property is
contextually valid. |
static JsonrpcRequestMessage |
newInstance()
Creates a new instance.
|
void |
setMethod(String method)
Replaces current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property with specified
value. |
void |
setParamsAsArray(List<?> params)
Replaces current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property with specified
value. |
void |
setParamsAsObject(Object params)
Replaces current value of
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property with specified
object. |
default String |
toJson()
Returns a JSON representation of this message.
|
default void |
toJson(Object target)
Writes this message to specified target.
|
getIdAsInteger, getIdAsLong, getIdAsNumber, getIdAsString, getJsonrpc, hasId, isIdContextuallyValid, setIdAsInteger, setIdAsLong, setIdAsNumber, setIdAsString, setJsonrpcisContextuallyValidstatic JsonrpcRequestMessage newInstance()
static JsonrpcRequestMessage fromJson(Object source)
source - the source from which the new instance is read.source.default void toJson(Object target)
target - the target to which this message is written.default String toJson()
default boolean isNotification()
A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request.
Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of any errors (like e.g. "Invalid params","Internal error").
true if this message is a notification; false otherwise.!hasId();@NotBlank @NotBlank String getMethod()
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property.JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property.void setMethod(String method)
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property with specified
value.method - new value for JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property.@AssertFalse default @AssertFalse boolean isMethodReservedForRpcInternal()
JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property is
considered to be reserved for rpc-internal.true if value of JsonrpcRequestMessageConstants.PROPERTY_NAME_METHOD property is
considered to be reserved for rpc-internal; false otherwise.boolean hasParams()
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property.JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS
property; false otherwise.false, any getParamsAs...() method should return null.@AssertTrue @AssertTrue boolean isParamsContextuallyValid()
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property is
contextually valid.true if current value of JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property is
contextually valid; false otherwise.hasParams() returns false.<T> List<T> getParamsAsArray(Class<T> elementClass)
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property as a list of
specified element type.T - element type parameterelementClass - the element type.elementClass; null when hasParams() method returns false.void setParamsAsArray(List<?> params)
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property with specified
value.params - new value for JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property.<T> T getParamsAsObject(Class<T> objectClass)
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property as an instance of
specified object type.T - object type parameterobjectClass - the object type.objectClass; null when hasParams() method returns false.void setParamsAsObject(Object params)
JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property with specified
object.params - new value for JsonrpcRequestMessageConstants.PROPERTY_NAME_PARAMS property.Copyright © 2019–2020 Jinahya, Inc.. All rights reserved.