NIMSDK-AOS  10.9.90
V2NIMTeamClearJoinActionInfoOption.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.team.option;
2 
3 import com.netease.nimlib.report.utils.NtpTimeUtil;
5 
6 /**
7  * 清除加入群操作信息的选项类
8  */
10 
11  /**
12  * 时间戳,默认当前时间戳,会删除这个时间之前的所有记录
13  */
14  private long timestamp;
15  /**
16  * 群类型,默认全部
17  */
18  private V2NIMTeamJoinActionTeamType type;
19 
20  /**
21  * 默认构造函数
22  * 初始化时间戳为当前时间,群类型为全部
23  */
25  this.timestamp = NtpTimeUtil.getServerNow();
27  }
28 
29  /**
30  * 带参数的构造函数
31  * @param timestamp 时间戳
32  * @param type 群类型
33  */
35  setTimestamp(timestamp);
36  setType(type);
37  }
38 
39  /**
40  * 获取时间戳
41  * @return 时间戳
42  */
43  public long getTimestamp() {
44  return timestamp;
45  }
46 
47  /**
48  * 设置时间戳
49  * 如果设置的时间戳小于等于0,则使用当前时间戳
50  * @param timestamp 要设置的时间戳
51  */
52  public void setTimestamp(long timestamp) {
53  this.timestamp = timestamp;
54  if (this.timestamp <= 0) {
55  this.timestamp = NtpTimeUtil.getServerNow();
56  }
57  }
58 
59  /**
60  * 获取群类型
61  * @return 群类型
62  */
64  return type;
65  }
66 
67  /**
68  * 设置群类型
69  * 如果设置的群类型为null,则使用默认值(全部)
70  * @param type 要设置的群类型
71  */
73  this.type = type;
74  if (this.type == null) {
76  }
77  }
78 
79  /**
80  * 重写toString方法
81  * @return 返回对象的字符串表示
82  */
83  @Override
84  public String toString() {
85  final StringBuilder sb = new StringBuilder("V2NIMTeamClearJoinActionInfoOption{");
86  sb.append("timestamp=").append(timestamp);
87  sb.append(", type=").append(type);
88  sb.append('}');
89  return sb.toString();
90  }
91 }
V2NIMTeamClearJoinActionInfoOption(long timestamp, V2NIMTeamJoinActionTeamType type)
带参数的构造函数
V2NIMTeamClearJoinActionInfoOption()
默认构造函数 初始化时间戳为当前时间,群类型为全部
void setType(V2NIMTeamJoinActionTeamType type)
设置群类型 如果设置的群类型为null,则使用默认值(全部)
void setTimestamp(long timestamp)
设置时间戳 如果设置的时间戳小于等于0,则使用当前时间戳