// Path: src/main/java/cn/jmessage/api/common/model/IModel.java
// public interface IModel {
// 
//     public JsonElement toJSON();
// 
// }
// 
// Path: src/main/java/cn/jmessage/api/message/MessageType.java
// public enum MessageType {
//     TEXT("text"),
//     IMAGE("image"),
//     VOICE("voice"),
//     CUSTOM("custom");
// 
//     private String value;
// 
//     private MessageType(String value) {
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: src/main/java/cn/jmessage/api/utils/StringUtils.java
// public class StringUtils {
// 
// 	public static void checkUsername(String username) {
// 		if ( null == username || username.trim().length() == 0) {
// 			throw new IllegalArgumentException("username must not be empty");
// 		}
// 		if (username.contains("\n") || username.contains("\r") || username.contains("\t")) {
// 			throw new IllegalArgumentException("username must not contain line feed character");
// 		}
// 		byte[] usernameByte = username.getBytes();
// 		if (usernameByte.length < 4 || usernameByte.length > 128) {
// 			throw new IllegalArgumentException("The length of username must between 4 and 128 bytes. Input is " + username);
// 		}
// 		if (!ServiceHelper.checkUsername(username)) {
// 			throw new IllegalArgumentException("The parameter username contains illegal character," +
// 					" a-zA-Z_0-9.、-,@。 is legally, and start with alphabet or number. Input is " + username);
// 		}
// 	}
// 	
// 	public static void checkPassword(String password) {
// 		if (null == password || password.trim().length() == 0) {
// 			throw new IllegalArgumentException("password must not be empty");
// 		}
// 		
// 		byte[] passwordByte = password.getBytes();
// 		if (passwordByte.length < 4 || passwordByte.length > 128) {
// 			throw new IllegalArgumentException("The length of password must between 4 and 128 bytes. Input is " + password);
// 		}
// 		
// 	}
// 	
// 	public static boolean isNotEmpty(String s) {
//         return s != null && s.length() > 0;
//     }
// 	
// 	public static boolean isTrimedEmpty(String s) {
//         return s == null || s.trim().length() == 0;
//     }
// 	
// 	public static boolean isLineBroken(String s) {
// 		if (s.contains("\n") || s.contains("\r")) {
// 			return true;
// 		}
// 		return false;
// 	}
// 	
// }


import cn.jmessage.api.common.model.IModel;
import cn.jmessage.api.message.MessageType;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import cn.jiguang.common.utils.Preconditions;
import cn.jmessage.api.utils.StringUtils;
            return this;
        }
        
        public Builder setNoOffline(boolean noOffline) {
            this.mNoOffline = noOffline;
            return this;
        }
        
        public Builder setNoNotification(boolean noNotification) {
            this.mNoNotification = noNotification;
            return this;
        }

        public Builder setMessageType(MessageType msgType) {
            this.mMsgType = msgType;
            return this;
        }

        public Builder setMessageBody(MessageBody msgBody) {
            this.mMsgBody = msgBody;
            return this;
        }

        public Builder setNotification(Notification notification) {
            this.mNotification = notification;
            return this;
        }

        public MessagePayload build() {
            Preconditions.checkArgument(null != mVersion, "The version must not be empty!");
// Path: src/main/java/cn/jmessage/api/common/model/IModel.java
// public interface IModel {
// 
//     public JsonElement toJSON();
// 
// }
// 
// Path: src/main/java/cn/jmessage/api/message/MessageType.java
// public enum MessageType {
//     TEXT("text"),
//     IMAGE("image"),
//     VOICE("voice"),
//     CUSTOM("custom");
// 
//     private String value;
// 
//     private MessageType(String value) {
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: src/main/java/cn/jmessage/api/utils/StringUtils.java
// public class StringUtils {
// 
// 	public static void checkUsername(String username) {
// 		if ( null == username || username.trim().length() == 0) {
// 			throw new IllegalArgumentException("username must not be empty");
// 		}
// 		if (username.contains("\n") || username.contains("\r") || username.contains("\t")) {
// 			throw new IllegalArgumentException("username must not contain line feed character");
// 		}
// 		byte[] usernameByte = username.getBytes();
// 		if (usernameByte.length < 4 || usernameByte.length > 128) {
// 			throw new IllegalArgumentException("The length of username must between 4 and 128 bytes. Input is " + username);
// 		}
// 		if (!ServiceHelper.checkUsername(username)) {
// 			throw new IllegalArgumentException("The parameter username contains illegal character," +
// 					" a-zA-Z_0-9.、-,@。 is legally, and start with alphabet or number. Input is " + username);
// 		}
// 	}
// 	
// 	public static void checkPassword(String password) {
// 		if (null == password || password.trim().length() == 0) {
// 			throw new IllegalArgumentException("password must not be empty");
// 		}
// 		
// 		byte[] passwordByte = password.getBytes();
// 		if (passwordByte.length < 4 || passwordByte.length > 128) {
// 			throw new IllegalArgumentException("The length of password must between 4 and 128 bytes. Input is " + password);
// 		}
// 		
// 	}
// 	
// 	public static boolean isNotEmpty(String s) {
//         return s != null && s.length() > 0;
//     }
// 	
// 	public static boolean isTrimedEmpty(String s) {
//         return s == null || s.trim().length() == 0;
//     }
// 	
// 	public static boolean isLineBroken(String s) {
// 		if (s.contains("\n") || s.contains("\r")) {
// 			return true;
// 		}
// 		return false;
// 	}
// 	
// }


// Path: src/main/java/cn/jmessage/api/common/model/message/MessagePayload.java
import cn.jmessage.api.common.model.IModel;
import cn.jmessage.api.message.MessageType;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import cn.jiguang.common.utils.Preconditions;
import cn.jmessage.api.utils.StringUtils;

            return this;
        }
        
        public Builder setNoOffline(boolean noOffline) {
            this.mNoOffline = noOffline;
            return this;
        }
        
        public Builder setNoNotification(boolean noNotification) {
            this.mNoNotification = noNotification;
            return this;
        }

        public Builder setMessageType(MessageType msgType) {
            this.mMsgType = msgType;
            return this;
        }

        public Builder setMessageBody(MessageBody msgBody) {
            this.mMsgBody = msgBody;
            return this;
        }

        public Builder setNotification(Notification notification) {
            this.mNotification = notification;
            return this;
        }

        public MessagePayload build() {
            Preconditions.checkArgument(null != mVersion, "The version must not be empty!");
            Preconditions.checkArgument(StringUtils.isNotEmpty(mTargetType), "The target type must not be empty!");