Package com.beust.jcommander.converters
Class EnumConverter<T extends Enum<T>>
java.lang.Object
com.beust.jcommander.converters.EnumConverter<T>
- Type Parameters:
T
- the enum type
- All Implemented Interfaces:
IStringConverter<T>
A converter to parse enums
-
Constructor Summary
ConstructorDescriptionEnumConverter
(String optionName, Class<T> clazz) Constructs a new converter. -
Method Summary
-
Constructor Details
-
EnumConverter
Constructs a new converter.- Parameters:
optionName
- the option name for error reportingclazz
- the enum class
-
-
Method Details
-
convert
- Specified by:
convert
in interfaceIStringConverter<T extends Enum<T>>
- Returns:
- an object of type T created from the parameter value.
-