Package io.sbk.params.impl
Class SbkInputOptions
java.lang.Object
io.sbk.params.impl.SbkInputOptions
- All Implemented Interfaces:
InputOptions
,ParsedOptions
,ParseInputOptions
- Direct Known Subclasses:
SbkParameters
,SbkYalParameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Add the driver specific command line arguments.final String
Get the -help output.getOptionValue
(String name) Retrieve the Option matching the parameter name specified.getOptionValue
(String name, String defaultValue) Retrieve the Option matching the parameter name specified.final boolean
Returns whether the named Option exists.boolean
hasOptionValue
(String name) Returns whether the named Option has the value after parsing.void
Parse the command line arguments.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sbk.params.ParsedOptions
printHelp
-
Constructor Details
-
SbkInputOptions
-
-
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 interfaceInputOptions
- 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
Description copied from interface:InputOptions
Returns whether the named Option exists.- Specified by:
hasOption
in interfaceInputOptions
- Parameters:
name
- name of the parameter option- Returns:
- true if the named Option is a member of this Options
-
getHelpText
Description copied from interface:ParsedOptions
Get the -help output.- Specified by:
getHelpText
in interfaceParsedOptions
- Returns:
- formatted Help text
-
hasOptionValue
Description copied from interface:ParsedOptions
Returns whether the named Option has the value after parsing.- Specified by:
hasOptionValue
in interfaceParsedOptions
- Parameters:
name
- name of the parameter option- Returns:
- true if the named Option is a member of this Options
-
getOptionValue
Description copied from interface:ParsedOptions
Retrieve the Option matching the parameter name specified.- Specified by:
getOptionValue
in interfaceParsedOptions
- Parameters:
name
- Name of the parameter.- Returns:
- parameter value
-
getOptionValue
Description copied from interface:ParsedOptions
Retrieve the Option matching the parameter name specified.- Specified by:
getOptionValue
in interfaceParsedOptions
- 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 interfaceParseInputOptions
- 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.
-