Class ChannelKt

  • All Implemented Interfaces:

    
    public final class ChannelKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static Message lastMessage
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Message getLastMessage()
      final static List<User> users(Channel $self) Returns all users including watchers of a channel that are associated with it.
      final static Channel updateLastMessage(Channel $self, Date receivedEventDate, Message message, String currentUserId) Updates the Channel with newest Message.
      final static Channel removeMember(Channel $self, String memberUserId) Removes member from the Channel.members and aligns Channel.memberCount.
      final static Channel addMember(Channel $self, Member member) Adds member to the Channel.members and aligns Channel.memberCount.
      final static Channel updateMember(Channel $self, Member member) Updates Channel member.
      final static Channel updateMemberBanned(Channel $self, String memberUserId, Boolean banned, Boolean shadow) Updates Member.banned property inside the Channel.members.
      final static Channel addMembership(Channel $self, String currentUserId, Member member) Sets Channel.membership to member if currentUserId equals to member.
      final static Channel updateMembership(Channel $self, Member member) Sets Channel.membership to member if member.user.
      final static Channel updateMembershipBanned(Channel $self, String memberUserId, Boolean banned) Sets Channel.membership.
      final static Channel removeMembership(Channel $self, String currentUserId) Sets Channel.membership to null if currentUserId equals to membership.user.
      final static Channel updateReads(Channel $self, ChannelUserRead newRead, String currentUserId) Updates the Channel with a new ChannelUserRead.
      final static List<Channel> applyPagination(Collection<Channel> $self, AnyChannelPaginationRequest pagination) Transforms the given Collection of Channels by applying the given AnyChannelPaginationRequest.
      final static List<Channel> updateUsers(Collection<Channel> $self, Map<String, User> users) Updates collection of channels with more recent data of users.
      final static Collection<Channel> updateLiveLocations(Collection<Channel> $self, List<Location> locations) Updates the live locations of the channels with the provided locations.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • users

         final static List<User> users(Channel $self)

        Returns all users including watchers of a channel that are associated with it.

      • updateLastMessage

         final static Channel updateLastMessage(Channel $self, Date receivedEventDate, Message message, String currentUserId)

        Updates the Channel with newest Message.

        Parameters:
        receivedEventDate - Date when the event which updates the message was received.
        message - New message to update the channel with.
        currentUserId - User id of the currently logged in user.
      • removeMember

         final static Channel removeMember(Channel $self, String memberUserId)

        Removes member from the Channel.members and aligns Channel.memberCount.

        Parameters:
        memberUserId - User id of the removed member.
      • addMember

         final static Channel addMember(Channel $self, Member member)

        Adds member to the Channel.members and aligns Channel.memberCount.

        Parameters:
        member - Added member.
      • updateMember

         final static Channel updateMember(Channel $self, Member member)

        Updates Channel member.

        Parameters:
        member - Updated member.
      • updateMemberBanned

         final static Channel updateMemberBanned(Channel $self, String memberUserId, Boolean banned, Boolean shadow)

        Updates Member.banned property inside the Channel.members.

        Parameters:
        memberUserId - Updated member user id.
        banned - Shows whether a user is banned or not in this channel.
        shadow - Shows whether a user is shadow banned or not in this channel.
      • addMembership

         final static Channel addMembership(Channel $self, String currentUserId, Member member)

        Sets Channel.membership to member if currentUserId equals to member.getUserId().

        Parameters:
        currentUserId - User id of the currently logged in user.
        member - Added member.
      • updateMembership

         final static Channel updateMembership(Channel $self, Member member)

        Sets Channel.membership to member if member.user.id equals to Channel.membership.user.id.

        Parameters:
        member - Updated member.
      • updateMembershipBanned

         final static Channel updateMembershipBanned(Channel $self, String memberUserId, Boolean banned)

        Sets Channel.membership.banned to banned if memberUserId equals to Channel.membership.user.id.

        Parameters:
        memberUserId - Member user id.
        banned - Shows whether a user is banned or not in this channel.
      • removeMembership

         final static Channel removeMembership(Channel $self, String currentUserId)

        Sets Channel.membership to null if currentUserId equals to membership.user.id.

        Parameters:
        currentUserId - User id of the currently logged in user.
      • updateReads

         final static Channel updateReads(Channel $self, ChannelUserRead newRead, String currentUserId)

        Updates the Channel with a new ChannelUserRead. If an existing read for the user already exists, it will be replaced with the new one. If not, the new read will be added to the list of reads.

        Parameters:
        newRead - New read to update the channel with.
        currentUserId - User id of the currently logged in user.