public class StringArgMultipleSwitch extends AbstractMultipleSwitch
maxCount, minCount
description, longForm, shortForm
Constructor and Description |
---|
StringArgMultipleSwitch(java.lang.Character shortForm,
java.lang.String longForm,
java.lang.String argName,
java.lang.String description,
int minCount) |
StringArgMultipleSwitch(java.lang.Character shortForm,
java.lang.String longForm,
java.lang.String argName,
java.lang.String description,
int minCount,
int maxCount) |
Modifier and Type | Method and Description |
---|---|
boolean |
consumeArgument(java.lang.String arg)
Read further arguments from the command line.
|
void |
found(char shortSwitch)
This switch appears in the command line in the given short form.
|
void |
found(java.lang.String longSwitch)
This switch appears in the command line in the given long form.
|
java.lang.String |
getAppearance()
Get the appearance of this switch or argument on the command line.
|
Indexable<java.lang.String> |
getParameters() |
boolean |
isVarLength()
Does this argument or switch have a variable length?
|
boolean |
needsArguments()
Does this switch require arguments?
|
getDescription, getLongForms, getShortForms
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isOptional, isSwitch
public StringArgMultipleSwitch(@NotNull java.lang.Character shortForm, @NotNull java.lang.String longForm, @NotNull java.lang.String argName, @NotNull java.lang.String description, int minCount)
public boolean isVarLength()
SwitchOrArgument
true
: 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 boolean needsArguments()
Switch
Switch.consumeArgument(String)
method will be called.
The default implementation returns false
, so always both
this method and the Switch.consumeArgument(String)
method need to
be overridden.true
if this switch requires argumentsfalse
if this switch does not require argumentsSwitch.consumeArgument(String)
public boolean consumeArgument(@NotNull java.lang.String arg)
Switch
arg
- argumentSwitch.needsArguments()
public void found(char shortSwitch)
Switch
shortSwitch
- short form in which this switch appearedpublic void found(@NotNull java.lang.String longSwitch)
Switch
longSwitch
- long form@NotNull public java.lang.String getAppearance()
SwitchOrArgument