package net.educoder.ecsonar.enums;


/**
 * @Author: youys
 * @Date: 2022/12/20
 * @Description: 分析类型
 */
public enum AnalyseTypeEnum {

    CodeSmell(1,80),
    BUG(2, 89),
    Vulnerability(3,93);

    private Integer type;
    private Integer metricId;


    AnalyseTypeEnum(Integer type, Integer metricId) {
        this.type = type;
        this.metricId = metricId;
    }


    public Integer getType() {
        return type;
    }

    public Integer getMetricId() {
        return metricId;
    }

    public static AnalyseTypeEnum getAnalyseTypeEnum(Integer type) {
        for (AnalyseTypeEnum analyseType : values()) {
            if (analyseType.type.equals(type)) {
                return analyseType;
            }
        }
        throw new RuntimeException("Not Found AnalyseTypeEnum by type=" + type);
    }

}
