NIMSDK-AOS 10.4.0-beta
载入中...
搜索中...
未找到
QChatGenerateInviteCodeParam.java
浏览该文件的文档.
1package com.netease.nimlib.sdk.qchat.param;
2
3import androidx.annotation.Nullable;
4
5/**
6 * "生成邀请码接口" 入参
7 */
9 /**
10 * 服务器ID
11 */
12 private final long serverId;
13 /**
14 * 有效期(毫秒)
15 */
16 private Long ttl;
17
18 /**
19 * 构造函数
20 * @param serverId 服务器ID
21 */
22 public QChatGenerateInviteCodeParam(long serverId) {
23 this.serverId = serverId;
24 }
25
26 /**
27 * 获取服务器ID
28 */
29 public long getServerId() {
30 return serverId;
31 }
32
33 /**
34 * 设置有效期
35 * @param ttl 有效期(毫秒)
36 */
37 public void setTtl(@Nullable Long ttl) {
38 this.ttl = ttl;
39 }
40
41 /**
42 * 获取有效期(毫秒)
43 */
44 @Nullable
45 public Long getTtl() {
46 return ttl;
47 }
48
49 /**
50 * 参数是否合法
51 * @CJL/TODO: 校验是否合法
52 */
53 public boolean isValid() {
54 return serverId > 0;
55 }
56
57 @Override
58 public String toString() {
59 return "QChatGenerateInviteCodeParam{" +
60 "serverId=" + serverId +
61 ", ttl=" + ttl +
62 '}';
63 }
64}
boolean isValid()
参数是否合法 @CJL/TODO: 校验是否合法