-
- Type Parameters:
T- Type this object convert to.
- All Known Implementing Classes:
BooleanArgumentType,CaseInsensitiveEnumArgumentType,CaseInsensitiveEnumNameArgumentType,CaseInsensitiveEnumStringArgumentType,ConstructorArgumentType,EnumArgumentType,EnumStringArgumentType,FileArgumentType,PathArgumentType,ReflectArgumentType,StringArgumentType
public interface ArgumentType<T>This interface defines type conversion method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tconvert(ArgumentParser parser, Argument arg, java.lang.String value)Convertsvalueto appropriate type.
-
-
-
Method Detail
-
convert
T convert(ArgumentParser parser, Argument arg, java.lang.String value) throws ArgumentParserException
Converts
valueto appropriate type.If the objects derived from
RuntimeExceptionare thrown in conversion because of invalid input from command line, subclass must catch these exceptions and wrap them inArgumentParserExceptionand give simple error message to explain what happened briefly.- Parameters:
parser- The parser.arg- The argument this type attached to.value- The attribute value.- Returns:
- Converted object.
- Throws:
ArgumentParserException- If conversion fails.
-
-