Record Class Poll
java.lang.Object
java.lang.Record
org.teleight.teleightbots.api.objects.Poll
- All Implemented Interfaces:
Serializable, ApiResult
public record Poll(String id, String question, @Nullable MessageEntity[] questionEntities, PollOption[] options, int totalVoterCount, boolean isClosed, boolean isAnonymous, PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable String explanation, @Nullable MessageEntity[] explanationEntities, @Nullable PollMedia explanationMedia, int openPeriod, @Nullable Date closeDate, @Nullable String description, @Nullable MessageEntity[] descriptionEntities, @Nullable PollMedia media)
extends Record
implements ApiResult
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPoll(String id, String question, @Nullable MessageEntity[] questionEntities, PollOption[] options, int totalVoterCount, boolean isClosed, boolean isAnonymous, PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable String explanation, @Nullable MessageEntity[] explanationEntities, @Nullable PollMedia explanationMedia, int openPeriod, @Nullable Date closeDate, @Nullable String description, @Nullable MessageEntity[] descriptionEntities, @Nullable PollMedia media) Creates an instance of aPollrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowsMultipleAnswersrecord component.booleanReturns the value of theallowsRevotingrecord component.@Nullable DateReturns the value of thecloseDaterecord component.int[]Returns the value of thecorrectOptionIdsrecord component.@Nullable String[]Returns the value of thecountryCodesrecord component.@Nullable StringReturns the value of thedescriptionrecord component.@Nullable MessageEntity[]Returns the value of thedescriptionEntitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringReturns the value of theexplanationrecord component.@Nullable MessageEntity[]Returns the value of theexplanationEntitiesrecord component.@Nullable PollMediaReturns the value of theexplanationMediarecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanReturns the value of theisAnonymousrecord component.booleanisClosed()Returns the value of theisClosedrecord component.@Nullable PollMediamedia()Returns the value of themediarecord component.booleanReturns the value of themembersOnlyrecord component.intReturns the value of theopenPeriodrecord component.options()Returns the value of theoptionsrecord component.question()Returns the value of thequestionrecord component.@Nullable MessageEntity[]Returns the value of thequestionEntitiesrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalVoterCountrecord component.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Poll
public Poll(String id, String question, @Nullable @Nullable MessageEntity[] questionEntities, PollOption[] options, int totalVoterCount, boolean isClosed, boolean isAnonymous, PollType type, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, @Nullable @Nullable String[] countryCodes, int[] correctOptionIds, @Nullable @Nullable String explanation, @Nullable @Nullable MessageEntity[] explanationEntities, @Nullable @Nullable PollMedia explanationMedia, int openPeriod, @Nullable @Nullable Date closeDate, @Nullable @Nullable String description, @Nullable @Nullable MessageEntity[] descriptionEntities, @Nullable @Nullable PollMedia media) Creates an instance of aPollrecord class.- Parameters:
id- the value for theidrecord componentquestion- the value for thequestionrecord componentquestionEntities- the value for thequestionEntitiesrecord componentoptions- the value for theoptionsrecord componenttotalVoterCount- the value for thetotalVoterCountrecord componentisClosed- the value for theisClosedrecord componentisAnonymous- the value for theisAnonymousrecord componenttype- the value for thetyperecord componentallowsMultipleAnswers- the value for theallowsMultipleAnswersrecord componentallowsRevoting- the value for theallowsRevotingrecord componentmembersOnly- the value for themembersOnlyrecord componentcountryCodes- the value for thecountryCodesrecord componentcorrectOptionIds- the value for thecorrectOptionIdsrecord componentexplanation- the value for theexplanationrecord componentexplanationEntities- the value for theexplanationEntitiesrecord componentexplanationMedia- the value for theexplanationMediarecord componentopenPeriod- the value for theopenPeriodrecord componentcloseDate- the value for thecloseDaterecord componentdescription- the value for thedescriptionrecord componentdescriptionEntities- the value for thedescriptionEntitiesrecord componentmedia- the value for themediarecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
question
Returns the value of thequestionrecord component.- Returns:
- the value of the
questionrecord component
-
questionEntities
Returns the value of thequestionEntitiesrecord component.- Returns:
- the value of the
questionEntitiesrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
totalVoterCount
public int totalVoterCount()Returns the value of thetotalVoterCountrecord component.- Returns:
- the value of the
totalVoterCountrecord component
-
isClosed
public boolean isClosed()Returns the value of theisClosedrecord component.- Returns:
- the value of the
isClosedrecord component
-
isAnonymous
public boolean isAnonymous()Returns the value of theisAnonymousrecord component.- Returns:
- the value of the
isAnonymousrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
allowsMultipleAnswers
public boolean allowsMultipleAnswers()Returns the value of theallowsMultipleAnswersrecord component.- Returns:
- the value of the
allowsMultipleAnswersrecord component
-
allowsRevoting
public boolean allowsRevoting()Returns the value of theallowsRevotingrecord component.- Returns:
- the value of the
allowsRevotingrecord component
-
membersOnly
public boolean membersOnly()Returns the value of themembersOnlyrecord component.- Returns:
- the value of the
membersOnlyrecord component
-
countryCodes
Returns the value of thecountryCodesrecord component.- Returns:
- the value of the
countryCodesrecord component
-
correctOptionIds
public int[] correctOptionIds()Returns the value of thecorrectOptionIdsrecord component.- Returns:
- the value of the
correctOptionIdsrecord component
-
explanation
Returns the value of theexplanationrecord component.- Returns:
- the value of the
explanationrecord component
-
explanationEntities
Returns the value of theexplanationEntitiesrecord component.- Returns:
- the value of the
explanationEntitiesrecord component
-
explanationMedia
Returns the value of theexplanationMediarecord component.- Returns:
- the value of the
explanationMediarecord component
-
openPeriod
public int openPeriod()Returns the value of theopenPeriodrecord component.- Returns:
- the value of the
openPeriodrecord component
-
closeDate
Returns the value of thecloseDaterecord component.- Returns:
- the value of the
closeDaterecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
descriptionEntities
Returns the value of thedescriptionEntitiesrecord component.- Returns:
- the value of the
descriptionEntitiesrecord component
-
media
Returns the value of themediarecord component.- Returns:
- the value of the
mediarecord component
-