Class StateRegistry

  • All Implemented Interfaces:

    
    public final class StateRegistry
    
                        

    Registry of all state objects exposed in the offline plugin. This class should have only one instance for the SDK.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, Job job, CoroutineScope scope)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final QueryChannelsState queryChannels(FilterObject filter, QuerySorter<Channel> sort) Returns QueryChannelsState associated with particular filter and sort.
      final ChannelState channel(String channelType, String channelId) Returns ChannelState that represents a state of particular channel.
      final ThreadState thread(String messageId) Returns ThreadState of thread replies with parent message that has id equal to messageId.
      final Unit clear() Clear state of all state objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StateRegistry

        StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, Job job, CoroutineScope scope)
        Parameters:
        userStateFlow - The state flow that provides the user once it is set.
        latestUsers - Latest users of the SDK.
        job - A background job cancelled after calling clear.
        scope - A scope for new coroutines.
    • Method Detail

      • channel

         final ChannelState channel(String channelType, String channelId)

        Returns ChannelState that represents a state of particular channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        Returns:

        ChannelState object.

      • clear

         final Unit clear()

        Clear state of all state objects.