public class SingleArgument extends AbstractBasicArgument
ARGUMENT_FORMAT| Constructor and Description |
|---|
SingleArgument(java.lang.String name,
java.lang.String description) |
SingleArgument(java.lang.String name,
java.lang.String description,
boolean optional) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
consumeArgument(java.lang.String arg)
Read further arguments from the command line.
|
int |
getMaximalCount()
Get the maximum number of times this argument might appear on the command line.
|
int |
getMinimalCount()
Get the minimum number of times this argument might appear on the command line.
|
java.lang.String |
getValue()
Get the value.
|
boolean |
isOptional()
Default implementation which used the
minimal count
to decide whether this is optional. |
boolean |
isVarLength()
Does this argument or switch have a variable length?
|
getAppearance, getDescriptionpublic SingleArgument(@NotNull java.lang.String name, @NotNull java.lang.String description)
public boolean consumeArgument(@NotNull java.lang.String arg)
SwitchOrArgumentarg - argumentpublic boolean isVarLength()
SwitchOrArgumenttrue: this argument or switch consumes the remaining items in the command linefalse: this argument or switch just consumes 1 item (for arguments) or 2 items (for switches) from the command linepublic int getMinimalCount()
Argument1.public int getMaximalCount()
ArgumentArgument.getMinimalCount()Integer.MAX_VALUE
for infinitypublic boolean isOptional()
Argumentminimal count
to decide whether this is optional.true when minimal count is 0, false otherwise@Nullable public java.lang.String getValue()