An option has a name, a return type and a prefix. The option may be also be marked as mandatory.
Supported option return types are Integer, Date and Enum and Boolean.
The getName()
method returns only the option name without a prefix.
The asOptionString()
method return the option name with along with the prefix.
The toString()
method will return the name with prefix and value appropriate for the type, surrounded by "[]" if the option is not mandatory.
Examples:
CliOption("name", String.class, true); getName(): name asOptionString(): --name toString(): --name=VALUE CliOption("id", Integer.class, false); getName(): id asOptionString(): --id toString(): [--id=INTEGER] CliOption("start", Date.class, true); getName(): start asOptionString(): --start toString(): --start=YYYY-MM-DD CliOption("help", Boolean.class, false); getName(): help asOptionString(): [--help] toString(): [--help]
|
|