package net.northking.cctp.testbug.enums;

/**
 * @author: puchao.ma
 * @date: 2021/10/11 15:44
 */
public enum TestBugGrade {

    FATAL_ERROR("A", "致命性错误-A类"),
    SEVERITY_ERROR("B", "严重性错误-B类"),
    GENERAL_ERROR("C", "一般性错误-C类"),
    WARNING_ERROR("D", "警告性错误-D类"),
    SUGGESTION_ERROR("E", "建议性错误-E类");

    private final String code;

    private final String msg;

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

    public static TestBugGrade getTestBugGrade(String code) {
        for (TestBugGrade value : TestBugGrade.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
