Class PollKt
-
- All Implemented Interfaces:
public final class PollKt
-
-
Method Summary
Modifier and Type Method Description final static PollprocessPoll(VoteChangedEvent $self, String currentUserId, Function1<String, Poll> getOldPoll)Processes the VoteChangedEvent and updates the poll with the new vote. final static PollprocessPoll(VoteCastedEvent $self, String currentUserId, Function1<String, Poll> getOldPoll)Processes the VoteCastedEvent and updates the poll with the new vote. final static PollprocessPoll(VoteRemovedEvent $self, Function1<String, Poll> getOldPoll)Processes the VoteRemovedEvent and updates the poll by removing the vote. final static PollprocessPoll(AnswerCastedEvent $self, Function1<String, Poll> getOldPoll)Processes the AnswerCastedEvent and updates the poll with the new answer. final static PollprocessPoll(PollClosedEvent $self, Function1<String, Poll> getOldPoll)Processes the PollClosedEvent and updates the poll by marking it as closed. final static PollprocessPoll(PollUpdatedEvent $self, Function1<String, Poll> getOldPoll)Processes the PollUpdatedEvent and updates the poll with the new data. final static List<Vote>getVotesUnlessAnonymous(Poll $self, Option option)Returns the votes for a specific option in the poll. final static OptiongetWinner(Poll $self)Returns the unique winner of the poll. -
-
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.
-
processPoll
final static Poll processPoll(AnswerCastedEvent $self, Function1<String, Poll> getOldPoll)
Processes the AnswerCastedEvent and updates the poll with the new answer.
- Parameters:
getOldPoll- A function to get the old poll by its ID.
-
processPoll
final static Poll processPoll(PollClosedEvent $self, Function1<String, Poll> getOldPoll)
Processes the PollClosedEvent and updates the poll by marking it as closed.
-
processPoll
final static Poll processPoll(PollUpdatedEvent $self, Function1<String, Poll> getOldPoll)
Processes the PollUpdatedEvent and updates the poll with the new data.
- 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.
-
-
-
-