package com.engine.salary.enums.salarybill;

import java.util.Arrays;

/**
 * @Description: 工资单开关项
 * @Author: wangxiangzhong
 * @Date: 2021/12/9 15:56
 */
public enum SalaryTemplateWhetherEnum {
    TRUE(1, "是", 84967),
    FALSE(0, "否", 84968);

    private int value;

    private String defaultLabel;

    private int labelId;

    SalaryTemplateWhetherEnum(int value, String defaultLabel, int labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

    public Integer getValue() {
        return value;
    }

    public String getDefaultLabel() {
        return defaultLabel;
    }

    public Integer getLabelId() {
        return labelId;
    }

    public static String getNameByValue(Integer value) {
        if (value == null) {
            return "";
        }
        SalaryTemplateWhetherEnum[] enumAry = SalaryTemplateWhetherEnum.values();
        for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
            if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
                return enumAry[i].name();
            }
        }
        return "";
    }
}
