public final class EnumConverter extends Object implements SimpleTypeConverter
String representation of an enum value to
the one which shall be used for serialization. Each mapping has the form {"SENIOR_DEVELOPER=senior developer", "JUNIOR_DEVELOPER=junior developer"}
These mappings override the display name declarations provided by the EnumConstant annotations.
It is thread safe.
| Modifier and Type | Method and Description |
|---|---|
static EnumConverter |
create(SimpleTypeConverterConfiguration configuration)
Constructs a new
EnumConverter. |
Enum |
fromString(String value)
Converts the given
String object into an object with the simple data type this converter is
intended for. |
String |
toString(Object value)
Converts the given value to a
String object. |
public static EnumConverter create(SimpleTypeConverterConfiguration configuration)
EnumConverter.configuration - the configurationpublic Enum fromString(String value)
String object into an object with the simple data type this converter is
intended for.fromString in interface SimpleTypeConvertervalue - the String object to convertpublic String toString(Object value)
String object.toString in interface SimpleTypeConvertervalue - the value to convertCopyright © 2014. All rights reserved.