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

com.jslsolucoes.spring.converter.LongConverter Maven / Gradle / Ivy

There is a newer version: 1.0.34
Show newest version
package com.jslsolucoes.spring.converter;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;

public class LongConverter implements Converter {

    @Override
    public Long convert(String value) {
	if (StringUtils.isEmpty(value))
	    return null;
	return Long.valueOf(value.replaceAll("(?=^-)|(\\D)", ""));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy