public interface RpcDecoder extends Serializable
The client-side argument type and the server-side argument type doesn't have to match. The decoders are applied to be able to handle arguments whose types on the server side and on the client side are different.
Each decoder is checked whether it's may be used to handle the argument value
with the required server-side parameter type via the
isApplicable(JsonValue, Class)
method. Decoder is applied to the
received value and required type if it's applicable.
For internal use only. May be renamed or removed in a future release.
Modifier and Type | Method and Description |
---|---|
<T> T |
decode(elemental.json.JsonValue value,
Class<T> type)
Decode the given
value to the required type . |
boolean |
isApplicable(elemental.json.JsonValue value,
Class<?> type)
Returns
true if the decoder is applicable for the given
value and the required type . |
boolean isApplicable(elemental.json.JsonValue value, Class<?> type)
true
if the decoder is applicable for the given
value
and the required type
.value
- the value which needs to be decodedtype
- the required type to decodetrue
if this decoder is able to decode the value
to the type
, false
otherwise<T> T decode(elemental.json.JsonValue value, Class<T> type) throws RpcDecodeException
value
to the required type
.
RpcDecodeException
is thrown if the value
cannot be
converted to the type
(even though the decoder is applicable for
the value
and the type
).
T
- the decoded value typevalue
- the value which needs to be decodedtype
- the required type to decodeRpcDecodeException
- if the value
cannot be converted to the type
Copyright © 2023. All rights reserved.