Class MessagePollImpl
java.lang.Object
net.dv8tion.jda.internal.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.boolean
Whether this poll is finalized and recounted.boolean
Whether this poll allows multiple answers to be selected.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:MessagePoll
The layout of the poll.- Specified by:
getLayout
in interfaceMessagePoll
- Returns:
- The poll layout, or
MessagePoll.LayoutType.UNKNOWN
if unknown
-
getQuestion
Description copied from interface:MessagePoll
The poll question, representing the title.- Specified by:
getQuestion
in interfaceMessagePoll
- Returns:
MessagePoll.Question
-
getAnswers
Description copied from interface:MessagePoll
The 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:
getAnswers
in interfaceMessagePoll
- Returns:
- Immutable
List
ofMessagePoll.Answer
-
getTimeExpiresAt
Description copied from interface:MessagePoll
The time when this poll will automatically expire.The author of the poll can always expire the poll manually, using
Message.endPoll()
.- Specified by:
getTimeExpiresAt
in interfaceMessagePoll
- Returns:
OffsetDateTime
representing the time when the poll expires automatically, or null if it never expires
-
isMultiAnswer
public boolean isMultiAnswer()Description copied from interface:MessagePoll
Whether this poll allows multiple answers to be selected.- Specified by:
isMultiAnswer
in interfaceMessagePoll
- Returns:
- True, if this poll allows multi selection
-
isFinalizedVotes
public boolean isFinalizedVotes()Description copied from interface:MessagePoll
Whether 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:
isFinalizedVotes
in interfaceMessagePoll
- Returns:
- True, if the votes have been precisely counted
-