package com.qiuguo.iot.base.enums;

/*
* 动作类型
* 作者：吴林
* */
// 动作类型：0：文本播放 1音频播放 2 U3D动作 3物联网设备动作
public enum TimeKeyEnum {
    TODAY(0, "今天"),
    YESTERDAY(1, "昨天"),
    TOMORROW(2, "明天"),
    ACQUIRED(3, "后天"),
    ;
     TimeKeyEnum(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 TimeKeyEnum getEnumWithCode(Integer c){
        for (TimeKeyEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static TimeKeyEnum getEnumWithName(String name){
        for (TimeKeyEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
