Package io.getstream.chat.android.models
Class Poll
-
- All Implemented Interfaces:
@Immutable() public final class PollThe Poll object represents a poll in a channel.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringidprivate final Stringnameprivate final Stringdescriptionprivate final List<Option>optionsprivate final VotingVisibilityvotingVisibilityprivate final BooleanenforceUniqueVoteprivate final IntegermaxVotesAllowedprivate final BooleanallowUserSuggestedOptionsprivate final BooleanallowAnswersprivate final Map<String, Integer>voteCountsByOptionprivate final List<Vote>votesprivate final List<Vote>ownVotesprivate final DatecreatedAtprivate final DateupdatedAtprivate final Booleanclosedprivate final List<Answer>answers
-
Constructor Summary
Constructors Constructor Description Poll(String id, String name, String description, List<Option> options, VotingVisibility votingVisibility, Boolean enforceUniqueVote, Integer maxVotesAllowed, Boolean allowUserSuggestedOptions, Boolean allowAnswers, Map<String, Integer> voteCountsByOption, List<Vote> votes, List<Vote> ownVotes, Date createdAt, Date updatedAt, Boolean closed, List<Answer> answers)
-
Method Summary
Modifier and Type Method Description final StringgetId()The unique identifier of the poll. final StringgetName()The name of the poll. final StringgetDescription()The description of the poll. final List<Option>getOptions()The list of options for the poll. final VotingVisibilitygetVotingVisibility()The visibility of the votes. final BooleangetEnforceUniqueVote()If set to true, a user can only vote once. final IntegergetMaxVotesAllowed()The maximum number of votes a user can cast. final BooleangetAllowUserSuggestedOptions()If set to true, users can suggest new options. final BooleangetAllowAnswers()If set to true, users can vote. final Map<String, Integer>getVoteCountsByOption()The number of votes for each option. final List<Vote>getVotes()The list of votes. final List<Vote>getOwnVotes()The list of votes cast by the current user. final DategetCreatedAt()The creation date of the poll. final DategetUpdatedAt()The last update date of the poll. final BooleangetClosed()If set to true, the poll is closed and no more votes can be cast. final List<Answer>getAnswers()The list of poll answers. final List<Vote>getVotes(Option option)Get the votes for a specific option. -
-
Constructor Detail
-
Poll
Poll(String id, String name, String description, List<Option> options, VotingVisibility votingVisibility, Boolean enforceUniqueVote, Integer maxVotesAllowed, Boolean allowUserSuggestedOptions, Boolean allowAnswers, Map<String, Integer> voteCountsByOption, List<Vote> votes, List<Vote> ownVotes, Date createdAt, Date updatedAt, Boolean closed, List<Answer> answers)
-
-
Method Detail
-
getDescription
final String getDescription()
The description of the poll.
-
getOptions
final List<Option> getOptions()
The list of options for the poll.
-
getVotingVisibility
final VotingVisibility getVotingVisibility()
The visibility of the votes. If set to VotingVisibility.ANONYMOUS, the votes will be anonymous.
-
getEnforceUniqueVote
final Boolean getEnforceUniqueVote()
If set to true, a user can only vote once.
-
getMaxVotesAllowed
final Integer getMaxVotesAllowed()
The maximum number of votes a user can cast.
-
getAllowUserSuggestedOptions
final Boolean getAllowUserSuggestedOptions()
If set to true, users can suggest new options.
-
getAllowAnswers
final Boolean getAllowAnswers()
If set to true, users can vote.
-
getVoteCountsByOption
final Map<String, Integer> getVoteCountsByOption()
The number of votes for each option.
-
getOwnVotes
final List<Vote> getOwnVotes()
The list of votes cast by the current user.
-
getCreatedAt
final Date getCreatedAt()
The creation date of the poll.
-
getUpdatedAt
final Date getUpdatedAt()
The last update date of the poll.
-
getClosed
final Boolean getClosed()
If set to true, the poll is closed and no more votes can be cast.
-
getAnswers
final List<Answer> getAnswers()
The list of poll answers.
-
-
-
-