Class RequestObject<ParamsType,IdType>
- java.lang.Object
-
- com.github.jinahya.jsonrpc.bind.v2.JsonrpcObject<IdType>
-
- com.github.jinahya.jsonrpc.bind.v2.RequestObject<ParamsType,IdType>
-
public class RequestObject<ParamsType,IdType> extends JsonrpcObject<IdType>
A class for binding request objects.- Author:
- Jin Kwon <onacit_at_gmail.com>
- See Also:
- Request Object (JSON-RPC 2.0 Specification)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_NAME_METHODThe property name for$.method.static StringPROPERTY_NAME_PARAMSThe property name for$.params.-
Fields inherited from class com.github.jinahya.jsonrpc.bind.v2.JsonrpcObject
PROPERTY_NAME_ID, PROPERTY_NAME_JSONRPC, PROPERTY_VALUE_JSONRPC
-
-
Constructor Summary
Constructors Constructor Description RequestObject()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates whether some other object is "equal to" this one.StringgetMethod()Returns the current value of "method" property.ParamsTypegetParams()Returns the current value of "params" property.inthashCode()Returns a hash code value for the object.protected @javax.validation.constraints.AssertTrue booleanisParamsStructured()Indicates whether the current value of "params" property is, in a view of JSON, a structured value.voidsetMethod(String method)Replace the current value of "method" property with specified value.voidsetParams(ParamsType params)Replaces the current value of "params" property with specified value.StringtoString()Returns a string representation of the object.-
Methods inherited from class com.github.jinahya.jsonrpc.bind.v2.JsonrpcObject
copyIdFrom, copyIdTo, getId, getJsonrpc, isIdEitherStringNumberOfNull, setId, setJsonrpc
-
-
-
-
Field Detail
-
PROPERTY_NAME_METHOD
public static final String PROPERTY_NAME_METHOD
The property name for$.method. The value is "method".- See Also:
- Constant Field Values
-
PROPERTY_NAME_PARAMS
public static final String PROPERTY_NAME_PARAMS
The property name for$.params. The value is "params".- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public String toString()
Returns a string representation of the object.- Overrides:
toStringin classJsonrpcObject<IdType>- Returns:
- a string representation of the object.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.- Overrides:
equalsin classJsonrpcObject<IdType>- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as theobjargument;falseotherwise.
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classJsonrpcObject<IdType>- Returns:
- a hash code value for this object.
-
getMethod
public String getMethod()
Returns the current value of "method" property. The default value of the property isnull.- Returns:
- the current value of "method" property.
-
setMethod
public void setMethod(String method)
Replace the current value of "method" property with specified value.- Parameters:
method- new value for "method" property.
-
getParams
public ParamsType getParams()
Returns the current value of "params" property. The default value of the property isnull.- Returns:
- the current value of "params" property.
-
setParams
public void setParams(ParamsType params)
Replaces the current value of "params" property with specified value.- Parameters:
params- new value for "params" property.
-
isParamsStructured
@AssertTrue protected @javax.validation.constraints.AssertTrue boolean isParamsStructured()
Indicates whether the current value of "params" property is, in a view of JSON, a structured value.- Returns:
trueif "params" property is, in a view of JSoN, a structured value;falseotherwise.- See Also:
- Parameter Structures (JSON-RPC 2.0 Specification)
-
-