-
public interface QueryChannelsStateContains a state related to a single query channels request.
-
-
Method Summary
Modifier and Type Method Description abstract StateFlow<Boolean>getRecoveryNeeded()If the channels need to be synced. abstract FilterObjectgetFilter()The filter associated with this query channels state. abstract QuerySorter<Channel>getSort()The sort associated with this query channels state. abstract StateFlow<QueryChannelsRequest>getCurrentRequest()The request for the current page. abstract StateFlow<QueryChannelsRequest>getNextPageRequest()The request for the next page, if there is a page. abstract StateFlow<Boolean>getLoading()If the current state is being loaded. abstract StateFlow<Boolean>getLoadingMore()If the current state is loading more channels (a next page is being loaded). abstract StateFlow<Boolean>getEndOfChannels()If the current state reached the final page. abstract StateFlow<String>getNextCursor()Cursor for the next page when this state belongs to a grouped query. abstract StateFlow<GroupedQueryConfig>getGroupedQueryConfig()Configuration captured from the most recent grouped query response that targeted this group. abstract StateFlow<List<Channel>>getChannels()The collection of channels loaded by the query channels request. abstract StateFlow<ChannelsStateData>getChannelsStateData()The channels loaded state. abstract ChatEventHandlerFactorygetChatEventHandlerFactory()Factory that produces ChatEventHandler, which decides whether the set of channels should be updated. abstract UnitsetChatEventHandlerFactory(ChatEventHandlerFactory chatEventHandlerFactory)Factory that produces ChatEventHandler, which decides whether the set of channels should be updated. -
-
Method Detail
-
getRecoveryNeeded
abstract StateFlow<Boolean> getRecoveryNeeded()
If the channels need to be synced.
-
getFilter
abstract FilterObject getFilter()
The filter associated with this query channels state.
For grouped queries (states keyed by
QueryChannelsIdentifier.Grouped), this is the group's io.getstream.chat.android.models.GroupedChannelsGroupQuery.filter from the latest request, or io.getstream.chat.android.models.Filters.neutral when the group has none.
-
getSort
abstract QuerySorter<Channel> getSort()
The sort associated with this query channels state.
For grouped queries (states keyed by
QueryChannelsIdentifier.Grouped), this orders channels byquery_timestampdescending when the latest request asked for it: the latest of their creation, last message and customtouched_atdate. It is a sorter of its own and is not equal to the requested one. Otherwise it islast_updateddescending.
-
getCurrentRequest
abstract StateFlow<QueryChannelsRequest> getCurrentRequest()
The request for the current page.
-
getNextPageRequest
abstract StateFlow<QueryChannelsRequest> getNextPageRequest()
The request for the next page, if there is a page.
-
getLoading
abstract StateFlow<Boolean> getLoading()
If the current state is being loaded.
-
getLoadingMore
abstract StateFlow<Boolean> getLoadingMore()
If the current state is loading more channels (a next page is being loaded).
-
getEndOfChannels
abstract StateFlow<Boolean> getEndOfChannels()
If the current state reached the final page.
-
getNextCursor
abstract StateFlow<String> getNextCursor()
Cursor for the next page when this state belongs to a grouped query.
nullmeans there is no further page (or that this is a standard query that doesn't use cursors).
-
getGroupedQueryConfig
abstract StateFlow<GroupedQueryConfig> getGroupedQueryConfig()
Configuration captured from the most recent grouped query response that targeted this group. Used by paginated and recovery calls so they reuse the caller's original GroupedQueryConfig.limit, GroupedQueryConfig.pageSize, GroupedQueryConfig.watch and GroupedQueryConfig.presence.
nullfor standard queries and until the first grouped response has been observed.
-
getChannels
abstract StateFlow<List<Channel>> getChannels()
The collection of channels loaded by the query channels request. The StateFlow is initialized with null which means that channels are not loaded yet.
-
getChannelsStateData
abstract StateFlow<ChannelsStateData> getChannelsStateData()
The channels loaded state. See ChannelsStateData.
-
getChatEventHandlerFactory
abstract ChatEventHandlerFactory getChatEventHandlerFactory()
Factory that produces ChatEventHandler, which decides whether the set of channels should be updated.
-
setChatEventHandlerFactory
abstract Unit setChatEventHandlerFactory(ChatEventHandlerFactory chatEventHandlerFactory)
Factory that produces ChatEventHandler, which decides whether the set of channels should be updated.
-
-
-
-