package com.qiuguo.iot.base.enums;

/*
* 声音类型
* 作者：吴林
* */
// 0：系统内置 1：指定声音
public enum SoundTypeEnum {
    INNER(0, "系统内置"),
    APPOINT(1, "指定的"),
    ;
     SoundTypeEnum(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 SoundTypeEnum getEnumWithCode(Integer c){
        for (SoundTypeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static SoundTypeEnum getEnumWithName(String name){
        for (SoundTypeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
