NIMSDK-AOS  10.9.50
V2NIMProxyNotify.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.passthrough.model;
2 
3 import com.netease.nimlib.log.NimLog;
4 import com.netease.nimlib.util.EncryptUtil;
5 import java.io.Serializable;
6 
7 /**
8  * 透传下行数据
9  */
10 public class V2NIMProxyNotify implements Serializable {
11  /**
12  * 发送方账号
13  */
14  private final String fromAccountId;
15 
16  /**
17  * 通知体
18  */
19  private final String body;
20  /**
21  * 发送时间, 毫秒
22  */
23  private final long time;
24 
25  /**
26  * 构造函数
27  * @param fromAccountId 发送方账号
28  * @param body 通知体
29  * @param time 发送时间, 毫秒
30  */
31  public V2NIMProxyNotify(String fromAccountId, String body, long time) {
32  this.fromAccountId = fromAccountId;
33  this.body = body;
34  this.time = time;
35  }
36 
37 
38  private V2NIMProxyNotify(){
39  this.fromAccountId = null;
40  this.body = null;
41  this.time = 0;
42  }
43  /**
44  * 获取发送方账号
45  * @return fromAccountId 发送方账号
46  */
47  public String getFromAccountId() {
48  return fromAccountId;
49  }
50 
51  /**
52  * 获取body
53  * @return body 通知体
54  */
55  public String getBody() {
56  return body;
57  }
58  /**
59  * 获取发送时间, 毫秒
60  * @return time 发送时间, 毫秒
61  */
62  public long getTime() {
63  return time;
64  }
65 
66  @Override
67  public String toString() {
68  if (NimLog.isDebugLog()) {
69  final StringBuilder sb = new StringBuilder("V2NIMProxyNotify{");
70  sb.append("fromAccountId='").append(fromAccountId).append('\'');
71  sb.append(", body='").append(body).append('\'');
72  sb.append(", time=").append(time);
73  sb.append('}');
74  return sb.toString();
75  }else {
76  final StringBuilder sb = new StringBuilder("V2NIMProxyNotify{");
77  sb.append("fromAccountId='").append(fromAccountId).append('\'');
78  sb.append(", body='").append(EncryptUtil.encryptBase64(body)).append('\'');
79  sb.append(", time=").append(time);
80  sb.append('}');
81  return sb.toString();
82  }
83 
84  }
85 }
V2NIMProxyNotify(String fromAccountId, String body, long time)
构造函数