Class CmdLineOption


  • public class CmdLineOption
    extends Object
    Stores the master information about a command line option
    See Also:
    CmdLineParser
    • Field Detail

      • TYPE_COMMAND

        public static final int TYPE_COMMAND
        Command-line option type: COMMAND
        See Also:
        Constant Field Values
      • TYPE_OPTION

        public static final int TYPE_OPTION
        Command-line option type: OPTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • CmdLineOption

        public CmdLineOption​(String name,
                             String altName,
                             int type,
                             boolean takesArgVal)
                      throws IllegalArgumentException
        Default constructor
        Parameters:
        name - Name of the option
        altName - Alternate name of the option
        type - Type of the option
        takesArgVal - Flag to indicate whether the option takes argument or not
        Throws:
        IllegalArgumentException - If option type is TYPE_COMMAND and takesArgVal is specified as true
    • Method Detail

      • setValue

        public void setValue​(String value)
        Set method for value
        Parameters:
        value - Value
      • getName

        public String getName()
        Get method for name
        Returns:
        name
      • getAltName

        public String getAltName()
        Get method for altName
        Returns:
        altN
      • getType

        public int getType()
        Get method for type
        Returns:
        type
      • takesArg

        public boolean takesArg()
        Get method for takesArgVal
        Returns:
        takesArgVal
      • getValue

        public String getValue()
        Get method for value
        Returns:
        value