org.apache.commons.cli
Class OptionGroup
java.lang.Object
org.apache.commons.cli.OptionGroup
public class OptionGroup
extends java.lang.Object
A group of mutually exclusive options.
Version:
- John Keyes ( john at integralsource.com )
private HashMap | optionMap - hold the options
|
private boolean | required - specified whether this group is required
|
private String | selected - the name of the selected option
|
optionMap
private HashMap optionMap
hold the options
required
private boolean required
specified whether this group is required
selected
private String selected
the name of the selected option
addOption
public OptionGroup addOption(Option opt)
add opt
to this group
opt
- the option to add to this group
- this option group with opt added
getNames
public Collection getNames()
- the names of the options in this group as a
Collection
getOptions
public Collection getOptions()
- the options in this group as a
Collection
getSelected
public String getSelected()
- the selected option name
isRequired
public boolean isRequired()
Returns whether this option group is required.
setRequired
public void setRequired(boolean required)
required
- specifies if this group is required
toString
public String toString()
Returns the stringified version of this OptionGroup.
- the stringified representation of this group