package com.chenyang.nse.bussiness.enumeration.file;

public enum RowdeLimiter {
   LF("10", "\\n"),
   TAB("9", "\\t"),
   CR("13", "\\r");

   private String flag;
   private String name;

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

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

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

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

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

   public static String getFlag(String name) {
      for(RowdeLimiter f : values()) {
         if (f.getName().equals(name)) {
            return f.getFlag();
         }
      }

      return null;
   }

   public static String getName(String flag) {
      for(RowdeLimiter f : values()) {
         if (f.getFlag().equals(flag)) {
            return f.getName();
         }
      }

      return null;
   }
}
