package com.engine.salary.util.excel;

import java.util.Arrays;
import java.util.Objects;

public enum DataTypeEnum {
    string("string", "字符类型"),
    number("string", "数字类型"),
    date("string", "日期类型");

    private String value;
    private String name;

    DataTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    public static DataTypeEnum parseByValue(String value) {
        return Arrays.stream(DataTypeEnum.values()).filter(typeEnum -> Objects.equals(typeEnum.getValue(), value)).findFirst().orElse(null);
    }

}
