Class OptionGroup
java.lang.Object
tripleo.vendor.org_apache_commons_cli.OptionGroup
- All Implemented Interfaces:
Serializable
A group of mutually exclusive options.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull OptionGroupAdd the specifiedOptionto this group.@NotNull Collection<String>getNames()@NotNull Collection<Option>booleanTests whether this option group is required.voidsetRequired(boolean required) voidsetSelected(@Nullable Option option) Set the selected option of this group toname.@NotNull StringtoString()Returns the stringified version of this OptionGroup.
-
Constructor Details
-
OptionGroup
public OptionGroup()
-
-
Method Details
-
addOption
Add the specifiedOptionto this group.- Parameters:
option- the option to add to this group- Returns:
- this option group with the option added
-
getNames
- Returns:
- the names of the options in this group as a
Collection
-
getSelected
- Returns:
- the selected option name
-
setSelected
Set the selected option of this group toname.- Parameters:
option- the option that is selected- Throws:
AlreadySelectedException- if an option from this group has already been selected.
-
isRequired
public boolean isRequired()Tests whether this option group is required.- Returns:
- whether this option group is required
-
setRequired
public void setRequired(boolean required) - Parameters:
required- specifies if this group is required
-
toString
Returns the stringified version of this OptionGroup. -
getOptions
- Returns:
- the options in this group as a
Collection
-