NIMSDK-AOS  10.9.80
V2NIMChatroomUpdateParams.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.chatroom.params;
2 
3 import java.io.Serializable;
4 
5 /**
6  * 聊天室信息更新参数
7  */
8 public class V2NIMChatroomUpdateParams implements Serializable {
9  /**
10  * 聊天室名称
11  * 为空表示不更新
12  * 不能为空串"", 返回参数错误
13  */
14  private String roomName;
15  /**
16  * 聊天室公告
17  * 为空表示不更新
18  */
19  private String announcement;
20  /**
21  * 聊天室直播地址
22  */
23  private String liveUrl;
24  /**
25  * 聊天室扩展字段
26  * 为空表示不更新
27  * 长度限制: 4096字节
28  */
29  private String serverExtension;
30  /**
31  * 是否需要通知
32  * 默认为true
33  */
34  private Boolean notificationEnabled;
35  /**
36  * 本次操作生成的通知中的扩展字段
37  */
38  private String notificationExtension;
39 
41  }
42 
43  /**
44  * 获取聊天室名称
45  * @return 聊天室名称
46  */
47  public String getRoomName() {
48  return roomName;
49  }
50 
51  /**
52  * 获取聊天室公告
53  * @return 聊天室公告
54  */
55  public String getAnnouncement() {
56  return announcement;
57  }
58 
59  /**
60  * 获取聊天室直播地址
61  * @return 聊天室直播地址
62  */
63  public String getLiveUrl() {
64  return liveUrl;
65  }
66 
67  /**
68  * 获取聊天室扩展字段
69  * @return 聊天室扩展字段
70  */
71  public String getServerExtension() {
72  return serverExtension;
73  }
74 
75  /**
76  * 是否需要通知
77  * @return true表示需要通知,false表示不需要通知
78  */
79  public boolean isNotificationEnabled() {
80  if(notificationEnabled == null) {
81  return true;
82  }
83  else {
84  return notificationEnabled;
85  }
86  }
87 
88  /**
89  * 获取本次操作生成的通知中的扩展字段
90  * @return 本次操作生成的通知中的扩展字段
91  */
92  public String getNotificationExtension() {
93  return notificationExtension;
94  }
95 
96  /**
97  * 设置聊天室名称
98  * @param roomName 聊天室名称
99  */
100  public void setRoomName(String roomName) {
101  this.roomName = roomName;
102  }
103 
104  /**
105  * 设置聊天室公告
106  * @param announcement 聊天室公告
107  */
108  public void setAnnouncement(String announcement) {
109  this.announcement = announcement;
110  }
111 
112  /**
113  * 设置聊天室直播地址
114  * @param liveUrl 聊天室直播地址
115  */
116  public void setLiveUrl(String liveUrl) {
117  this.liveUrl = liveUrl;
118  }
119 
120  /**
121  * 设置聊天室扩展字段
122  * @param serverExtension 聊天室扩展字段
123  */
124  public void setServerExtension(String serverExtension) {
125  this.serverExtension = serverExtension;
126  }
127 
128  /**
129  * 设置是否需要通知
130  * @param notificationEnabled 是否需要通知
131  */
132  public void setNotificationEnabled(boolean notificationEnabled) {
133  this.notificationEnabled = notificationEnabled;
134  }
135 
136  /**
137  * 设置本次操作生成的通知中的扩展字段
138  * @param notificationExtension 本次操作生成的通知中的扩展字段
139  */
140  public void setNotificationExtension(String notificationExtension) {
141  this.notificationExtension = notificationExtension;
142  }
143 
144  public boolean isValid() {
145  if(roomName != null && roomName.isEmpty()){
146  return false;
147  }
148  if(roomName != null){
149  return true;
150  }
151  if(announcement != null){
152  return true;
153  }
154  if(liveUrl != null){
155  return true;
156  }
157  if(serverExtension != null){
158  return true;
159  }
160  return false;
161  }
162 }
void setNotificationExtension(String notificationExtension)
设置本次操作生成的通知中的扩展字段
void setServerExtension(String serverExtension)
设置聊天室扩展字段
void setNotificationEnabled(boolean notificationEnabled)
设置是否需要通知
String getNotificationExtension()
获取本次操作生成的通知中的扩展字段