예제 #1
0
 public static boolean containsField(String fieldName) {
   IbidianClickEnum[] fields = IbidianClickEnum.values();
   Set<String> fieldsSet = new HashSet<String>();
   for (IbidianClickEnum ibidianClickEnum : fields) {
     fieldsSet.add(ibidianClickEnum.name());
   }
   return fieldsSet.contains(fieldName);
 }
예제 #2
0
 public static int getFieldOrder(String fieldName) throws CustomEnumFieldNotFoundException {
   IbidianClickEnum[] fields = IbidianClickEnum.values();
   for (IbidianClickEnum singleEnum : fields) {
     if (fieldName.equals(singleEnum.name())) {
       return singleEnum.ordinal();
     }
   }
   throw new CustomEnumFieldNotFoundException(IbidianClickEnum.class.getName(), fieldName);
 }