final class EnumStringConverterFactory.EnumStringConverter extends java.lang.Object implements TypedStringConverter<java.lang.Enum<?>>
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<?> |
effectiveType |
| Constructor and Description |
|---|
EnumStringConverter(java.lang.Class<?> effectiveType) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Enum<?> |
convertFromString(java.lang.Class<? extends java.lang.Enum<?>> cls,
java.lang.String str)
Converts the specified object from a
String. |
java.lang.String |
convertToString(java.lang.Enum<?> en)
Converts the specified object to a
String. |
java.lang.Class<?> |
getEffectiveType()
Gets the effective type that the converter works on.
|
public java.lang.String convertToString(java.lang.Enum<?> en)
ToStringConverterString.convertToString in interface ToStringConverter<java.lang.Enum<?>>en - the object to convert, not nullpublic java.lang.Enum<?> convertFromString(java.lang.Class<? extends java.lang.Enum<?>> cls,
java.lang.String str)
FromStringConverterString.convertFromString in interface FromStringConverter<java.lang.Enum<?>>cls - the class to convert to, not nullstr - the string to convert, not nullpublic java.lang.Class<?> getEffectiveType()
TypedStringConverter
For example, if a class declares the FromString and ToString
then the effective type of the converter is that class. If a subclass is
queried for a converter, then the effective type is that of the superclass.
getEffectiveType in interface TypedStringConverter<java.lang.Enum<?>>