Class AbstractRequest<ParamType,IdType>
- java.lang.Object
-
- com.github.jinahya.jsonrpc.bind.v1.Identifiable<IdType>
-
- com.github.jinahya.jsonrpc.bind.v1.AbstractRequest<ParamType,IdType>
-
- Type Parameters:
ParamType- params element type parameterIdType- id type parameter
- Direct Known Subclasses:
Notification,Request
public abstract class AbstractRequest<ParamType,IdType> extends Identifiable<IdType>
An abstract class for requests and notifications.- Author:
- Jin Kwon <onacit_at_gmail.com>
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_NAME_METHODA property name for$.method.static StringPROPERTY_NAME_PARAMSA property name for$.params.-
Fields inherited from class com.github.jinahya.jsonrpc.bind.v1.Identifiable
PROPERTY_NAME_ID
-
-
Constructor Summary
Constructors Constructor Description AbstractRequest()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.List<ParamType>getParams()Returns the current value of "params" property.inthashCode()Returns a hash code value for the object.voidsetMethod(String method)Replaces the current value of "method" property with specified value.voidsetParams(List<ParamType> params)Replaces the current value of "params" property with specified value.StringtoString()Returns the string representation of the object.-
Methods inherited from class com.github.jinahya.jsonrpc.bind.v1.Identifiable
copyIdFrom, copyIdTo, getId, isIdNull, setId
-
-
-
-
Field Detail
-
PROPERTY_NAME_METHOD
public static final String PROPERTY_NAME_METHOD
A property name for$.method. The value is "method".- See Also:
- Constant Field Values
-
PROPERTY_NAME_PARAMS
public static final String PROPERTY_NAME_PARAMS
A property name for$.params. The value is "params".- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public String toString()
Returns the string representation of the object.- Overrides:
toStringin classIdentifiable<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 classIdentifiable<IdType>- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classIdentifiable<IdType>- Returns:
- a hash code value for this object.
-
getMethod
public String getMethod()
Returns the current value of "method" property.- Returns:
- the current value of "method" property.
-
setMethod
public void setMethod(String method)
Replaces the current value of "method" property with specified value.- Parameters:
method- new value for "method" property.
-
getParams
public List<ParamType> getParams()
Returns the current value of "params" property.- Returns:
- the current value of "params" property.
-
-