Class ArgumentTracker
java.lang.Object
org.apache.rat.ui.ArgumentTracker
Tracks Arg values that are set and their values for conversion from native UI to
Apache Commons command line values.
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentTracker(UIOptionCollection<?> optionCollection) The arguments understood by the UI for the current report execution. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd values to the key in the argument list. empty values are ignored.voidAdd values to the key in the argument list. empty values are ignored.voidapply(BiConsumer<String, List<String>> consumer) Applies the consumer to each arg and list in turn.args()Gets the list of arguments prepared for the CLI code to parse.static StringextractKey(org.apache.commons.cli.Option option) Extract the core name from the option.static CasedStringextractName(org.apache.commons.cli.Option option) Generates the CasedString for the specified option.Get the list of values for a key.voidRemove a key from the argument list.voidRemove a key from the argument list.voidSet a key and value into the argument list.voidSet a key and value into the argument list.
-
Constructor Details
-
ArgumentTracker
The arguments understood by the UI for the current report execution.- Parameters:
optionCollection- The AbstractOptionCollection for this UI.
-
-
Method Details
-
extractKey
Extract the core name from the option. This is theOption.getLongOpt()if defined, otherwise theOption.getOpt().- Parameters:
option- the commons cli option.- Returns:
- the common cli based name.
-
extractName
Generates the CasedString for the specified option.- Parameters:
option- the option to extract the name for.- Returns:
- the CasedString in KEBAB format.
-
args
-
apply
Applies the consumer to each arg and list in turn. -
setArg
-
setArg
-
getArg
-
addArg
Add values to the key in the argument list. empty values are ignored. If no non-empty values are present no change is made. If the key does not exist, adds it.- Parameters:
option- the option to add values for.value- the array of values to set.
-
addArg
-
removeArg
Remove a key from the argument list.- Parameters:
option- the option to remove the key for.
-
removeArg
Remove a key from the argument list.- Parameters:
trackerKey- the key remove.
-