Class OptionGroup

  • All Implemented Interfaces:
    java.io.Serializable

    public class OptionGroup
    extends java.lang.Object
    implements java.io.Serializable
    A group of mutually exclusive options.
    Version:
    $Id: OptionGroup.java 1749596 2016-06-21 20:27:06Z britter $
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      OptionGroup()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      OptionGroup addOption​(Option option)
      Add the specified Option to this group.
      java.util.Collection<java.lang.String> getNames()  
      java.util.Collection<Option> getOptions()  
      java.lang.String getSelected()  
      boolean isRequired()
      Returns whether this option group is required.
      void setRequired​(boolean required)  
      void setSelected​(Option option)
      Set the selected option of this group to name.
      java.lang.String toString()
      Returns the stringified version of this OptionGroup.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • addOption

        public OptionGroup addOption​(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

        public java.util.Collection<java.lang.String> getNames()
        Returns:
        the names of the options in this group as a Collection
      • getOptions

        public java.util.Collection<OptiongetOptions()
        Returns:
        the options in this group as a Collection
      • getSelected

        public java.lang.String getSelected()
        Returns:
        the selected option name
      • setRequired

        public void setRequired​(boolean required)
        Parameters:
        required - specifies if this group is required
      • isRequired

        public boolean isRequired()
        Returns whether this option group is required.
        Returns:
        whether this option group is required
      • toString

        public java.lang.String toString()
        Returns the stringified version of this OptionGroup.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the stringified representation of this group