package digital.laboratory.platform.inspection.enums;

/**
 * @author xy
 * @version 1.0
 * @title compoundMassKV  化合物名称与Mass的对应关系
 * @description
 * @create 2024/2/18 18:02
 */

public enum CompoundMassKV {
    COMPOUND_ABFUBINACA("AB-FUBINACA", 109),
    COMPOUND_2FA("2-FA", 44),
    COMPOUND_3FA("3-FA", 44),
    COMPOUND_4FA("4-FA", 44),
    COMPOUND_Phentermine("Phentermine", 58),
    COMPOUND_MPA("MPA", 58),
    COMPOUND_2FMA("2-FMA", 58),
    COMPOUND_3FMA("3-FMA", 58),
    COMPOUND_4FMA("4-FMA", 58),
    COMPOUND_HEROIN("Heroin", 327),
    COMPOUND_MEDETOMIDINE("Medetomidine", 0),
    ;

    private String name;
    private int code;
    CompoundMassKV(String _name , int _code) {
        this.name=_name;
        this.code=_code;
    }
    public int getCode() {
        return code;
    }
    public String getCompoundName() {
        return name;
    }
    public static int getCodeByName(String _name) {
        for (CompoundMassKV enumObj : CompoundMassKV.values()) {
            if (enumObj.getCompoundName().equals(_name)) {
                return enumObj.code;
            }
        }
        return -1;
    }
}
