NIMSDK-AOS  10.5.0
TeamMsgAckInfo.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.msg.model;
2 
3 import com.netease.nimlib.util.CollectionUtil;
4 
5 import java.util.ArrayList;
6 import java.util.List;
7 import java.util.Set;
8 
15 public class TeamMsgAckInfo {
16  private final String teamId;
17  private final String msgId;
18  private final String messageServerId;
20  private String newReaderAccount;
21  private int ackCount;
22  private int unAckCount;
23  private List<String> ackAccountList;
24  private List<String> unAckAccountList;
25 
26  public TeamMsgAckInfo(String teamId, String msgId, String messageServerId, int ackCount, int unAckCount) {
27  this(teamId, msgId, messageServerId, ackCount, unAckCount, null);
28  }
29 
30  public TeamMsgAckInfo(String teamId, String msgId, String messageServerId, int ackCount, int unAckCount, String newReaderAccount) {
31  this.teamId = teamId;
32  this.msgId = msgId;
33  this.messageServerId = messageServerId;
34  this.ackCount = ackCount;
35  this.unAckCount = unAckCount;
36  this.newReaderAccount = newReaderAccount;
37  }
38 
39  public TeamMsgAckInfo(String teamId, String msgId, String messageServerId, List<String> ackAccountList, List<String> unAckAccountList) {
40  this.teamId = teamId;
41  this.msgId = msgId;
42  this.messageServerId = messageServerId;
43  this.ackAccountList = ackAccountList;
44  this.unAckAccountList = unAckAccountList;
45  }
46 
47  public String getTeamId() {
48  return teamId;
49  }
50 
51 
52 
53  public String getMsgId() {
54  return msgId;
55  }
56 
57  public String getMessageServerId() {
58  return messageServerId;
59  }
60 
61  public int getAckCount() {
62  if (ackAccountList != null) {
63  return ackAccountList.size();
64  }
65 
66  return ackCount;
67  }
68 
69  public int getUnAckCount() {
70  if (unAckAccountList != null) {
71  return unAckAccountList.size();
72  }
73 
74  return unAckCount;
75  }
76 
77  public String getNewReaderAccount() {
78  return newReaderAccount;
79  }
80 
81  public List<String> getAckAccountList() {
82  return ackAccountList;
83  }
84 
85  public List<String> getUnAckAccountList() {
86  return unAckAccountList;
87  }
88 
96  public TeamMsgAckInfo newInstanceFromPartOfAccount(Set<String> accountSet) {
97  // 不含有用户ID列表,直接返回null
98  if (CollectionUtil.isEmpty(ackAccountList) && CollectionUtil.isEmpty(unAckAccountList)) {
99  return null;
100  }
101 
102  // 指定用户集为空,返回带空列表的示例
103  if (CollectionUtil.isEmpty(accountSet)) {
104  return new TeamMsgAckInfo(teamId, msgId, messageServerId, new ArrayList<>(0), new ArrayList<>(0));
105  }
106 
107  List<String> chosenAckList = CollectionUtil.findAll(this.ackAccountList, accountSet::contains);
108  List<String> chosenUnAckList = CollectionUtil.findAll(this.unAckAccountList, accountSet::contains);
109  return new TeamMsgAckInfo(teamId, msgId, messageServerId, chosenAckList, chosenUnAckList);
110  }
111 }
TeamMsgAckInfo(String teamId, String msgId, String messageServerId, int ackCount, int unAckCount, String newReaderAccount)
TeamMsgAckInfo(String teamId, String msgId, String messageServerId, List< String > ackAccountList, List< String > unAckAccountList)
TeamMsgAckInfo newInstanceFromPartOfAccount(Set< String > accountSet)
生成一个新的实例,里面只包含指定用户的已读未读情况 如果当前实例中不含用户列表,直接返回null ...
群已读回执信息 此类有两种状态,一种是存储已读未读用户账号列表的状态,一种是存储已读未读人数的状态 第...
TeamMsgAckInfo(String teamId, String msgId, String messageServerId, int ackCount, int unAckCount)