package com.engine.salary.enums;



/**
 * 开关枚举
 * <p>Copyright: Copyright (c) 2024</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum SalaryOnOffEnum implements BaseEnum<Integer> {

    ON(1, "是", 84967),
    OFF(0, "否", 84968);

    private int value;

    private String defaultLabel;

    private int labelId;

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

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDefaultLabel() {
        return defaultLabel;
    }

    @Override
    public Integer getLabelId() {
        return labelId;
    }

    public static SalaryOnOffEnum parseByValue(int value) {
        for (SalaryOnOffEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return OFF;
    }

    public static SalaryOnOffEnum parseByDefaultLabel(String defaultLabel) {
        for (SalaryOnOffEnum item : values()) {
            if (item.getDefaultLabel().equals(defaultLabel)) {
                return item;
            }
        }
        return OFF;
    }
}
