com.bbn.bue.common.converters.StringToFloat Maven / Gradle / Ivy
The newest version!
package com.bbn.bue.common.converters;
import static com.google.common.base.Preconditions.checkNotNull;
public class StringToFloat implements StringConverter {
public StringToFloat() {
}
public Class getValueClass() {
return Float.class;
}
public Float decode(final String s) {
try {
return Float.parseFloat(checkNotNull(s));
} catch (NumberFormatException nfe) {
throw new ConversionException("Not a float: " + s, nfe);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy