/** * Parses (name, value) pairs from the input and returns the result as a Map. The name is taken from the first column and * value from the second column. If an input line contains only one column its value is defaulted to an empty string. * Any extra columns are ignored. * * @param prefix a prefix to apply to the mapped variable names * @param separator the field delimiter * @return a map of (name, value) pairs */ public Map<String, String> getDataAsMap(String prefix, String separator) { return getDataAsMap(prefix, separator, 0); }
/** * Parses (name, value) pairs from the input and returns the result as a Map. The name is taken from the first column and * value from the second column. If an input line contains only one column its value is defaulted to an empty string. * Any extra columns are ignored. * * @param prefix a prefix to apply to the mapped variable names * @param separator the field delimiter * @return a map of (name, value) pairs */ public Map<String, String> getDataAsMap(String prefix, String separator) { return getDataAsMap(prefix, separator, 0); }
@Override public Map<String, String> getArgumentsAsMap() { Map<String, String> variables = new VariableFromCsvFileReader(getFileName()).getDataAsMap(getVariablePrefix(), getSeparator(), getSkipLines()); //store in System Properties also if (isStoreAsSystemProperty()) { for (Map.Entry<String, String> element : variables.entrySet()) { String variable = element.getKey(); if (System.getProperty(variable) == null) { System.setProperty(variable, element.getValue()); } } } return variables; }
@Override public Map<String, String> getArgumentsAsMap() { Map<String, String> variables = new VariableFromCsvFileReader(getFileName()).getDataAsMap(getVariablePrefix(), getSeparator(), getSkipLines()); //store in System Properties also if (isStoreAsSystemProperty()) { for (Map.Entry<String, String> element : variables.entrySet()) { String variable = element.getKey(); if (System.getProperty(variable) == null) { System.setProperty(variable, element.getValue()); } } } return variables; }