package com.qmth.boot.tools.excel.convertor.impl;

import com.qmth.boot.tools.excel.convertor.ValueConvertor;
import com.qmth.boot.tools.excel.model.FieldParam;
import org.apache.poi.ss.usermodel.Cell;

public class IntegerConvertor implements ValueConvertor<Integer> {

    public static final IntegerConvertor instance = new IntegerConvertor();

    @Override
    public Integer parse(String value, FieldParam param) throws Exception {
        return Integer.parseInt(value);
    }

    @Override
    public void format(Integer object, FieldParam param, Cell cell) throws Exception {
        cell.setCellValue(object);
    }
}
