All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fredericboisguerin.excel.converter.LongConverter Maven / Gradle / Ivy

There is a newer version: 2.1
Show newest version
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