NIMSDK-AOS  9.19.0
PassthroughNotifyData.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.passthrough.model;
2 
3 import com.netease.nimlib.biz.constant.IPassThroughService;
4 import com.netease.nimlib.push.packet.marshal.Property;
5 
6 import java.io.Serializable;
7 
8 /**
9  * Created by hzsunyj on 2019-12-23.
10  */
11 public class PassthroughNotifyData implements Serializable {
12 
13  /**
14  * 发送方accid
15  */
16  private String fromAccid;
17 
18  /**
19  * 透传内容
20  */
21  private String body;
22 
23  /**
24  * 发送时间时间戳
25  */
26  private long time;
27 
28  public PassthroughNotifyData(String fromAccid, String body, long time) {
29  this.fromAccid = fromAccid;
30  this.body = body;
31  this.time = time;
32  }
33 
34 
35  public String getFromAccid() {
36  return fromAccid;
37  }
38 
39  public String getBody() {
40  return body;
41  }
42 
43  public long getTime() {
44  return time;
45  }
46 
47  public static PassthroughNotifyData fromProperty(Property property) {
48  if (property == null) {
49  return null;
50  }
51  String fromAccid = property.get(IPassThroughService.PassThroughMsgTag.fromAccid);
52  String body = property.get(IPassThroughService.PassThroughMsgTag.body);
53  long time = property.getLong(IPassThroughService.PassThroughMsgTag.time);
54  return new PassthroughNotifyData(fromAccid, body, time);
55  }
56 }
static PassthroughNotifyData fromProperty(Property property)