Esempio n. 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);
 }
Esempio n. 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);
 }