Map<String, JobParameter> parameters = params.getParameters();
Properties result = new Properties();
for (Entry<String, JobParameter> entry : parameters.entrySet()) {
String key = entry.getKey();
JobParameter jobParameter = entry.getValue();
Object value = jobParameter.getValue();
if (value != null) {
key = (!jobParameter.isIdentifying()? NON_IDENTIFYING_FLAG : "") + key;
if (jobParameter.getType() == ParameterType.DATE) {
synchronized (dateFormat) {
result.setProperty(key + DATE_TYPE, dateFormat.format(value));
}
}
else if (jobParameter.getType() == ParameterType.LONG) {
synchronized (longNumberFormat) {
result.setProperty(key + LONG_TYPE, longNumberFormat.format(value));
}
}
else if (jobParameter.getType() == ParameterType.DOUBLE) {
result.setProperty(key + DOUBLE_TYPE, decimalFormat((Double)value));
}
else {
result.setProperty(key, "" + value);
}