
com.fredericboisguerin.excel.converter.LongConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of excel-reader-writer Show documentation
Show all versions of excel-reader-writer Show documentation
A library to read/write excel files with simple descriptions of the model
package com.fredericboisguerin.excel.converter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by fboisguerin on 22/07/2015.
*/
class LongConverter extends AbstractConverter {
private static final LongConverter INSTANCE = new LongConverter();
public static LongConverter getInstance() {
return INSTANCE;
}
private LongConverter() {
super(Long.class);
}
@Override
protected Long innerConvert(String s) {
Pattern pattern = Pattern.compile("[0-9]+");
Matcher matcher = pattern.matcher(s);
return matcher.find() ? Long.valueOf(matcher.group()) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy