public class DefaultRpcDecoder extends Object implements RpcDecoder
Delegates to the standard JSON deserializer method
JsonCodec.decodeAs(JsonValue, Class)
.
For internal use only. May be renamed or removed in a future release.
JsonCodec.decodeAs(JsonValue, Class)
,
Serialized FormConstructor and Description |
---|
DefaultRpcDecoder() |
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 . |
public boolean isApplicable(elemental.json.JsonValue value, Class<?> type)
RpcDecoder
true
if the decoder is applicable for the given
value
and the required type
.isApplicable
in interface RpcDecoder
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
otherwisepublic <T> T decode(elemental.json.JsonValue value, Class<T> type) throws RpcDecodeException
RpcDecoder
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
).
decode
in interface RpcDecoder
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 © 2022. All rights reserved.