View Javadoc
1   package com.foxinmy.weixin4j.tuple;
2   
3   import com.alibaba.fastjson.annotation.JSONCreator;
4   import com.alibaba.fastjson.annotation.JSONField;
5   
6   /**
7    * 文本对象
8    * <p>
9    * <font color="red">可用于「客服消息」「群发消息」及企业号的「聊天消息」</font>
10   * </p>
11   * 
12   * @className Text
13   * @author jinyu(foxinmy@gmail.com)
14   * @date 2014年9月29日
15   * @since JDK 1.6
16   * @see
17   */
18  public class Text implements MassTuple, NotifyTuple, ChatTuple {
19  
20  	private static final long serialVersionUID = 520050144519064503L;
21  
22  	@Override
23  	public String getMessageType() {
24  		return "text";
25  	}
26  
27  	/**
28  	 * 内容
29  	 */
30  	private String content;
31  
32  	@JSONCreator
33  	public Text(@JSONField(name = "content") String content) {
34  		this.content = content;
35  	}
36  
37  	public String getContent() {
38  		return content;
39  	}
40  
41  	@Override
42  	public String toString() {
43  		return "Text [content=" + content + "]";
44  	}
45  }