Class PollKt

  • All Implemented Interfaces:

    
    public final class PollKt
    
                        
    • Constructor Detail

    • Method Detail

      • processPoll

         final static Poll processPoll(VoteChangedEvent $self, String currentUserId, Function1<String, Poll> getOldPoll)

        Processes the VoteChangedEvent and updates the poll with the new vote.

        Parameters:
        currentUserId - The current user ID.
        getOldPoll - A function to get the old poll by its ID.
      • processPoll

         final static Poll processPoll(VoteCastedEvent $self, String currentUserId, Function1<String, Poll> getOldPoll)

        Processes the VoteCastedEvent and updates the poll with the new vote.

        Parameters:
        currentUserId - The current user ID.
        getOldPoll - A function to get the old poll by its ID.
      • processPoll

         final static Poll processPoll(VoteRemovedEvent $self, Function1<String, Poll> getOldPoll)

        Processes the VoteRemovedEvent and updates the poll by removing the vote.

        Parameters:
        getOldPoll - A function to get the old poll by its ID.
      • getVotesUnlessAnonymous

         final static List<Vote> getVotesUnlessAnonymous(Poll $self, Option option)

        Returns the votes for a specific option in the poll. If the poll is anonymous, it returns an empty list.

      • getWinner

         final static Option getWinner(Poll $self)

        Returns the unique winner of the poll.