View Javadoc
1   package com.foxinmy.weixin4j.qy.model;
2   
3   import java.io.Serializable;
4   import java.util.Arrays;
5   import java.util.List;
6   
7   import com.alibaba.fastjson.annotation.JSONField;
8   
9   /**
10   * 聊天会话信息
11   * 
12   * @className ChatInfo
13   * @author jinyu(foxinmy@gmail.com)
14   * @date 2015年7月31日
15   * @since JDK 1.6
16   * @see
17   */
18  public class ChatInfo implements Serializable {
19  
20  	private static final long serialVersionUID = 1899784347096501375L;
21  	/**
22  	 * 会话id
23  	 */
24  	@JSONField(name = "chatid")
25  	private String chatId;
26  	/**
27  	 * 会话标题
28  	 */
29  	private String name;
30  	/**
31  	 * 管理员userid
32  	 */
33  	private String owner;
34  	/**
35  	 * 会话成员列表
36  	 */
37  	@JSONField(name = "userlist")
38  	private List<String> members;
39  
40  	protected ChatInfo() {
41  
42  	}
43  
44  	public ChatInfo(String chatId) {
45  		this.chatId = chatId;
46  	}
47  
48  	public ChatInfo(String name, String owner, String... members) {
49  		this.name = name;
50  		this.owner = owner;
51  		this.members = Arrays.asList(members);
52  	}
53  
54  	public String getChatId() {
55  		return chatId;
56  	}
57  
58  	public String getName() {
59  		return name;
60  	}
61  
62  	public String getOwner() {
63  		return owner;
64  	}
65  
66  	public List<String> getMembers() {
67  		return members;
68  	}
69  
70  	public void setMembers(List<String> members) {
71  		this.members = members;
72  	}
73  
74  	public void setMembers(String... members) {
75  		this.members = Arrays.asList(members);
76  	}
77  
78  	// ---------- setter 应该全部去掉
79  
80  	public void setChatId(String chatId) {
81  		this.chatId = chatId;
82  	}
83  
84  	public void setName(String name) {
85  		this.name = name;
86  	}
87  
88  	public void setOwner(String owner) {
89  		this.owner = owner;
90  	}
91  
92  	@Override
93  	public String toString() {
94  		return "ChatInfo [chatId=" + chatId + ", name=" + name + ", owner="
95  				+ owner + ", members=" + members + "]";
96  	}
97  }