Exemplo n.º 1
0
 public static NewsCardType fromIndex(int index) {
   for (NewsCardType type : NewsCardType.values()) {
     if (type.index == index) {
       return type;
     }
   }
   return NORMAL;
 }
Exemplo n.º 2
0
 public static NewsCardType fromName(String name) {
   for (NewsCardType type : NewsCardType.values()) {
     if (type.name.equalsIgnoreCase(name)) {
       return type;
     }
   }
   return NORMAL;
 }