| package com.zt.common.message.model; | 
|   | 
| public enum MessageType { | 
|   | 
|     INNER("inner", "内部消息"), | 
|     EMAIL("email", "邮件"), | 
|     SMS("sms", "短信"); | 
|   | 
|     private String key = ""; | 
|     private String title = ""; | 
|   | 
|     private MessageType(String key, String title) { | 
|         this.key = key; | 
|         this.title = title; | 
|     } | 
|   | 
|     public String getKey() { | 
|         return this.key; | 
|     } | 
|   | 
|     public void setKey(String key) { | 
|         this.key = key; | 
|     } | 
|   | 
|     public String getTitle() { | 
|         return this.title; | 
|     } | 
|   | 
|     public void setTitle(String title) { | 
|         this.title = title; | 
|     } | 
|   | 
|     public String toString() { | 
|         return this.key; | 
|     } | 
|   | 
|     public static MessageType fromKey(String key) { | 
|         for (MessageType c : MessageType.values()) { | 
|             if (c.getKey().equalsIgnoreCase(key)) { | 
|                 return c; | 
|             } | 
|         } | 
|         throw new IllegalArgumentException(key); | 
|     } | 
| } |