/**
* Create CLI option for selecting group of tracing features
- *
- * @param name
- * short name of CLI option
- * @param longName
- * long name of CLI option
+ *
+ * @param name short name of CLI option
+ * @param longName long name of CLI option
*/
private TracingFeatureArgument(String name, String longName) {
this.option = Option.builder(name).longOpt(longName).hasArgs()
/**
* Create CLI option for selecting single tracing features
- *
- * @param name
- * short name of CLI option
- * @param feature
- * primitive feature to be selected with the options
+ *
+ * @param name short name of CLI option
+ * @param feature primitive feature to be selected with the options
*/
private TracingFeatureArgument(String name, PrimitiveFeature feature) {
this.option = Option.builder(name)
defFeatures.add(feature);
}
+ /**
+ * Add the feature to the default features which are selected with the option
+ *
+ * @param name value of option's argument for feature selection
+ * @param feature primitive feature to be added for tracing
+ */
private void addDefaultFeatureValue(String name, PrimitiveFeature feature) {
addFeatureValue(name, feature);
defFeatures.add(feature);
}
+ /**
+ * Add the feature to the map of features that may be selected with the option
+ *
+ * @param name value of option's argument for feature selection
+ * @param feature primitive feature to be added for tracing
+ */
private void addFeatureValue(String name, PrimitiveFeature feature) {
availFeatures.put(name, feature);
}
+ /**
+ * Add to tracing arguments features selected with the option
+ *
+ * @param result tracing argument to add features to
+ * @param values array of arguments defining features for selection
+ * @throws ParseException if provided value is not from set of available features
+ */
private void selectFeatures(TracingArguments result, String[] values)
throws ParseException {
for (String val : values) {
}
}
+ /**
+ * Add to tracing arguments all features available for the option
+ *
+ * @param result tracing argument to add features to
+ */
private void selectAllFeatures(TracingArguments result) {
for (PrimitiveFeature feature : availFeatures.values())
result.addFeature(feature);
}
+ /**
+ * Add to tracing arguments default features for the option
+ *
+ * @param result tracing argument to add features to
+ */
private void selectDefaultFeatures(TracingArguments result) {
for (PrimitiveFeature feature : defFeatures)
result.addFeature(feature);
return option.getOpt();
}
+ /**
+ * Parse CLI options for selection of tracing features defined by the enum value
+ *
+ * @param result tracing argument to add features to
+ * @param cmdline parsed command line
+ * @throws ParseException in any error occurred while parsing arguments
+ */
public void parseFeatureOption(TracingArguments result, CommandLine cmdline)
throws ParseException {
String optName = getOptionName();
}
}
+ /**
+ * Parse CLI options for selection of any supported tracing features
+ *
+ * @param result tracing argument to add features to
+ * @param cmdline parsed command line
+ * @throws ParseException in any error occurred while parsing arguments
+ */
public static void parseFeatureOptions(TracingArguments result,
CommandLine cmdline) throws ParseException {
for (TracingFeatureArgument opt : values()) {
/**
* Converts given {@link TracingArguments} object to ArrayList<String>.
- *
- * @param args
- * {@link TracingArguments} object
+ *
+ * @param args {@link TracingArguments} object
* @return ArrayList<String> representation of given arguments.
*/
public static ArrayList<String> toStringArrayList(TracingArguments args) {