package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

public enum HilistLv {
    FIRST_CLASS("01", "甲类"),

    SECOND_CLASS("02", "乙类"),

    THIRD_CLASS("03", "丙类");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static HilistLv get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (HilistLv hilistLv : HilistLv.values()) {
            if (code.trim().equals(hilistLv.getCode())) {
                return hilistLv;
            }
        }
        return null;
    }
}
