public class SimpleOnSwitch extends AbstractSwitch
So either this switch appears in the command line (switched on), or it does not appear (switched off).
description, longForm, shortForm| Constructor and Description |
|---|
SimpleOnSwitch(java.lang.Character shortOn,
java.lang.String longOn,
java.lang.String description)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
isSwitchedOn()
Get the value of this switch.
|
boolean |
isVarLength()
Does this argument or switch have a variable length?
|
getDescription, getLongForms, getShortFormsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsumeArgument, isOptional, isSwitch, needsArgumentspublic SimpleOnSwitch(@NotNull java.lang.Character shortOn, @NotNull java.lang.String longOn, @NotNull java.lang.String description)
shortOn - the character used for switching on, the switching
off character will be automatically done by inverting
the case (eg. for k it will become K),
so the character should be in upper or lower caselongOn - the long form used for switching on, the long form
for switching off will either be created by prepending
no- of, if the long form begins with the prefix
with-, by replacing this prefix with without-description - description of this switchpublic 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 line@NotNull public java.lang.String getAppearance()
SwitchOrArgumentpublic void found(char shortSwitch)
SwitchshortSwitch - short form in which this switch appearedpublic void found(@NotNull java.lang.String longSwitch)
SwitchlongSwitch - long formpublic boolean isSwitchedOn()
true: switched onfalse: switched off