public final class GroupChannelListQuery
extends java.lang.Object
GroupChannel list for the current User.
Currently, 1 kind of GroupChannel list can be queried.
GroupChannels the current User is a member of.
The query can be get by calling GroupChannel.createMyGroupChannelListQuery().
| Modifier and Type | Class and Description |
|---|---|
static interface |
GroupChannelListQuery.GroupChannelListQueryResultHandler
GroupChannelListQuery handler.
|
static class |
GroupChannelListQuery.HiddenChannelFilter
The hidden channel filter.
|
static class |
GroupChannelListQuery.MemberState
Deprecated.
As of 3.0.37, replaced by
GroupChannel.MemberState. |
static class |
GroupChannelListQuery.MemberStateFilter
The member state filter.
|
static class |
GroupChannelListQuery.Order
The query result order type.
|
static class |
GroupChannelListQuery.PublicChannelFilter
The public channel filter.
|
static class |
GroupChannelListQuery.QueryType
The query type for currently supported only with
setUserIdsIncludeFilter(List, QueryType). |
static class |
GroupChannelListQuery.SearchField
Fields of
GroupChannel that are used in search filter. |
static class |
GroupChannelListQuery.SuperChannelFilter
The super channel filter.
|
static class |
GroupChannelListQuery.UnreadChannelFilter
The unread channel filter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
belongsTo(GroupChannel channel)
Verify that the given channel information matches the current query filter.
|
static GroupChannelListQuery |
buildFromSerializedData(byte[] data)
Builds
GroupChannelListQuery instance from serialized data generated by serialize(). |
java.lang.String |
getChannelNameContainsFilter()
Returns channel name filter.
|
java.util.List<java.lang.String> |
getChannelUrlsFilter()
Returns list of channel URL filter.
|
java.util.List<java.lang.String> |
getCustomTypesFilter()
Returns list of custom type filter.
|
java.lang.String |
getCustomTypeStartsWithFilter()
Returns a filter to return channels that start with the specified Custom Type.
|
GroupChannelListQuery.HiddenChannelFilter |
getHiddenChannelFilter()
Returns hidden channel filter.
|
int |
getLimit()
Returns the maximum number of
GroupChannels per page. |
GroupChannelListQuery.MemberStateFilter |
getMemberStateFilter()
Returns a filter to return channels with the current
User state matching to GroupChannelListQuery.MemberStateFilter. |
java.lang.String |
getMetaDataKey() |
java.lang.String |
getMetaDataOrderKeyFilter()
Returns meta data order key filter.
|
java.util.List<java.lang.String> |
getMetaDataValues() |
java.lang.String |
getMetaDataValueStartsWith() |
java.lang.String |
getNicknameContainsFilter()
Returns nickname filter.
|
GroupChannelListQuery.Order |
getOrder()
Returns result order of channels.
|
GroupChannelListQuery.PublicChannelFilter |
getPublicChannelFilter()
Returns public channel filter.
|
java.util.List<GroupChannelListQuery.SearchField> |
getSearchFields()
Returns search fields.
|
java.lang.String |
getSearchQuery()
Returns query string.
|
GroupChannelListQuery.SuperChannelFilter |
getSuperChannelFilter()
Returns super channel filter.
|
GroupChannelListQuery.UnreadChannelFilter |
getUnreadChannelFilter()
Returns unread channel filter.
|
java.util.List<java.lang.String> |
getUserIdsExactFilter()
Returns
User IDs exact filter. |
java.util.List<java.lang.String> |
getUserIdsIncludeFilter()
Returns
User IDs include filter. |
GroupChannelListQuery.QueryType |
getUserIdsIncludeFilterQueryType()
Returns
QueryType of User IDs filter. |
boolean |
hasNext()
Checks if there is a next page.
|
boolean |
isIncludeEmpty()
Checks whether query result includes empty channels.
|
boolean |
isIncludeFrozen()
Checks whether query result includes frozen channels.
|
boolean |
isIncludeMetadata() |
boolean |
isLoading()
Checks if the current query is in communication progress with server.
|
void |
next(GroupChannelListQuery.GroupChannelListQueryResultHandler handler)
Gets the list of
GroupChannels. |
byte[] |
serialize()
Serializes the
GroupChannelListQuery instance. |
void |
setChannelNameContainsFilter(java.lang.String channelName)
Sets channel name filter.
|
void |
setChannelUrlsFilter(java.util.List<java.lang.String> channelUrls)
Sets with given channel URLs.
|
void |
setCustomTypeFilter(java.lang.String customType)
Deprecated.
As of 3.0.47, replaced by
setCustomTypesFilter(List). |
void |
setCustomTypesFilter(java.util.List<java.lang.String> customTypes)
Sets with given channel custom types.
|
void |
setCustomTypeStartsWithFilter(java.lang.String customType)
Sets a filter to return channels that start with the specified Custom Type.
|
void |
setHiddenChannelFilter(GroupChannelListQuery.HiddenChannelFilter hiddenChannelFilter)
Sets hidden channel filter.
|
void |
setIncludeEmpty(boolean includeEmpty)
Sets
true/false to include empty channels or not (channels without messages). |
void |
setIncludeFrozen(boolean includeFrozen)
Sets
true/false to include frozen channels or not. |
void |
setIncludeMetadata(boolean includeMetadata)
Sets whether to include channel metadata on fetch.
|
void |
setLimit(int limit)
Sets the maximum number of
GroupChannels per queried page. |
void |
setMemberStateFilter(GroupChannel.MemberState memberState)
Deprecated.
As of 3.0.52, replaced by
setMemberStateFilter(MemberStateFilter). |
void |
setMemberStateFilter(GroupChannelListQuery.MemberState memberState)
Deprecated.
As of 3.0.37, replaced by
setMemberStateFilter(GroupChannel.MemberState). |
void |
setMemberStateFilter(GroupChannelListQuery.MemberStateFilter memberStateFilter)
Sets a filter to return channels with the current
User state matching to GroupChannelListQuery.MemberStateFilter. |
void |
setMetaDataOrderKeyFilter(java.lang.String metaDataOrderKey)
Sets meta data order key filter.
|
void |
setMetaDataValuesFilter(java.lang.String metaDataKey,
java.util.List<java.lang.String> metaDataValues)
Sets
Channel meta data filter. |
void |
setMetaDataValueStartsWithFilter(java.lang.String metaDataKey,
java.lang.String metaDataValueStartsWith)
Sets
Channel meta data filter. |
void |
setNicknameContainsFilter(java.lang.String nickname)
Sets nickname filter.
|
void |
setOrder(GroupChannelListQuery.Order order)
Sets result order of channels.
|
void |
setPublicChannelFilter(GroupChannelListQuery.PublicChannelFilter publicChannelFilter)
Sets public channel filter.
|
void |
setSearchFilter(java.util.List<GroupChannelListQuery.SearchField> searchFields,
java.lang.String query)
Sets 'Search' filter.
|
void |
setSuperChannelFilter(GroupChannelListQuery.SuperChannelFilter superChannelFilter)
Sets super channel filter.
|
void |
setUnreadChannelFilter(GroupChannelListQuery.UnreadChannelFilter unreadChannelFilter)
Sets unread channel filter.
|
void |
setUserIdsExactFilter(java.util.List<java.lang.String> userIds)
Sets
User IDs filter. |
void |
setUserIdsFilter(java.util.List<java.lang.String> userIds,
boolean exactMatch)
Deprecated.
As of 3.0.9, replaced by
setUserIdsIncludeFilter(List, QueryType) and setUserIdsExactFilter(List). |
void |
setUserIdsIncludeFilter(java.util.List<java.lang.String> userIds,
GroupChannelListQuery.QueryType queryType)
Sets
User IDs filter. |
public int getLimit()
GroupChannels per page.GroupChannels per page.public void setLimit(int limit)
GroupChannels per queried page.limit - The maximum number of GroupChannels per page.public boolean isIncludeEmpty()
public void setIncludeEmpty(boolean includeEmpty)
true/false to include empty channels or not (channels without messages).
This flag is false by default.includeEmpty - Flag to include empty channels.public GroupChannelListQuery.Order getOrder()
GroupChannelListQuery.Order.public void setOrder(GroupChannelListQuery.Order order)
GroupChannelListQuery.Order.METADATA_VALUE_ALPHABETICAL works with setMetaDataOrderKeyFilter(String).public java.lang.String getMetaDataOrderKeyFilter()
null if meta data order key filter hasn't been set before.public void setMetaDataOrderKeyFilter(java.lang.String metaDataOrderKey)
GroupChannelListQuery.Order.METADATA_VALUE_ALPHABETICAL is set from setOrder(Order).metaDataOrderKey - Meta data order key.public java.lang.String getNicknameContainsFilter()
null if nickname filter hasn't been set before.public void setNicknameContainsFilter(java.lang.String nickname)
GroupChannel list containing the passed nickname will be returned.
If you pass nickname such as "abc", then the returned channel list will be containing member like "*abc*".
This does not cooperate with other filters.nickname - User nickname to search as the member of the channels.@Deprecated
public void setUserIdsFilter(java.util.List<java.lang.String> userIds,
boolean exactMatch)
setUserIdsIncludeFilter(List, QueryType) and setUserIdsExactFilter(List).User IDs filter. GroupChannel list containing the passed User IDs will be returned.
This does not cooperate with other filters.userIds - User IDs to search as the member of the channels.
The list of IDs operates as AND option.exactMatch - If this is true, the channels exactly containing the current User and the passed User IDs will be returned.
Otherwise, the channels which have the current User, the passed User IDs and others will be returned.public java.util.List<java.lang.String> getUserIdsIncludeFilter()
User IDs include filter. It will return null if User IDs include filter hasn't been set before.
Modification of returned List will not affect GroupChannelListQuery's filter value. If you want to modify the filter value, please find the setUserIdsIncludeFilter(List, QueryType).User IDs include filter.public GroupChannelListQuery.QueryType getUserIdsIncludeFilterQueryType()
QueryType of User IDs filter.QueryType.public void setUserIdsIncludeFilter(java.util.List<java.lang.String> userIds,
GroupChannelListQuery.QueryType queryType)
User IDs filter. GroupChannel list containing the passed User IDs and other members will be returned.
This does not cooperate with other filters.userIds - User IDs to search as the member of the channels.queryType - The logical operation options. If passed GroupChannelListQuery.QueryType.AND with userIds = {A, B}, the channels containing
A AND B + other members will be returned. If GroupChannelListQuery.QueryType.OR, the channels with A OR B + other members will be returned.public java.util.List<java.lang.String> getUserIdsExactFilter()
User IDs exact filter. It will return null if User IDs exact filter hasn't been set before.
Modification of returned List will not affect GroupChannelListQuery's filter value. If you want to modify the filter value, please find the setUserIdsExactFilter(List).User IDs exact filter.public void setUserIdsExactFilter(java.util.List<java.lang.String> userIds)
User IDs filter. GroupChannel list containing only and exactly the passed User IDs will be returned.
This does not cooperate with other filters.userIds - User IDs to search as the member of the channels.public void setSearchFilter(java.util.List<GroupChannelListQuery.SearchField> searchFields, java.lang.String query)
GroupChannels will be included in the result if its data in specified SearchFields contains specified query string. Refer to GroupChannelListQuery.SearchField.
If you set multiple SearchFields, the result will be union of each result.searchFields - Target fields that you want to search. Refer to GroupChannelListQuery.SearchField.query - Query string you want to search with.public java.lang.String getSearchQuery()
setSearchFilter(List, String).String.public java.util.List<GroupChannelListQuery.SearchField> getSearchFields()
setSearchFilter(List, String) and GroupChannelListQuery.SearchField.GroupChannelListQuery.SearchField.@Deprecated public void setCustomTypeFilter(java.lang.String customType)
setCustomTypesFilter(List).customType - The Custom Type of the channels to return.public java.lang.String getCustomTypeStartsWithFilter()
null if custom type starts with filter hasn't been set before.public void setCustomTypeStartsWithFilter(java.lang.String customType)
customType - The Custom Typepublic java.util.List<java.lang.String> getCustomTypesFilter()
null if custom types filter hasn't been set before.public void setCustomTypesFilter(java.util.List<java.lang.String> customTypes)
GroupChannel custom types filter. GroupChannel list containing only and exactly the passed custom types will be returned.customTypes - GroupChannel custom types.@Deprecated public void setMemberStateFilter(GroupChannelListQuery.MemberState memberState)
setMemberStateFilter(GroupChannel.MemberState).User state matching to GroupChannelListQuery.MemberState.
If set GroupChannelListQuery.MemberState.INVITED_ONLY, only the channels from which invitations has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannelListQuery.MemberState.JOINED_ONLY, only the channels the current User is already joined will be
returned.memberState - The member state of the current User of the channels to return.@Deprecated public void setMemberStateFilter(GroupChannel.MemberState memberState)
setMemberStateFilter(MemberStateFilter).User state matching to GroupChannel.MemberState.
If set GroupChannel.MemberState.INVITED, only the channels from which invitations has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannel.MemberState.INVITED_BY_FRIEND, only the channels from which invitations by friend has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannel.MemberState.INVITED_BY_NON_FRIEND, only the channels from which invitations by non friend has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannel.MemberState.JOINED, only the channels the current User is already joined will be
returned.memberState - The member state of the current User of the channels to return.public GroupChannelListQuery.MemberStateFilter getMemberStateFilter()
User state matching to GroupChannelListQuery.MemberStateFilter.public void setMemberStateFilter(GroupChannelListQuery.MemberStateFilter memberStateFilter)
User state matching to GroupChannelListQuery.MemberStateFilter.
If set GroupChannelListQuery.MemberStateFilter.INVITED, only the channels from which invitations has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannelListQuery.MemberStateFilter.INVITED_BY_FRIEND, only the channels from which invitations by friend has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannelListQuery.MemberStateFilter.INVITED_BY_NON_FRIEND, only the channels from which invitations by non friend has been sent to the current
User (but not accepted yet) will be returned.
If set GroupChannelListQuery.MemberStateFilter.JOINED, only the channels the current User is already joined will be
returned.memberStateFilter - The member state of the current User of the channels to return.public java.util.List<java.lang.String> getChannelUrlsFilter()
null if channel URL filter hasn't been set before.public void setChannelUrlsFilter(java.util.List<java.lang.String> channelUrls)
GroupChannel URLs filter. GroupChannel list containing only and exactly the passed GroupChannel URLs will be returned.channelUrls - GroupChannel URLs.public java.lang.String getChannelNameContainsFilter()
null if channel name filter hasn't been set before.public void setChannelNameContainsFilter(java.lang.String channelName)
GroupChannel list containing the passed channel name will be returned.
If you pass name such as "abc", then the returned channel list will be containing name like "*abc*".channelName - Name of channel to search.public GroupChannelListQuery.SuperChannelFilter getSuperChannelFilter()
GroupChannelListQuery.SuperChannelFilter.public void setSuperChannelFilter(GroupChannelListQuery.SuperChannelFilter superChannelFilter)
superChannelFilter - GroupChannelListQuery.SuperChannelFilterpublic GroupChannelListQuery.PublicChannelFilter getPublicChannelFilter()
GroupChannelListQuery.PublicChannelFilter.public void setPublicChannelFilter(GroupChannelListQuery.PublicChannelFilter publicChannelFilter)
publicChannelFilter - GroupChannelListQuery.PublicChannelFilterpublic GroupChannelListQuery.UnreadChannelFilter getUnreadChannelFilter()
GroupChannelListQuery.UnreadChannelFilter.public void setUnreadChannelFilter(GroupChannelListQuery.UnreadChannelFilter unreadChannelFilter)
unreadChannelFilter - GroupChannelListQuery.UnreadChannelFilterpublic GroupChannelListQuery.HiddenChannelFilter getHiddenChannelFilter()
GroupChannelListQuery.HiddenChannelFilter.public void setHiddenChannelFilter(GroupChannelListQuery.HiddenChannelFilter hiddenChannelFilter)
hiddenChannelFilter - GroupChannelListQuery.HiddenChannelFilterpublic boolean hasNext()
true if there is a next page.public boolean isLoading()
true if the current query is not finished.public boolean isIncludeFrozen()
public void setIncludeFrozen(boolean includeFrozen)
true/false to include frozen channels or not.
This flag is true by default.includeFrozen - Flag to include frozen channels.public boolean isIncludeMetadata()
public void setIncludeMetadata(boolean includeMetadata)
public void setMetaDataValuesFilter(java.lang.String metaDataKey,
java.util.List<java.lang.String> metaDataValues)
Channel meta data filter. Channel list containing only and exactly the passed Channel meta data will be returned.
If this is set, it will reset the filter set from setMetaDataValueStartsWithFilter(String, String).metaDataKey - Channel meta data key.metaDataValues - Channel meta data values. Must not be empty.setMetaDataValueStartsWithFilter(String, String).public void setMetaDataValueStartsWithFilter(java.lang.String metaDataKey,
java.lang.String metaDataValueStartsWith)
Channel meta data filter. Channel list containing passed Channel meta data key with values that starts with the passed on value will be returned.
If this is set, it will reset the filter set from setMetaDataValuesFilter(String, List).metaDataKey - Channel meta data key.metaDataValueStartsWith - Channel meta data value to start with. Must not be empty.setMetaDataValuesFilter(String, List).public java.lang.String getMetaDataKey()
public java.util.List<java.lang.String> getMetaDataValues()
public java.lang.String getMetaDataValueStartsWith()
public void next(GroupChannelListQuery.GroupChannelListQueryResultHandler handler)
GroupChannels. The queried result is passed to handler as list.
If this method is repeatedly called after each next() is finished, it retrieves the following pages of the GroupChannel list.
If there is no more pages to be read, an empty List (not null)
is returned to handler.handler - A callback handler to get the queried result.public static GroupChannelListQuery buildFromSerializedData(byte[] data)
GroupChannelListQuery instance from serialized data generated by serialize().data - Serialized GroupChannelListQuery data.GroupChannelListQuery instance.public byte[] serialize()
GroupChannelListQuery instance. This byte array can be stored
in the database in your application. The instance can be restored by buildFromSerializedData(byte[]).GroupChannelListQuery data.public boolean belongsTo(GroupChannel channel)
channel - GroupChannel to check. Returns false if the channel is not matched with the query. Copyright © 2021, Sendbird or its affiliates. All rights reserved.
Report a bug or request a feature
For further developer documentation, see Chat SDK Documentation. That documentation contains more detailed descriptions, conceptual overviews, definitions of terms, and code examples.