Record Class PollOption

java.lang.Object
java.lang.Record
org.teleight.teleightbots.api.objects.PollOption
All Implemented Interfaces:
Serializable, ApiResult

public record PollOption(String persistentId, String text, @Nullable MessageEntity[] textEntities, @Nullable PollMedia media, int voterCount, @Nullable User addedByUser, @Nullable Date additionDate) extends Record implements ApiResult
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PollOption(String persistentId, String text, @Nullable MessageEntity[] textEntities, @Nullable PollMedia media, int voterCount, @Nullable User addedByUser, @Nullable Date additionDate)
    Creates an instance of a PollOption record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable User
    Returns the value of the addedByUser record component.
    @Nullable Date
    Returns the value of the additionDate record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @Nullable PollMedia
    Returns the value of the media record component.
    Returns the value of the persistentId record component.
    Returns the value of the text record component.
    @Nullable MessageEntity[]
    Returns the value of the textEntities record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the voterCount record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PollOption

      public PollOption(String persistentId, String text, @Nullable @Nullable MessageEntity[] textEntities, @Nullable @Nullable PollMedia media, int voterCount, @Nullable @Nullable User addedByUser, @Nullable @Nullable Date additionDate)
      Creates an instance of a PollOption record class.
      Parameters:
      persistentId - the value for the persistentId record component
      text - the value for the text record component
      textEntities - the value for the textEntities record component
      media - the value for the media record component
      voterCount - the value for the voterCount record component
      addedByUser - the value for the addedByUser record component
      additionDate - the value for the additionDate 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.
    • persistentId

      public String persistentId()
      Returns the value of the persistentId record component.
      Returns:
      the value of the persistentId record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • textEntities

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

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

      public int voterCount()
      Returns the value of the voterCount record component.
      Returns:
      the value of the voterCount record component
    • addedByUser

      @Nullable public @Nullable User addedByUser()
      Returns the value of the addedByUser record component.
      Returns:
      the value of the addedByUser record component
    • additionDate

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