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

br.com.tecsinapse.dataio.converter.IntegerFromBigDecimalTableCellConverter Maven / Gradle / Ivy

There is a newer version: 3.1.8
Show newest version
/*
 * Tecsinapse Data Input and Output
 *
 * License: GNU Lesser General Public License (LGPL), version 3 or later
 * See the LICENSE file in the root directory or .
 */
package br.com.tecsinapse.dataio.converter;

import java.math.BigDecimal;

import com.google.common.base.Strings;

public class IntegerFromBigDecimalTableCellConverter implements FromNumberConverter {

    @Override
    public Integer apply(BigDecimal input) {
        return input.intValue();
    }

    @Override
    public Integer apply(String input) {
        return Strings.isNullOrEmpty(input) ? null : new BigDecimal(input).intValue();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy