package com.engine.salary.enums.datacollection;

import java.util.Arrays;

/**
 * @Description: 考勤引用-来源
 * @Author: wangxiangzhong
 * @Date: 2021-11-17 14:37
 */
public enum AttendQuoteFieldTypeEnum {
    NUMBER(1, "数值", 87625),
    TEXT(2, "文本", 85393);

    private int value;

    private String defaultLabel;

    private int labelId;

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

    public int getValue() {
        return value;
    }

    public String getDefaultLabel() {
        return defaultLabel;
    }

    public int getLabelId() {
        return labelId;
    }

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