Interface ArgumentType<T>

    • Method Detail

      • convert

        T convert​(ArgumentParser parser,
                  Argument arg,
                  java.lang.String value)
           throws ArgumentParserException

        Converts value to appropriate type.

        If the objects derived from RuntimeException are thrown in conversion because of invalid input from command line, subclass must catch these exceptions and wrap them in ArgumentParserException and 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.