com.vaadin.ui.declarative.converters.
Class DesignEnumConverter<T extends Enum>
- java.lang.Object
-
- com.vaadin.ui.declarative.converters.DesignEnumConverter<T>
-
All Implemented Interfaces:
Converter<String,T>
,Serializable
public class DesignEnumConverter<T extends Enum> extends Object implements Converter<String,T>
An converter for Enum to/from String for
DesignAttributeHandler
to use internally.Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description DesignEnumConverter(Class<T> type)
Creates a converter for the given enum type.
-
Method Summary
All Methods Modifier and Type Method Description Result<T>
convertToModel(String value, ValueContext context)
Converts the given value from model type to presentation type.
String
convertToPresentation(T value, ValueContext context)
Converts the given value from presentation type to model type.
-
-
-
Method Detail
-
convertToModel
public Result<T> convertToModel(String value, ValueContext context)
Description copied from interface:
Converter
Converts the given value from model type to presentation type.
A converter can optionally use locale to do the conversion.
Specified by:
convertToModel
in interfaceConverter<String,T extends Enum>
Parameters:
value
- The value to convert. Can be nullcontext
- The value context for the conversion.Returns:
The converted value compatible with the source type
-
convertToPresentation
public String convertToPresentation(T value, ValueContext context)
Description copied from interface:
Converter
Converts the given value from presentation type to model type.
A converter can optionally use locale to do the conversion.
Specified by:
convertToPresentation
in interfaceConverter<String,T extends Enum>
Parameters:
value
- The value to convert. Can be nullcontext
- The value context for the conversion.Returns:
The converted value compatible with the source type
-
-