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, String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable String explanation, @Nullable MessageEntity[] explanationEntities, int openPeriod, @Nullable Date closeDate)
extends Record
implements ApiResult
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPoll(String id, String question, @Nullable MessageEntity[] questionEntities, PollOption[] options, int totalVoterCount, boolean isClosed, boolean isAnonymous, String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable String explanation, @Nullable MessageEntity[] explanationEntities, int openPeriod, @Nullable Date closeDate) Creates an instance of aPollrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowsMultipleAnswersrecord component.@Nullable DateReturns the value of thecloseDaterecord component.intReturns the value of thecorrectOptionIdrecord 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.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.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, String type, boolean allowsMultipleAnswers, int correctOptionId, @Nullable @Nullable String explanation, @Nullable @Nullable MessageEntity[] explanationEntities, int openPeriod, @Nullable @Nullable Date closeDate) 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 componentcorrectOptionId- the value for thecorrectOptionIdrecord componentexplanation- the value for theexplanationrecord componentexplanationEntities- the value for theexplanationEntitiesrecord componentopenPeriod- the value for theopenPeriodrecord componentcloseDate- the value for thecloseDaterecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
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
-
correctOptionId
public int correctOptionId()Returns the value of thecorrectOptionIdrecord component.- Returns:
- the value of the
correctOptionIdrecord 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
-
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
-