DomainParameterParser { public static Object createValueInstance(final String type, final String valueString) { final String upperCaseType = type.toUpperCase(); final Object value; if (StringTypes.STRING.typeString.equals(upperCaseType)) { value = valueString; } else if (StringTypes.LONG.typeString.equals(upperCaseType)) { value = Long.parseLong(valueString); } else if (StringTypes.DOUBLE.typeString.equals(upperCaseType)) { value = Double.parseDouble(valueString); } else if (StringTypes.DATE.typeString.equals(upperCaseType)) { value = parseDate(valueString); } else { throw new SpringBatchLightminApplicationException("Unknown parameter Type: " + type); } return value; } private  DomainParameterParser(); static String parseParameterMapToString(final Map<String, Object> parametersMap); static void parseParameterEntryToString(final StringBuilder stringBuilder, final Entry<String, Object> entry); static JobParameters parseParametersToJobParameters(final String parameters); static Map<String, Object> parseParameters(final String parameters); static String parseJobParametersToString(final JobParameters jobParameters); static Entry<String, Object> generateParameterEntry(final String parameter); static Object createValueInstance(final String type, final String valueString); static Date parseDate(final String dateString); static String parseDate(final Date date); static final String DATE_FORMAT_WITH_TIMESTAMP; static final String DATE_FORMAT; }
@Test(expected = SpringBatchLightminApplicationException.class) public void createValueInstanceExceptionTest() { DomainParameterParser.createValueInstance("CLASS", "1234"); }