public static MessageTypeEnum fromTextId(String id) {
   for (MessageTypeEnum anEnum : values()) {
     if (anEnum.getTextId().equalsIgnoreCase(id)) {
       return anEnum;
     }
   }
   return null;
 }
Exemplo n.º 2
0
 /**
  * [像下拉菜单内容一样获取]
  *
  * @return
  */
 public static String getAsDropDownOption() {
   String str = null;
   str += "<option value='unselected'>未选择</option>";
   for (MessageTypeEnum e : MessageTypeEnum.values()) {
     str += "<option value='" + e.getCode() + "'>" + e.getMsg() + "</option>";
   }
   return str;
 }
Exemplo n.º 3
0
 /**
  * [根据代码获取对应的描述]
  *
  * @param code
  * @return
  */
 public static String getMsgByCode(String code) {
   String str = null;
   for (MessageTypeEnum e : MessageTypeEnum.values()) {
     if (e.getCode().equals(code)) {
       str = e.getMsg();
       break;
     }
   }
   return str;
 }