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. |
getAppearance, getDescription
public SingleArgument(@NotNull java.lang.String name, @NotNull java.lang.String description)
public boolean consumeArgument(@NotNull java.lang.String arg)
SwitchOrArgument
arg
- argumentpublic int getMinimalCount()
Argument
1
.public int getMaximalCount()
Argument
Argument.getMinimalCount()
Integer.MAX_VALUE
for infinitypublic boolean isOptional()
Argument
minimal count
to decide whether this is optional.true
when minimal count is 0
, false
otherwise@Nullable public java.lang.String getValue()