package cn.qinys.platform.base.utils.excel;

import lombok.Data;

/**
 * code is far away from bug with the animal protecting
 *
 * @author lsq28657638@gmail.com
 * @description
 * @date Create in 2018/11/16 10:01
 */
@Data
public class ExcelElement {

    public static final String STRING = "0";
    public static final String NUMERIC = "1";
    public static final String DATE = "2";
    public static final String DICT = "3";

    private String header;
    private String fieldName;
    private String checkValue;
    private String formatter;

    /**
     * 主要用于读取excel的
     *
     * @param fieldName 对应实体类的字段
     */
    public ExcelElement(String fieldName) {
        this.fieldName = fieldName;
    }

    /**
     * 主要用于导出excel的
     *
     * @param header    题头
     * @param fieldName 对应实体类的字段
     */
    public ExcelElement(String header, String fieldName) {
        this.header = header;
        this.fieldName = fieldName;
        this.checkValue = STRING;
    }

    /**
     * 主要用于导出excel的
     *
     * @param header     题头
     * @param fieldName  对应实体类的字段
     * @param checkValue 值的类型
     * @param formatter  格式串,或者字典名
     */
    public ExcelElement(String header, String fieldName, String checkValue, String formatter) {
        this.header = header;
        this.fieldName = fieldName;
        this.checkValue = checkValue;
        this.formatter = formatter;
    }

}
