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

io.robe.convert.excel.parsers.ParseInt Maven / Gradle / Ivy

There is a newer version: 0.5.0.0-1039
Show newest version
package io.robe.convert.excel.parsers;

import org.apache.poi.ss.usermodel.Cell;

import java.lang.reflect.Field;

public class ParseInt implements IsParser {
    @Override
    public Object parse(Object o, Field field) {

        Integer i = null;

        int ind = ((String) o).indexOf(".");

        if (ind != -1) {
            o = ((String) o).substring(0, ind);
        }

        i = Integer.valueOf(o.toString());

        return i;
    }

    @Override
    public void setCell(Object o, Cell cell, Field field) {
        Integer integer = (Integer) o;
        if (integer != null) {
            cell.setCellValue(integer);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy