All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.espr.mvc.converter.StringToDoubleConverter Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package it.espr.mvc.converter;

import it.espr.injector.Utils;

public class StringToDoubleConverter extends AStringToCastingConverter {

	@Override
	public Class getType() {
		return Double.class;
	}

	@Override
	public Double convert(String value) throws StringToTypeConverterException {
		try {
			if (!Utils.isEmpty(value)) {
				return Double.parseDouble(value);
			}
		} catch (Exception e) {
			throw new StringToTypeConverterException("Couldn't parse value '" + value + "'", e);
		}
		return null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy