public interface JsonrpcResponseMessage extends JsonrpcMessage
| Modifier and Type | Method and Description |
|---|---|
static JsonrpcResponseMessage |
fromJson(Object source)
Reads an instance from specified source.
|
JsonrpcResponseMessageError |
getErrorAs()
Returns current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property. |
<T> List<T> |
getResultAsArray(Class<T> elementClass)
Returns current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property as a list of
specified element class. |
<T> T |
getResultAsObject(Class<T> objectClass)
Returns current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property as an instance of
specified object class. |
boolean |
hasError()
Indicates this message has a value for
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property. |
boolean |
hasResult()
Indicates this message has a value for
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property. |
default @AssertTrue boolean |
isErrorContextuallyValid()
Indicates that current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property is
contextually valid. |
default @AssertTrue boolean |
isResultAndErrorExclusive()
Indicates whether
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property and the JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property are set exclusively. |
default @AssertTrue boolean |
isResultContextuallyValid()
Indicates current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property is contextually
valid. |
static JsonrpcResponseMessage |
newInstance()
Returns a new instance.
|
void |
setErrorAs(JsonrpcResponseMessageError error)
Replaces current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property with specified
value. |
void |
setResultAsArray(List<?> result)
Replaces current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property with specified
value. |
void |
setResultAsObject(Object result)
Replaces current value of
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property with specified
value. |
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 JsonrpcResponseMessage newInstance()
static JsonrpcResponseMessage fromJson(Object source)
source - the source from which the new instance is read.source.default void toJson(Object target)
target - the target to which the message is written.default String toJson()
@AssertTrue default @AssertTrue boolean isResultAndErrorExclusive()
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property and the JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property are set exclusively.true if the JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property and the JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property are exclusively set; false otherwise.hasResult() and hasError().boolean hasResult()
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property.true if this message has a value for JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT
property; false otherwise.false any getResultAs...() method should return null.@AssertTrue default @AssertTrue boolean isResultContextuallyValid()
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property is contextually
valid.true if current value of JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property is
contextually valid; false otherwise.hasResult() returns false.true.<T> List<T> getResultAsArray(Class<T> elementClass)
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property as a list of
specified element class.T - element type parameterelementClass - the element class.elementClass; null when hasResult() method returns false.void setResultAsArray(List<?> result)
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property with specified
value.result - new value for JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property.<T> T getResultAsObject(Class<T> objectClass)
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property as an instance of
specified object class.T - object type parameter.objectClass - the object class.objectClass; null when hasResult() method returns false.void setResultAsObject(Object result)
JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property with specified
value.result - new value for JsonrpcResponseMessageConstants.PROPERTY_NAME_RESULT property.boolean hasError()
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property.true if this message has a value for JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR
property; false otherwise.false any getErrorAs...() method should return null.@AssertTrue default @AssertTrue boolean isErrorContextuallyValid()
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property is
contextually valid.true if current value of JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property is
contextually valid; false otherwise.hasError() method returns false.true.JsonrpcResponseMessageError getErrorAs()
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property.JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property; null when
hasError() method returns false.void setErrorAs(JsonrpcResponseMessageError error)
JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property with specified
value.error - new value for JsonrpcResponseMessageConstants.PROPERTY_NAME_ERROR property.Copyright © 2019–2020 Jinahya, Inc.. All rights reserved.