org.incava.jagol

Class BooleanOption


public class BooleanOption
extends Option

Represents an option that is an boolean.

Field Summary

Fields inherited from class org.incava.jagol.Option

longName, shortName

Constructor Summary

BooleanOption(String longName, String description)
BooleanOption(String longName, String description, Boolean value)

Method Summary

Boolean
getValue()
Returns the value.
boolean
set(String arg, List args)
Sets from a list of command-line arguments.
void
setValue(Boolean value)
Sets the value.
void
setValue(String value)
Sets the value from the string, for a boolean type.
String
toString()

Methods inherited from class org.incava.jagol.Option

getDescription, getLongName, getShortName, set, setLongName, setShortName, setValue

Constructor Details

BooleanOption

public BooleanOption(String longName,
                     String description)

BooleanOption

public BooleanOption(String longName,
                     String description,
                     Boolean value)

Method Details

getValue

public Boolean getValue()
Returns the value. This is null if it has not been set.

set

public boolean set(String arg,
                   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.
Overrides:
set in interface Option

setValue

public void setValue(Boolean value)
Sets the value.

setValue

public void setValue(String value)
            throws InvalidTypeException
Sets the value from the string, for a boolean type.
Overrides:
setValue in interface Option

toString

public String toString()