NIMSDK-AOS  10.9.80
V2NIMChatroomMessageConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.chatroom.config;
2 
3 import java.io.Serializable;
4 
5 /**
6  * 聊天室消息相关配置
7  */
8 public class V2NIMChatroomMessageConfig implements Serializable {
9 
10  /**
11  * 是否需要在服务端保存历史消息
12  */
13  private Boolean historyEnabled;
14  /**
15  * 是否是高优先级消息
16  */
17  private Boolean highPriority;
18 
20  }
21 
22  /**
23  *
24  * @param historyEnabled 是否需要在服务端保存历史消息
25  */
26  public V2NIMChatroomMessageConfig(Boolean historyEnabled) {
27  this.historyEnabled = historyEnabled;
28  }
29 
30  /**
31  * 获取是否是高优先级消息
32  * @return 是否是高优先级消息
33  */
34  public boolean isHighPriority() {
35  if(highPriority == null) {
36  return false;
37  }
38  return highPriority;
39  }
40 
41  /**
42  * 设置是否是高优先级消息
43  * @param highPriority 是否是高优先级消息
44  */
45  public void setHighPriority(Boolean highPriority) {
46  this.highPriority = highPriority;
47  }
48 
49  /**
50  * 获取是否需要在服务端保存历史消息, 默认为true
51  * @return 是否需要在服务端保存历史消息
52  */
53  public boolean isHistoryEnabled() {
54  if(historyEnabled == null) {
55  return true;
56  }
57  return historyEnabled;
58  }
59 
60  /**
61  * 设置是否需要在服务端保存历史消息
62  * @param historyEnabled 是否需要在服务端保存历史消息
63  */
64  public void setHistoryEnabled(boolean historyEnabled) {
65  this.historyEnabled = historyEnabled;
66  }
67 }
void setHighPriority(Boolean highPriority)
设置是否是高优先级消息
void setHistoryEnabled(boolean historyEnabled)
设置是否需要在服务端保存历史消息
boolean isHistoryEnabled()
获取是否需要在服务端保存历史消息, 默认为true