package com.engine.salary.sys.enums;

import com.engine.salary.enums.BaseEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 排序枚举
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum OpenEnum implements BaseEnum<String> {

    OFF("0", "关闭", 1),
    OPEN("1", "开启", 1);

    private String value;

    private String defaultLabel;

    private int labelId;


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

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

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

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

    public static OpenEnum parseByValue(String value) {
        for (OpenEnum openEnum : OpenEnum.values()) {
            if (StringUtils.equals(openEnum.getValue(), value)) {
                return openEnum;
            }
        }
        return OFF;
    }
}
