public abstract class BoolOrEnumConverter<T extends java.lang.Enum<T>> extends EnumConverter<T>
This is able to additionally convert from the standard set of boolean string values. If there is an overlap in values, those from the underlying enumeration will be taken.
Modifier | Constructor and Description |
---|---|
protected |
BoolOrEnumConverter(java.lang.Class<T> enumType,
java.lang.String typeName,
T trueValue,
T falseValue)
You *must* implement a zero-argument constructor that delegates
to this constructor, passing in the appropriate parameters.
|
Modifier and Type | Method and Description |
---|---|
T |
convert(java.lang.String input)
Implements
EnumConverter.convert(String) . |
getTypeDescription
protected BoolOrEnumConverter(java.lang.Class<T> enumType, java.lang.String typeName, T trueValue, T falseValue)
EnumConverter
class.enumType
- The type of your enumeration; usually a class literal
like MyEnum.classtypeName
- The intuitive name of your enumeration, for example, the
type name for CompilationMode might be "compilation mode".trueValue
- The enumeration value to associate with true
.falseValue
- The enumeration value to associate with false
.public T convert(java.lang.String input) throws OptionsParsingException
EnumConverter
EnumConverter.convert(String)
.convert
in interface Converter<T extends java.lang.Enum<T>>
convert
in class EnumConverter<T extends java.lang.Enum<T>>
OptionsParsingException