-
- All Known Implementing Classes:
DefaultTypeConverter,ExtendedTypeConverter
public interface TypeConverterInterface for type convertersType 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectconvert(java.lang.String name, java.lang.Class<?> type, java.lang.String value)Convert a string value into an appropriately typed valuevoidsetNumericConverter(NumericTypeConverter converter)Sets the numeric type converter to use, ifnullthen default behaviour of the type converter instance (whatever that might be) will be used
-
-
-
Method Detail
-
convert
java.lang.Object convert(java.lang.String name, java.lang.Class<?> type, java.lang.String value)Convert a string value into an appropriately typed value- Parameters:
name- Option Nametype- Target Typevalue- String Value- Returns:
- Typed value
- Throws:
java.lang.NullPointerException- Should be thrown if any of the provided arguments is nullParseOptionConversionException- Should be thrown if the type converter cannot convert the value
-
setNumericConverter
void setNumericConverter(NumericTypeConverter converter)
Sets the numeric type converter to use, ifnullthen default behaviour of the type converter instance (whatever that might be) will be used- Parameters:
converter- Numeric type converter
-
-