Record Class Poll

java.lang.Object
java.lang.Record
dev.tobee.telegram.model.Poll

public record Poll(String id, String question, List<PollOption> options, int totalVoterCount, Boolean isClosed, Boolean isAnonymous, PollType type, Boolean allowsMultipleAnswers, OptionalInt correctOptionId, String explanation, List<MessageEntity> explanationEntities, OptionalInt openPeriod, OptionalInt closeDate) extends Record
  • Constructor Details

    • Poll

      public Poll(String id, String question, List<PollOption> options, int totalVoterCount, Boolean isClosed, Boolean isAnonymous, PollType type, Boolean allowsMultipleAnswers, OptionalInt correctOptionId, String explanation, List<MessageEntity> explanationEntities, OptionalInt openPeriod, OptionalInt 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
      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
    • options

      public List<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
    • correctOptionId

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

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

      public List<MessageEntity> explanationEntities()
      Returns the value of the explanationEntities record component.
      Returns:
      the value of the explanationEntities record component
    • openPeriod

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

      public OptionalInt closeDate()
      Returns the value of the closeDate record component.
      Returns:
      the value of the closeDate record component