org.incava.jagol
Class BooleanOption
java.lang.Object
org.incava.jagol.Option
org.incava.jagol.BooleanOption
public class BooleanOption
- extends Option
Represents an option that is an boolean.
Constructor Summary |
BooleanOption(java.lang.String longName,
java.lang.String description)
|
BooleanOption(java.lang.String longName,
java.lang.String description,
java.lang.Boolean value)
|
Method Summary |
java.lang.Boolean |
getValue()
Returns the value. |
boolean |
set(java.lang.String arg,
java.util.List args)
Sets from a list of command-line arguments. |
void |
setValue(java.lang.Boolean value)
Sets the value. |
void |
setValue(java.lang.String value)
Sets the value from the string, for a boolean type. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BooleanOption
public BooleanOption(java.lang.String longName,
java.lang.String description)
BooleanOption
public BooleanOption(java.lang.String longName,
java.lang.String description,
java.lang.Boolean value)
getValue
public java.lang.Boolean getValue()
- Returns the value. This is null if it has not been set.
setValue
public void setValue(java.lang.Boolean value)
- Sets the value.
setValue
public void setValue(java.lang.String value)
throws InvalidTypeException
- Sets the value from the string, for a boolean type.
- Specified by:
setValue
in class Option
- Throws:
InvalidTypeException
set
public boolean set(java.lang.String arg,
java.util.List args)
throws OptionException
- Sets from a list of command-line arguments. Returns whether this option
could be set from the current head of the list.
- Specified by:
set
in class Option
- Throws:
OptionException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object