NIMSDK-AOS  10.5.0
SessionMsgDeleteOption.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.msg.model;
2 
3 import com.netease.nimlib.biz.constant.ITalkService;
4 import com.netease.nimlib.push.packet.marshal.Property;
6 
7 public class SessionMsgDeleteOption {
9  private String sessionId;
11  private SessionTypeEnum sessionType;
13  private long time;
15  private String ext;
16 
17  public SessionMsgDeleteOption(String sessionId, SessionTypeEnum sessionType, long time, String ext) {
18  this.sessionId = sessionId;
19  this.sessionType = sessionType;
20  this.time = time;
21  this.ext = ext;
22  }
23 
31  public static SessionMsgDeleteOption fromProperty(Property property) {
32  String type = property.get(ITalkService.SessionHistoryMsgsDeleteTag.TYPE);
33  SessionTypeEnum sessionType;
34  String sessionId;
35  if ("2".equals(type)) {
36  sessionType = SessionTypeEnum.Team;
37  sessionId = property.get(ITalkService.SessionHistoryMsgsDeleteTag.TO_TID);
38  } else if ("3".equals(type)) {
39  sessionType = SessionTypeEnum.SUPER_TEAM;
40  sessionId = property.get(ITalkService.SessionHistoryMsgsDeleteTag.TO_TID);
41  } else {
42  sessionType = SessionTypeEnum.P2P;
43  sessionId = property.get(ITalkService.SessionHistoryMsgsDeleteTag.OTHER_ACCID);
44  }
45  long time = property.getLong(ITalkService.SessionHistoryMsgsDeleteTag.TIME);
46  String ext = property.get(ITalkService.SessionHistoryMsgsDeleteTag.EXT);
47 
48  return new SessionMsgDeleteOption(sessionId, sessionType, time, ext);
49  }
50 
51  public String getSessionId() {
52  return sessionId;
53  }
54 
56  return sessionType;
57  }
58 
59  public long getTime() {
60  return time;
61  }
62 
63  public String getExt() {
64  return ext;
65  }
66 }
static SessionMsgDeleteOption fromProperty(Property property)
通过Property生成实例
SessionMsgDeleteOption(String sessionId, SessionTypeEnum sessionType, long time, String ext)