package com.demo.constant;

public enum  OSEnum {
    IOS("ios"),
    ANDROID("android");

    OSEnum(String val) {
        this.val = val;
    }

    /**
     * 根据传入的os获取对应枚举
     * @param os
     * @return
     */
    public static OSEnum getOS(String os){
        os = os.toLowerCase();
       for(OSEnum osEnum : OSEnum.values()) {
           if(os.equals(osEnum.getVal())){
               return osEnum;
           }
       }
       return  null;
    }

    private String val;

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }
}
