Class SbkInputOptions

java.lang.Object
io.sbk.params.impl.SbkInputOptions
All Implemented Interfaces:
InputOptions, ParsedOptions, ParseInputOptions
Direct Known Subclasses:
SbkParameters, SbkYalParameters

public class SbkInputOptions extends Object implements ParseInputOptions
  • Constructor Details

    • SbkInputOptions

      public SbkInputOptions(String name, String header)
  • Method Details

    • addOption

      public final void addOption(String name, boolean hasArg, String description) throws IllegalArgumentException
      Description copied from interface: InputOptions
      Add the driver specific command line arguments.
      Specified by:
      addOption in interface InputOptions
      Parameters:
      name - Name of the parameter to add.
      hasArg - flag signalling if an argument is required after this option.
      description - Self-documenting description.
      Throws:
      IllegalArgumentException - if 'name' already added.
    • hasOption

      public final boolean hasOption(String name)
      Description copied from interface: InputOptions
      Returns whether the named Option exists.
      Specified by:
      hasOption in interface InputOptions
      Parameters:
      name - name of the parameter option
      Returns:
      true if the named Option is a member of this Options
    • getHelpText

      public final String getHelpText()
      Description copied from interface: ParsedOptions
      Get the -help output.
      Specified by:
      getHelpText in interface ParsedOptions
      Returns:
      formatted Help text
    • hasOptionValue

      public boolean hasOptionValue(String name)
      Description copied from interface: ParsedOptions
      Returns whether the named Option has the value after parsing.
      Specified by:
      hasOptionValue in interface ParsedOptions
      Parameters:
      name - name of the parameter option
      Returns:
      true if the named Option is a member of this Options
    • getOptionValue

      public String getOptionValue(String name)
      Description copied from interface: ParsedOptions
      Retrieve the Option matching the parameter name specified.
      Specified by:
      getOptionValue in interface ParsedOptions
      Parameters:
      name - Name of the parameter.
      Returns:
      parameter value
    • getOptionValue

      public String getOptionValue(String name, String defaultValue)
      Description copied from interface: ParsedOptions
      Retrieve the Option matching the parameter name specified.
      Specified by:
      getOptionValue in interface ParsedOptions
      Parameters:
      name - Name of the parameter.
      defaultValue - default value if the parameter not found
      Returns:
      parameter value
    • parseArgs

      public void parseArgs(String[] args) throws org.apache.commons.cli.ParseException, IllegalArgumentException, HelpException
      Description copied from interface: ParseInputOptions
      Parse the command line arguments.
      Specified by:
      parseArgs in interface ParseInputOptions
      Parameters:
      args - list of command line arguments.
      Throws:
      org.apache.commons.cli.ParseException - If an exception occurred.
      IllegalArgumentException - If an exception occurred.
      HelpException - If the 'help' option is supplied.