com.bbn.bue.common.converters.StringToLong Maven / Gradle / Ivy
package com.bbn.bue.common.converters;
import static com.google.common.base.Preconditions.checkNotNull;
public class StringToLong implements StringConverter {
public StringToLong() {
}
public Class getValueClass() {
return Long.class;
}
public Long decode(final String s) {
try {
return Long.parseLong(checkNotNull(s));
} catch (NumberFormatException nfe) {
throw new ConversionException("Not a long: " + s, nfe);
}
}
}