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

    Constructors
    Constructor
    Description
    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)
    Creates an instance of a Poll record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the allowsMultipleAnswers record component.
    @Nullable Date
    Returns the value of the closeDate record component.
    int
    Returns the value of the correctOptionId record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @Nullable String
    Returns the value of the explanation record component.
    @Nullable MessageEntity[]
    Returns the value of the explanationEntities record component.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    boolean
    Returns the value of the isAnonymous record component.
    boolean
    Returns the value of the isClosed record component.
    int
    Returns the value of the openPeriod record component.
    Returns the value of the options record component.
    Returns the value of the question record component.
    @Nullable MessageEntity[]
    Returns the value of the questionEntities record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the totalVoterCount record component.
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a Poll record class.
      Parameters:
      id - the value for the id record component
      question - the value for the question record component
      questionEntities - the value for the questionEntities record component
      options - the value for the options record component
      totalVoterCount - the value for the totalVoterCount record component
      isClosed - the value for the isClosed record component
      isAnonymous - the value for the isAnonymous record component
      type - the value for the type record component
      allowsMultipleAnswers - the value for the allowsMultipleAnswers record component
      correctOptionId - the value for the correctOptionId record component
      explanation - the value for the explanation record component
      explanationEntities - the value for the explanationEntities record component
      openPeriod - the value for the openPeriod record component
      closeDate - the value for the closeDate record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • question

      public String question()
      Returns the value of the question record component.
      Returns:
      the value of the question record component
    • questionEntities

      @Nullable public @Nullable MessageEntity[] questionEntities()
      Returns the value of the questionEntities record component.
      Returns:
      the value of the questionEntities record component
    • options

      public PollOption[] options()
      Returns the value of the options record component.
      Returns:
      the value of the options record component
    • totalVoterCount

      public int totalVoterCount()
      Returns the value of the totalVoterCount record component.
      Returns:
      the value of the totalVoterCount record component
    • isClosed

      public boolean isClosed()
      Returns the value of the isClosed record component.
      Returns:
      the value of the isClosed record component
    • isAnonymous

      public boolean isAnonymous()
      Returns the value of the isAnonymous record component.
      Returns:
      the value of the isAnonymous record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • allowsMultipleAnswers

      public boolean allowsMultipleAnswers()
      Returns the value of the allowsMultipleAnswers record component.
      Returns:
      the value of the allowsMultipleAnswers record component
    • correctOptionId

      public int correctOptionId()
      Returns the value of the correctOptionId record component.
      Returns:
      the value of the correctOptionId record component
    • explanation

      @Nullable public @Nullable String explanation()
      Returns the value of the explanation record component.
      Returns:
      the value of the explanation record component
    • explanationEntities

      @Nullable public @Nullable MessageEntity[] explanationEntities()
      Returns the value of the explanationEntities record component.
      Returns:
      the value of the explanationEntities record component
    • openPeriod

      public int openPeriod()
      Returns the value of the openPeriod record component.
      Returns:
      the value of the openPeriod record component
    • closeDate

      @Nullable public @Nullable Date closeDate()
      Returns the value of the closeDate record component.
      Returns:
      the value of the closeDate record component