com.vaadin.flow.server.communication.rpc.
Class StringToEnumDecoder
All Implemented Interfaces:
Decodes a JsonValue with JsonType.STRING type to Enum
subclass type.
This decoder is applicable to any JsonValue which is
JsonString and any Enum sublcass
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TDecode the given
valueto the requiredtype.booleanisApplicable(elemental.json.JsonValue value, Class<?> type) Returns
trueif the decoder is applicable for the givenvalueand the requiredtype.
-
Constructor Details
-
StringToEnumDecoder
public StringToEnumDecoder()
-
-
Method Details
-
isApplicable
Description copied from interface:
RpcDecoderReturns
trueif the decoder is applicable for the givenvalueand the requiredtype.Specified by:
isApplicablein interfaceRpcDecoderParameters:
value- the value which needs to be decodedtype- the required type to decodeReturns:
trueif this decoder is able to decode thevalueto thetype,falseotherwise -
decode
Description copied from interface:
RpcDecoderDecode the given
valueto the requiredtype.RpcDecodeExceptionis thrown if thevaluecannot be converted to thetype(even though the decoder is applicable for thevalueand thetype).Specified by:
decodein interfaceRpcDecoderType Parameters:
T- the decoded value typeParameters:
value- the value which needs to be decodedtype- the required type to decodeReturns:
the decoded value
Throws:
RpcDecodeException- if thevaluecannot be converted to thetype
-