NIMSDK-AOS  9.21.15
QChatJoinByInviteCodeParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import androidx.annotation.Nullable;
4 
5 /**
6  * "通过邀请码加入服务器接口" 入参
7  */
9  /**
10  * 服务器ID
11  */
12  private final long serverId;
13  /**
14  * 邀请码
15  */
16  private final String inviteCode;
17  /**
18  * 附言
19  */
20  private String postscript;
21 
22  /**
23  *
24  * @param serverId 服务器ID
25  * @param inviteCode 邀请码
26  */
27  public QChatJoinByInviteCodeParam(long serverId, String inviteCode) {
28  this.serverId = serverId;
29  this.inviteCode = inviteCode;
30  }
31 
32  /**
33  * 获取服务器ID
34  */
35  public long getServerId() {
36  return serverId;
37  }
38 
39  /**
40  * 获取邀请码
41  */
42  public String getInviteCode() {
43  return inviteCode;
44  }
45 
46  /**
47  * 设置邀请码
48  * @param postscript 邀请码
49  */
50  public void setPostscript(@Nullable String postscript) {
51  this.postscript = postscript;
52  }
53 
54  /**
55  * 获取附言
56  */
57  public String getPostscript() {
58  return postscript;
59  }
60 
61  /**
62  * 参数是否合法
63  */
64  public boolean isValid() {
65  return serverId > 0;
66  }
67 
68  @Override
69  public String toString() {
70  return "QChatJoinByInviteCodeParam{" +
71  "serverId=" + serverId +
72  ", inviteCode='" + inviteCode + '\'' +
73  ", postscript='" + postscript + '\'' +
74  '}';
75  }
76 }
void setPostscript(@Nullable String postscript)
设置邀请码