NIMSDK-AOS  9.19.0
JoinAndAcceptParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.avsignalling.model;
2 
5 
6 public class JoinAndAcceptParam {
7  private final String channelId;
8  private final String accountId;
9  private final String requestId;
10 
11  private Long selfUid;
12  private Boolean offlineEnable;
13  private String customInfo;
14  private String nertcChannelName;
15  private Long nertcTokenTtl;
16  private String nertcJoinRoomQueryParamMap;
17 
18  private JoinAndAcceptParam(String channelId, String accountId, String requestId) {
19  this.channelId = channelId;
20  this.accountId = accountId;
21  this.requestId = requestId;
22  }
23 
24  /**
25  * 获取频道id
26  */
27  public String getChannelId() {
28  return channelId;
29  }
30 
31  /**
32  * 获取对方帐号id
33  */
34  public String getAccountId() {
35  return accountId;
36  }
37 
38  /**
39  * 获取本次邀请的唯一标识
40  */
41  public String getRequestId() {
42  return requestId;
43  }
44 
45  /**
46  * 获取自己的uid
47  */
48  public Long getSelfUid() {
49  return selfUid;
50  }
51 
52  /**
53  * 相应的通知是否存离线
54  */
55  public Boolean getOfflineEnable() {
56  return offlineEnable;
57  }
58 
59  /**
60  * 获取附加的自定义信息
61  */
62  public String getCustomInfo() {
63  return customInfo;
64  }
65 
66  /**
67  * 获取云信G2-RTC的房间名
68  */
69  public String getNertcChannelName() {
70  return nertcChannelName;
71  }
72 
73  /**
74  * 获取云信G2-RTC的token的有效期,单位秒,选填,默认10分钟
75  */
76  public Long getNertcTokenTtl() {
77  return nertcTokenTtl;
78  }
79 
80  /**
81  * 获取云信G2-RTC加入房间的请求参数,可转化为json的字符串
82  */
84  return nertcJoinRoomQueryParamMap;
85  }
86 
87  public static final class JoinAndAcceptParamBuilder {
88  private final String channelId;
89  private final String accountId;
90  private final String requestId;
91  private Long selfUid;
92  private Boolean offlineEnable;
93  private String customInfo;
94  private String nertcChannelName;
95  private Long nertcTokenTtl;
96  private String nertcJoinRoomQueryParamMap;
97 
98  /**
99  * @param channelId 频道id
100  * @param accountId 对方帐号id。
101  * eg : 邀请与取消邀请时填被邀请人id ,拒绝邀请与接受邀请时填邀请人id
102  * @param requestId 对本次邀请的唯一标识。<br/>
103  * 发起邀请者需要自行生成(要保证唯一性,不同的邀不能用同一个id),取消邀请时需要传入同一个requestId。<br/>
104  * 对于接收方 , requestId可以在收到相应通知时获取,参考{@link InvitedEvent#getRequestId()}和{@link CanceledInviteEvent#getRequestId()}
105  */
106  public JoinAndAcceptParamBuilder(String channelId, String accountId, String requestId) {
107  this.channelId = channelId;
108  this.accountId = accountId;
109  this.requestId = requestId;
110  }
111 
112  /**
113  * 指定自己的uid
114  */
115  public JoinAndAcceptParamBuilder withSelfUid(Long selfUid) {
116  this.selfUid = selfUid;
117  return this;
118  }
119 
120  /**
121  * 指定相应的通知是否存离线
122  */
123  public JoinAndAcceptParamBuilder withOfflineEnable(Boolean offlineEnable) {
124  this.offlineEnable = offlineEnable;
125  return this;
126  }
127 
128  /**
129  * 指定附加的自定义信息
130  */
131  public JoinAndAcceptParamBuilder withCustomInfo(String customInfo) {
132  this.customInfo = customInfo;
133  return this;
134  }
135 
136  /**
137  * 指定云信G2-RTC的房间名
138  */
139  public JoinAndAcceptParamBuilder withNertcChannelName(String nertcChannelName) {
140  this.nertcChannelName = nertcChannelName;
141  return this;
142  }
143 
144  /**
145  * 指定云信G2-RTC的token的有效期,单位秒,选填,默认10分钟
146  */
147  public JoinAndAcceptParamBuilder withNertcTokenTtl(Long nertcTokenTtl) {
148  this.nertcTokenTtl = nertcTokenTtl;
149  return this;
150  }
151 
152  /**
153  * 指定云信G2-RTC加入房间的请求参数,可转化为json的字符串
154  */
155  public JoinAndAcceptParamBuilder withNertcJoinRoomQueryParamMap(String nertcJoinRoomQueryParamMap) {
156  this.nertcJoinRoomQueryParamMap = nertcJoinRoomQueryParamMap;
157  return this;
158  }
159 
160  public JoinAndAcceptParam build() {
161  JoinAndAcceptParam joinAndAcceptParam = new JoinAndAcceptParam(this.channelId, this.accountId, this.requestId);
162  joinAndAcceptParam.nertcTokenTtl = this.nertcTokenTtl;
163  joinAndAcceptParam.nertcJoinRoomQueryParamMap = this.nertcJoinRoomQueryParamMap;
164  joinAndAcceptParam.selfUid = this.selfUid;
165  joinAndAcceptParam.nertcChannelName = this.nertcChannelName;
166  joinAndAcceptParam.customInfo = this.customInfo;
167  joinAndAcceptParam.offlineEnable = this.offlineEnable;
168  return joinAndAcceptParam;
169  }
170  }
171 }
String getNertcJoinRoomQueryParamMap()
获取云信G2-RTC加入房间的请求参数,可转化为json的字符串
String getRequestId()
获取本次邀请的唯一标识
String getNertcChannelName()
获取云信G2-RTC的房间名
Boolean getOfflineEnable()
相应的通知是否存离线
Long getNertcTokenTtl()
获取云信G2-RTC的token的有效期,单位秒,选填,默认10分钟