edu.isi.nlp.converters.StringToLong Maven / Gradle / Ivy
The newest version!
package edu.isi.nlp.converters;
import static com.google.common.base.Preconditions.checkNotNull;
public class StringToLong implements StringConverter {
public StringToLong() {}
public Class getValueClass() {
return Long.class;
}
@Override
public Long decode(final String s) {
try {
return Long.parseLong(checkNotNull(s));
} catch (NumberFormatException nfe) {
throw new ConversionException("Not a long: " + s, nfe);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy