Class OptionGroup

java.lang.Object
tripleo.vendor.org_apache_commons_cli.OptionGroup
All Implemented Interfaces:
Serializable

public class OptionGroup extends Object implements Serializable
A group of mutually exclusive options.
See Also:
  • Constructor Details

    • OptionGroup

      public OptionGroup()
  • Method Details

    • addOption

      @NotNull public @NotNull OptionGroup addOption(@NotNull @NotNull Option option)
      Add the specified Option to this group.
      Parameters:
      option - the option to add to this group
      Returns:
      this option group with the option added
    • getNames

      @NotNull public @NotNull Collection<String> getNames()
      Returns:
      the names of the options in this group as a Collection
    • getSelected

      public String getSelected()
      Returns:
      the selected option name
    • setSelected

      public void setSelected(@Nullable @Nullable Option option) throws AlreadySelectedException
      Set the selected option of this group to name.
      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

      @NotNull public @NotNull String toString()
      Returns the stringified version of this OptionGroup.
      Overrides:
      toString in class Object
      Returns:
      the stringified representation of this group
    • getOptions

      @NotNull public @NotNull Collection<Option> getOptions()
      Returns:
      the options in this group as a Collection