Package org.rwtodd.args
Class AppendingParam<T>
java.lang.Object
org.rwtodd.args.AppendingParam<T>
- All Implemented Interfaces:
OneArgParam<List<T>>,Param
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAppendingParam(OneArgParam<T> delegate) Construct a parameter that defaults to the empty list.AppendingParam(OneArgParam<T> delegate, List<T> dflt) Construct a parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHelp(PrintStream ps) adds help for this parameter to the given stream.voidAdd the parameter's names to aMap<String,Param>.getValue()gets the current value of the parametervoidProcess an parameter with its argument.
-
Field Details
-
delegate
-
arg
-
-
Constructor Details
-
AppendingParam
Construct a parameter.- Parameters:
delegate- a OneArgParam that we will delegate to for names and help strings and parsingdflt- the default, starting value of the parameter (any provided params will be appended it this).
-
AppendingParam
Construct a parameter that defaults to the empty list.- Parameters:
delegate- a OneArgParam that we will delegate to for names and help strings and parsing
-
-
Method Details
-
process
Description copied from interface:OneArgParamProcess an parameter with its argument.- Specified by:
processin interfaceOneArgParam<T>- Parameters:
param- the name of the parameter, as it was found in the command-line.argument- the given argument to the parameter.- Throws:
ArgParserException- if there is a problem parsing the argument.
-
addToMap
Add the parameter's names to aMap<String,Param>. -
addHelp
adds help for this parameter to the given stream. -
getValue
gets the current value of the parameter- Specified by:
getValuein interfaceOneArgParam<T>
-