ParameterTool
or a
third-party command line parsing library instead.@Deprecated public class RequiredParameters extends Object
Constructor and Description |
---|
RequiredParameters()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Option option)
Deprecated.
Add a parameter encapsulated in an
Option object. |
Option |
add(String name)
Deprecated.
Add a parameter based on its name.
|
ParameterTool |
applyTo(ParameterTool parameterTool)
Deprecated.
Check for all required parameters defined: - has a value been passed - if not, does the
parameter have an associated default value - does the type of the parameter match the one
defined in RequiredParameters - does the value provided in the parameterTool adhere to the
choices defined in the option.
|
String |
getHelp()
Deprecated.
Build a help text for the defined parameters.
|
String |
getHelp(List<String> missingArguments)
Deprecated.
Build a help text for the defined parameters and list the missing arguments at the end of the
text.
|
public Option add(String name) throws RequiredParametersException
name
- - the name of the parameterOption
object representing the parameterRequiredParametersException
- if an option with the same name is already definedpublic void add(Option option) throws RequiredParametersException
Option
object.option
- - the parameterRequiredParametersException
- if an option with the same name is already definedpublic ParameterTool applyTo(ParameterTool parameterTool) throws RequiredParametersException
If any check fails, a RequiredParametersException is thrown
parameterTool
- - parameters supplied by the user.RequiredParametersException
- if any of the specified checks failpublic String getHelp()
The format of the help text will be: Required Parameters: \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices: \n
public String getHelp(List<String> missingArguments)
The format of the help text will be: Required Parameters: \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices: \n
Missing parameters: \t param1 param2 ... paramN
missingArguments
- - a list of missing parametersCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.