Package org.joda.convert
Class EnumStringConverterFactory.EnumStringConverter
java.lang.Object
org.joda.convert.EnumStringConverterFactory.EnumStringConverter
- All Implemented Interfaces:
FromStringConverter<Enum<?>>,StringConverter<Enum<?>>,ToStringConverter<Enum<?>>,TypedFromStringConverter<Enum<?>>,TypedStringConverter<Enum<?>>
- Enclosing class:
EnumStringConverterFactory
static final class EnumStringConverterFactory.EnumStringConverter
extends Object
implements TypedStringConverter<Enum<?>>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEnum<?> convertFromString(Class<? extends Enum<?>> cls, String str) Converts the specified object from aString.convertToString(Enum<?> en) Converts the specified object to aString.Class<?> Gets the effective type that the converter works on.
-
Field Details
-
effectiveType
-
-
Constructor Details
-
EnumStringConverter
EnumStringConverter(Class<?> effectiveType)
-
-
Method Details
-
convertToString
Description copied from interface:ToStringConverterConverts the specified object to aString.- Specified by:
convertToStringin interfaceToStringConverter<Enum<?>>- Parameters:
en- the object to convert, not null- Returns:
- the converted string, may be null but generally not
-
convertFromString
Description copied from interface:FromStringConverterConverts the specified object from aString.- Specified by:
convertFromStringin interfaceFromStringConverter<Enum<?>>- Parameters:
cls- the class to convert to, not nullstr- the string to convert, not null- Returns:
- the converted object, may be null but generally not
-
getEffectiveType
Description copied from interface:TypedStringConverterGets the effective type that the converter works on.For example, if a class declares the
FromStringandToStringthen 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.- Specified by:
getEffectiveTypein interfaceTypedFromStringConverter<Enum<?>>- Specified by:
getEffectiveTypein interfaceTypedStringConverter<Enum<?>>- Returns:
- the effective type
-