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

com.github.stupdit1t.excel.handle.ObjectHandler Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
package com.github.stupdit1t.excel.handle;

import com.github.stupdit1t.excel.handle.rule.BaseVerifyRule;

import java.util.function.BiFunction;


/**
 * 自定义转换
 *
 * @author 625
 */
public class ObjectHandler extends BaseVerifyRule {

    private BiFunction doHandleSub;

    /**
     * 自定义验证
     *
     * @param allowNull 可为空
     */
    public ObjectHandler(boolean allowNull, BiFunction handle) {
        super(allowNull);
        this.doHandleSub = handle;
    }

    @Override
    public Object doHandle(String fieldName, String index, Object cellValue) throws Exception {
        return doHandleSub.apply(fieldName, cellValue);
    }
}