package com.chenyang.nse.bussiness.enumeration;

public enum EroleFlag {
   USER("1", "core", "前台用户"),
   CONSOLE("0", "console", "后台用户");

   private String flag;
   private String code;
   private String name;

   private EroleFlag(String flag, String code, String name) {
      this.flag = flag;
      this.code = code;
      this.name = name;
   }

   public String getFlag() {
      return this.flag;
   }

   public void setFlag(String flag) {
      this.flag = flag;
   }

   public String getCode() {
      return this.code;
   }

   public void setCode(String code) {
      this.code = code;
   }

   public String getName() {
      return this.name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public static EroleFlag getEroleFlagByFlag(String flag) {
      EroleFlag[] ef = values();

      for(EroleFlag eroleFlag : ef) {
         String f = eroleFlag.getFlag();
         if (f.equals(flag)) {
            return eroleFlag;
         }
      }

      return null;
   }
}
