CommandLine. This CommandLine
has stored the argument and option values. Only instance of parser should create
objects of this type.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public List | Returns: the ordered list of arguments. Arguments are command line arguments not matching an option.
|
| public CLI | |
| public static CommandLine | |
| public < the expected type T> @Nullable T | Returns: the value,null if not setthe name name)Gets the value of an argument with the matching name (arg name). |
| public < the expected type T> @Nullable T | Returns: the value,null if not setthe index index)Gets the value of an argument with the given index. |
| public < the expected component type T> List | Returns: the values,null if not setthe index index)Gets the values of an argument with the matching index. |
| public < the expected type T> @Nullable T | Returns: the value,null if not setthe name name)Gets the value of an option with the matching name (can be the long name, short name or arg name). |
| public < the expected component type T> List | Returns: the values,null if not setthe name name)Gets the values of an option with the matching name (can be the long name, short name or arg name). |
| public @Nullable String | Returns: the value,null if none.the argument arg)Gets the raw value of the given argument. |
| public @Nullable String | Returns: the value,null if none.the option option)Gets the raw value of the given option. |
| public default List | Returns: the list of values, empty if nonethe option option)
Deprecated
use
getRawValuesForOption(Option)
Gets the raw values of the given option. |
| public List | Returns: the list of values, empty if nonethe argument argument)Gets the raw values of the given argument. |
| public List | Returns: the list of values, empty if nonethe option option)Gets the raw values of the given option. |
| public boolean | isArgumentAssigned(Argument
the argument arg)Checks whether or not the given argument has been assigned in the command line. |
| public boolean | |
| public boolean | Returns: true if the flag has been set in the command line, false otherwise.the option name name)Gets the value of an option marked as a flag. |
| public boolean | isOptionAssigned(Option
the option option)Checks whether or not the given option has been assigned in the command line. |
| public boolean | Returns: true if the user command line has used the optionthe option option)Checks whether or not the given option has been seen in the user command line. |
| public boolean | isValid()
Checks whether or not the command line is valid, i.e. all constraints from arguments and options have been satisfied. |
| acceptMoreValues | back to summary |
|---|---|
| public boolean acceptMoreValues(Option option) Checks whether or not the given option accept more values. | |
| allArguments | back to summary |
|---|---|
| public List | |
| cli | back to summary |
|---|---|
public CLI cli()
| |
| create | back to summary |
|---|---|
| public static CommandLine create(CLI cli) Creates a command line object from the
| |
| getArgumentValue | back to summary |
|---|---|
| public <T> @Nullable T getArgumentValue(String name) Gets the value of an argument with the matching name (arg name). | |
| getArgumentValue | back to summary |
|---|---|
| public <T> @Nullable T getArgumentValue(int index) Gets the value of an argument with the given index.
| |
| getArgumentValues | back to summary |
|---|---|
| public <T> List Gets the values of an argument with the matching index.
| |
| getOptionValue | back to summary |
|---|---|
| public <T> @Nullable T getOptionValue(String name) Gets the value of an option with the matching name (can be the long name, short name or arg name). | |
| getOptionValues | back to summary |
|---|---|
| public <T> List Gets the values of an option with the matching name (can be the long name, short name or arg name).
| |
| getRawValueForArgument | back to summary |
|---|---|
| public @Nullable String getRawValueForArgument(Argument arg) Gets the raw value of the given argument. Raw values are the values as given in the user command line. | |
| getRawValueForOption | back to summary |
|---|---|
| public @Nullable String getRawValueForOption(Option option) Gets the raw value of the given option. Raw values are the values as given in the user command line. | |
| getRawValues | back to summary |
|---|---|
| public default List Deprecated Gets the raw values of the given option. Raw values are simple "String", not converted to the option type. | |
| getRawValuesForArgument | back to summary |
|---|---|
| public List Gets the raw values of the given argument. Raw values are simple "String", not converted to the argument type. | |
| getRawValuesForOption | back to summary |
|---|---|
| public List Gets the raw values of the given option. Raw values are simple "String", not converted to the option type. | |
| isArgumentAssigned | back to summary |
|---|---|
| public boolean isArgumentAssigned(Argument arg) Checks whether or not the given argument has been assigned in the command line. | |
| isAskingForHelp | back to summary |
|---|---|
| public boolean isAskingForHelp() Checks whether or not the user has passed a "help" option and is asking for help.
| |
| isFlagEnabled | back to summary |
|---|---|
| public boolean isFlagEnabled(String name) Gets the value of an option marked as a flag.
Calling this method an a non-flag option throws an
| |
| isOptionAssigned | back to summary |
|---|---|
| public boolean isOptionAssigned(Option option) Checks whether or not the given option has been assigned in the command line. | |
| isSeenInCommandLine | back to summary |
|---|---|
| public boolean isSeenInCommandLine(Option option) Checks whether or not the given option has been seen in the user command line.
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() Checks whether or not the command line is valid, i.e. all constraints from arguments and options have been satisfied. This method is used when the parser validation is disabled.
| |