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

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

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the allowsMultipleAnswers record component.
    boolean
    Returns the value of the allowsRevoting record component.
    @Nullable Date
    Returns the value of the closeDate record component.
    int[]
    Returns the value of the correctOptionIds record component.
    @Nullable String[]
    Returns the value of the countryCodes record component.
    @Nullable String
    Returns the value of the description record component.
    @Nullable MessageEntity[]
    Returns the value of the descriptionEntities 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.
    @Nullable PollMedia
    Returns the value of the explanationMedia 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.
    @Nullable PollMedia
    Returns the value of the media record component.
    boolean
    Returns the value of the membersOnly 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 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, 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 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
      allowsRevoting - the value for the allowsRevoting record component
      membersOnly - the value for the membersOnly record component
      countryCodes - the value for the countryCodes record component
      correctOptionIds - the value for the correctOptionIds record component
      explanation - the value for the explanation record component
      explanationEntities - the value for the explanationEntities record component
      explanationMedia - the value for the explanationMedia record component
      openPeriod - the value for the openPeriod record component
      closeDate - the value for the closeDate record component
      description - the value for the description record component
      descriptionEntities - the value for the descriptionEntities record component
      media - the value for the media 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 the compare method from their corresponding wrapper classes.
      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 PollType 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
    • allowsRevoting

      public boolean allowsRevoting()
      Returns the value of the allowsRevoting record component.
      Returns:
      the value of the allowsRevoting record component
    • membersOnly

      public boolean membersOnly()
      Returns the value of the membersOnly record component.
      Returns:
      the value of the membersOnly record component
    • countryCodes

      @Nullable public @Nullable String[] countryCodes()
      Returns the value of the countryCodes record component.
      Returns:
      the value of the countryCodes record component
    • correctOptionIds

      public int[] correctOptionIds()
      Returns the value of the correctOptionIds record component.
      Returns:
      the value of the correctOptionIds 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
    • explanationMedia

      @Nullable public @Nullable PollMedia explanationMedia()
      Returns the value of the explanationMedia record component.
      Returns:
      the value of the explanationMedia 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
    • description

      @Nullable public @Nullable String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • descriptionEntities

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

      @Nullable public @Nullable PollMedia media()
      Returns the value of the media record component.
      Returns:
      the value of the media record component