package com.ynfy.buss.practice.userpractice.enums;


/**
 * 练习模式
 *
 * @author bool
 * @date 2019-10-30 13:11
 */
public enum PracticeMode {

    SX(1, "顺序练习"),
    SJ(2, "随机练习"),
    TX(3, "题型练习");

    private Integer code;

    private String value;

    PracticeMode(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static PracticeMode getByCode(Integer code) {
        for (PracticeMode mode : values()) {
            if (mode.getCode().equals(code)) {
                return mode;
            }
        }
        return null;
    }

}
