package com.qiuguo.iot.base.enums;

/*
* 设备运行场景类型
* 作者：吴林
* */
// 0 无场景 1营销模式
public enum MarkModeEnum {
    NONE(0, "无场景"),
    MARKETING(1, "营销模式"),
    ;
     MarkModeEnum(Integer c, String n){
        code = c;
        name = n;
    }
    private Integer code;
    private String name;
    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static MarkModeEnum getEnumWithCode(Integer c){
        for (MarkModeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static MarkModeEnum getEnumWithName(String name){
        for (MarkModeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
