1 5 package org.exoplatform.services.communication.sms.encoder; 6 7 11 public class MessageFormat { 12 13 public static final MessageFormat PLAIN_TEXT = new MessageFormat("Text"); 14 public static final MessageFormat RINGTONE = new MessageFormat("Ringtone"); 15 public static final MessageFormat OPERATOR_LOGO = new MessageFormat("Operator Logo"); 16 public static final MessageFormat CALLER_GROUP_GRAPHIC = new MessageFormat("Caller Group Graphic"); 17 public static final MessageFormat PICTURE = new MessageFormat("Picture"); 18 public static final MessageFormat VCARD = new MessageFormat("vCard"); 19 public static final MessageFormat VCALENDAR = new MessageFormat("vCalender"); 20 public static final MessageFormat RAW_BINARY_UDH = new MessageFormat("RawBinaryUDH"); 21 public static final MessageFormat UNICODE_TEXT = new MessageFormat("Unicode"); 22 23 private String p_format; 24 25 public MessageFormat(String format) { 26 p_format = format; 27 } 28 29 public String toString() { 30 return p_format; 31 } 32 33 public static MessageFormat parse(String format) { 34 MessageFormat mf = null; 35 if (format.equals(PLAIN_TEXT.toString())) mf = PLAIN_TEXT; 36 else if (format.equals(RINGTONE.toString())) mf = RINGTONE; 37 else if (format.equals(OPERATOR_LOGO.toString())) mf = OPERATOR_LOGO; 38 else if (format.equals(CALLER_GROUP_GRAPHIC.toString())) mf = CALLER_GROUP_GRAPHIC; 39 else if (format.equals(PICTURE.toString())) mf = PICTURE; 40 else if (format.equals(VCARD.toString())) mf = VCARD; 41 else if (format.equals(VCALENDAR.toString())) mf = VCALENDAR; 42 else if (format.equals(RAW_BINARY_UDH.toString())) mf = RAW_BINARY_UDH; 43 else if (format.equals(UNICODE_TEXT.toString())) mf = UNICODE_TEXT; 44 return mf; 45 } 46 47 } 48 49 | Popular Tags |