1 package com.netease.nimlib.sdk.v2.conversation.params;
3 import android.text.TextUtils;
6 import java.util.HashSet;
8 import java.util.Objects;
19 private List<V2NIMConversationType> conversationTypes = null;
23 private String conversationGroupId = null;
27 private boolean ignoreMuted =
false;
31 private Set<V2NIMConversationType> conversationTypeSet = null;
40 this.conversationTypes = types;
43 this.conversationTypeSet =
new HashSet<>(types);
52 this.conversationTypes = types;
55 this.conversationTypeSet =
new HashSet<>(types);
57 this.conversationGroupId = groupId;
66 this.conversationTypes = types;
69 this.conversationTypeSet =
new HashSet<>(types);
71 this.conversationGroupId = groupId;
72 this.ignoreMuted = ignoreMuted;
83 return conversationTypes;
91 if(CollectionUtil.isNotEmpty(conversationTypes) && CollectionUtil.isEmpty(conversationTypeSet))
93 conversationTypeSet =
new HashSet<>(conversationTypes);
95 return conversationTypeSet;
103 this.conversationTypes = conversationTypes;
111 return this.conversationGroupId;
119 this.conversationGroupId = conversationGroupId;
135 this.ignoreMuted = ignoreMuted;
147 return ignoreMuted == that.ignoreMuted && Objects.equals(conversationGroupId, that.conversationGroupId) && Objects.equals(
getConversationTypeSet(),
158 return "V2NIMConversationFilter{" +
"conversationTypes=" + conversationTypes +
", conversationGroupId='" + conversationGroupId +
'\'' 159 +
", ignoreMuted=" + ignoreMuted +
'}';
164 return !CollectionUtil.isEmpty(conversationTypes) || !TextUtils.isEmpty(conversationGroupId) || ignoreMuted;
168 if(CollectionUtil.isEmpty(conversationTypes) && TextUtils.isEmpty(conversationGroupId) && !ignoreMuted){
169 return "conversationTypes and conversationGroupId and ignoreMuted are all empty";
Set< V2NIMConversationType > getConversationTypeSet()
获取会话类型集合
List< V2NIMConversationType > getConversationTypes()
获取会话类型列表,为空表示查询所有类型,否则查询指定对话类型
boolean isIgnoreMuted()
获取是否忽略免打扰
void setIgnoreMuted(boolean ignoreMuted)
设置是否忽略免打扰
String getConversationGroupId()
获取会话分组id
V2NIMConversationFilter(List< V2NIMConversationType > types, String groupId, boolean ignoreMuted)
V2NIMConversationFilter(List< V2NIMConversationType > types, String groupId)
V2NIMConversationFilter(List< V2NIMConversationType > types)
void setConversationTypes(List< V2NIMConversationType > conversationTypes)
设置会话类型列表
void setConversationGroupId(String conversationGroupId)
设置会话分组id
V2NIMConversationFilter()