public interface TypeConverter
Type converters are used to convert the string values provided as option/argument values into appropriately typed values that can be assigned to the relevant option/arguments
Modifier and Type | Method and Description |
---|---|
Object |
convert(String name,
Class<?> type,
String value)
Convert a string value into an appropriately typed value
|
void |
setNumericConverter(NumericTypeConverter converter)
Sets the numeric type converter to use, if
null then default
behaviour of the type converter instance (whatever that might be) will be
used |
Object convert(String name, Class<?> type, String value)
name
- Option Nametype
- Target Typevalue
- String ValueNullPointerException
- Should be thrown if any of the provided arguments is nullParseOptionConversionException
- Should be thrown if the type converter cannot convert the
valuevoid setNumericConverter(NumericTypeConverter converter)
null
then default
behaviour of the type converter instance (whatever that might be) will be
usedconverter
- Numeric type converterCopyright © 2012–2017. All rights reserved.