Class EnumTypeWrapper
java.lang.Object
net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
net.sourceforge.jeuclid.context.typewrapper.EnumTypeWrapper
- All Implemented Interfaces:
Serializable,TypeWrapper
Converting String to Enum and vice versa is easy with help of Enum class.
- Version:
- $Revision: aa78526a6b7b $
- See Also:
-
Field Summary
Fields inherited from interface net.sourceforge.jeuclid.context.typewrapper.TypeWrapper
FAILED_TO_CONVERT, TO -
Method Summary
Modifier and TypeMethodDescriptionfromString(String value) Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.static TypeWrappergetInstance(Class<? extends Enum<?>> valueType) Object[]values()Retrieves values of the enum type being wrapped.Methods inherited from class net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
getValueType, toString, valid
-
Method Details
-
getInstance
- Parameters:
valueType- an enum class- Returns:
- the singleton instance.
-
fromString
Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.- Specified by:
fromStringin interfaceTypeWrapper- Overrides:
fromStringin classAbstractSimpleTypeWrapper- Parameters:
value- parameter value as string- Returns:
- parameter value as an instance of the proper type
-
values
Retrieves values of the enum type being wrapped.- Returns:
- array of possible enum values
-