Class MessagePollImpl
java.lang.Object
net.dv8tion.jda.api.entities.messages.MessagePollImpl
- All Implemented Interfaces:
MessagePoll
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.messages.MessagePoll
MessagePoll.Answer, MessagePoll.LayoutType, MessagePoll.Question -
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.messages.MessagePoll
MAX_ANSWER_TEXT_LENGTH, MAX_ANSWERS, MAX_DURATION_HOURS, MAX_QUESTION_TEXT_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionMessagePollImpl(MessagePoll.LayoutType layout, MessagePoll.Question question, List<MessagePoll.Answer> answers, OffsetDateTime expiresAt, boolean isMultiAnswer, boolean isFinalizedVotes) -
Method Summary
Modifier and TypeMethodDescriptionThe poll answers.The layout of the poll.The poll question, representing the title.The time when this poll will automatically expire.booleanWhether this poll is finalized and recounted.booleanWhether this poll allows multiple answers to be selected.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.entities.messages.MessagePoll
isExpired
-
Constructor Details
-
MessagePollImpl
public MessagePollImpl(MessagePoll.LayoutType layout, MessagePoll.Question question, List<MessagePoll.Answer> answers, OffsetDateTime expiresAt, boolean isMultiAnswer, boolean isFinalizedVotes)
-
-
Method Details
-
getLayout
Description copied from interface:MessagePollThe layout of the poll.- Specified by:
getLayoutin interfaceMessagePoll- Returns:
- The poll layout, or
MessagePoll.LayoutType.UNKNOWNif unknown
-
getQuestion
Description copied from interface:MessagePollThe poll question, representing the title.- Specified by:
getQuestionin interfaceMessagePoll- Returns:
MessagePoll.Question
-
getAnswers
Description copied from interface:MessagePollThe poll answers.Each answer also has the current
votes. The votes might not be finalized and might be incorrect before the poll has expired, seeMessagePoll.isFinalizedVotes().- Specified by:
getAnswersin interfaceMessagePoll- Returns:
- Immutable
ListofMessagePoll.Answer
-
getTimeExpiresAt
Description copied from interface:MessagePollThe time when this poll will automatically expire.The author of the poll can always expire the poll manually, using
Message.endPoll().- Specified by:
getTimeExpiresAtin interfaceMessagePoll- Returns:
OffsetDateTimerepresenting the time when the poll expires automatically, or null if it never expires
-
isMultiAnswer
public boolean isMultiAnswer()Description copied from interface:MessagePollWhether this poll allows multiple answers to be selected.- Specified by:
isMultiAnswerin interfaceMessagePoll- Returns:
- True, if this poll allows multi selection
-
isFinalizedVotes
public boolean isFinalizedVotes()Description copied from interface:MessagePollWhether this poll is finalized and recounted.The votes for answers might be inaccurate due to eventual consistency, until this is true. Finalization does not mean the votes cannot change anymore, use
MessagePoll.isExpired()to check if a poll has ended.- Specified by:
isFinalizedVotesin interfaceMessagePoll- Returns:
- True, if the votes have been precisely counted
-