com.bbn.bue.common.converters.StringToFloat Maven / Gradle / Ivy
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);
}
}
}