public abstract static class Args.Value extends Object
types
of command-line options.
Values can be produced using the various static factories associated to
every type of option: mkFlag(boolean), mkNumeric(int)
and mkString(String).
getType()| Modifier and Type | Field and Description |
|---|---|
static Args.Value |
NO
The value associated to a disabled flag
|
static Args.Value |
YES
The value associated to an enabled flag
|
| Constructor and Description |
|---|
Value() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asFlag() |
int |
asNumeric() |
String |
asString() |
static Args.Value |
mkFlag(boolean b) |
static Args.Value |
mkNumeric(int v) |
static Args.Value |
mkString(String s) |
String |
toString() |
public static final Args.Value YES
public static final Args.Value NO
public boolean asFlag()
IllegalArgumentException - if the value is not of type Args.Type.FLAGpublic int asNumeric()
IllegalArgumentException - if the value is not of type Args.Type.NUMERICpublic String asString()
IllegalArgumentException - if the value is not of type Args.Type.STRINGpublic static Args.Value mkFlag(boolean b)
b - whether the flag is present or notpublic static Args.Value mkNumeric(int v)
v - public static Args.Value mkString(String s)
s -