use of eu.fthevenet.binjr.data.exceptions.InvalidAdapterParameterException in project selenium_java by sergueik.
the class CsvFileAdapter method loadParams.
@Override
public void loadParams(Map<String, String> params) throws DataAdapterException {
if (params == null) {
throw new InvalidAdapterParameterException("Could not find parameter list for adapter " + getSourceName());
}
zoneId = validateParameter(params, "zoneId", s -> {
if (s == null) {
throw new InvalidAdapterParameterException("Parameter zoneId is missing in adpater " + getSourceName());
}
return ZoneId.of(s);
});
String path = validateParameterNullity(params, "csvPath");
delimiter = validateParameter(params, "delimiter", s -> {
if (s == null || s.isEmpty() || s.length() > 1) {
throw new InvalidAdapterParameterException("Parameter 'delimiter' is missing for adapter " + this.getSourceName());
}
return s.charAt(0);
});
encoding = validateParameterNullity(params, "encoding");
dateTimePattern = validateParameterNullity(params, "dateTimePattern");
this.csvPath = Paths.get(path);
}
Aggregations