package jnpf.enums.cultivate;

import lombok.Getter;

/**
 *  0-不打乱 1-打乱
 */
@Getter
public enum ExamQuestionShuffleEnum {
    NO_SHUFFLE(0, "不打乱"),
    SHUFFLE(1, "打乱");
    Integer code;
    String msg;

    ExamQuestionShuffleEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public static String getMsg(Integer code) {
        ExamQuestionShuffleEnum[] values = ExamQuestionShuffleEnum.values();
        for (ExamQuestionShuffleEnum value : values) {
            if (value.getCode() == code) {
                return value.getMsg();
            }
        }
        return null;
    }

    public static ExamQuestionShuffleEnum of(Integer code) {
        if(code==null){
            return null;
        }
        ExamQuestionShuffleEnum[] values = ExamQuestionShuffleEnum.values();
        for (ExamQuestionShuffleEnum value : values) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
