package org.qinan.safetyeval.domain.constant;

/**
 * 资质等级
 */
public enum QualificationLevelEnum {

    SENIOR(1, "高级"),
    MIDDLE(2, "中级"),
    JUNIOR(3, "初级"),
    ;

    private final int code;
    private final String name;

    QualificationLevelEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static QualificationLevelEnum ofCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (QualificationLevelEnum item : values()) {
            if (item.code == code) {
                return item;
            }
        }
        return null;
    }
}
