- All Known Implementing Classes:
DefaultTypeConverter
,ExtendedTypeConverter
public interface TypeConverter
Interface for type converters
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
-
Method Summary
Modifier and TypeMethodDescriptionConvert a string value into an appropriately typed valuevoid
setNumericConverter
(NumericTypeConverter converter) Sets the numeric type converter to use, ifnull
then default behaviour of the type converter instance (whatever that might be) will be used
-
Method Details
-
convert
Convert a string value into an appropriately typed value- Parameters:
name
- Option Nametype
- Target Typevalue
- String Value- Returns:
- Typed value
- Throws:
NullPointerException
- Should be thrown if any of the provided arguments is nullParseOptionConversionException
- Should be thrown if the type converter cannot convert the value
-
setNumericConverter
Sets the numeric type converter to use, ifnull
then default behaviour of the type converter instance (whatever that might be) will be used- Parameters:
converter
- Numeric type converter
-