Record Class Chat

java.lang.Object
java.lang.Record
dev.tobee.telegram.model.chat.Chat

public record Chat(Integer id, ChatType type, Optional<String> title, Optional<String> username, Optional<String> firstName, Optional<String> lastName, Optional<ChatPhoto> photo, Optional<String> bio, boolean hasPrivateForwards, Optional<String> description, Optional<String> inviteLink, Optional<Message> pinnedMessage, Optional<ChatPermissions> permissions, OptionalInt slowModeDelay, OptionalInt messageAutoDeleteTime, boolean hasProtectedContent, Optional<String> stickerSetName, Optional<Boolean> canSetStickerSet, OptionalInt linkedChatId, Optional<ChatLocation> location) extends Record
  • Constructor Details

    • Chat

      public Chat(Integer id, ChatType type, Optional<String> title, Optional<String> username, Optional<String> firstName, Optional<String> lastName, Optional<ChatPhoto> photo, Optional<String> bio, boolean hasPrivateForwards, Optional<String> description, Optional<String> inviteLink, Optional<Message> pinnedMessage, Optional<ChatPermissions> permissions, OptionalInt slowModeDelay, OptionalInt messageAutoDeleteTime, boolean hasProtectedContent, Optional<String> stickerSetName, Optional<Boolean> canSetStickerSet, OptionalInt linkedChatId, Optional<ChatLocation> location)
      Creates an instance of a Chat record class.
      Parameters:
      id - the value for the id record component
      type - the value for the type record component
      title - the value for the title record component
      username - the value for the username record component
      firstName - the value for the firstName record component
      lastName - the value for the lastName record component
      photo - the value for the photo record component
      bio - the value for the bio record component
      hasPrivateForwards - the value for the hasPrivateForwards record component
      description - the value for the description record component
      inviteLink - the value for the inviteLink record component
      pinnedMessage - the value for the pinnedMessage record component
      permissions - the value for the permissions record component
      slowModeDelay - the value for the slowModeDelay record component
      messageAutoDeleteTime - the value for the messageAutoDeleteTime record component
      hasProtectedContent - the value for the hasProtectedContent record component
      stickerSetName - the value for the stickerSetName record component
      canSetStickerSet - the value for the canSetStickerSet record component
      linkedChatId - the value for the linkedChatId record component
      location - the value for the location 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 Integer id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      public ChatType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • title

      public Optional<String> title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • username

      public Optional<String> username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • firstName

      public Optional<String> firstName()
      Returns the value of the firstName record component.
      Returns:
      the value of the firstName record component
    • lastName

      public Optional<String> lastName()
      Returns the value of the lastName record component.
      Returns:
      the value of the lastName record component
    • photo

      public Optional<ChatPhoto> photo()
      Returns the value of the photo record component.
      Returns:
      the value of the photo record component
    • bio

      public Optional<String> bio()
      Returns the value of the bio record component.
      Returns:
      the value of the bio record component
    • hasPrivateForwards

      public boolean hasPrivateForwards()
      Returns the value of the hasPrivateForwards record component.
      Returns:
      the value of the hasPrivateForwards record component
    • description

      public Optional<String> description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • inviteLink

      public Optional<String> inviteLink()
      Returns the value of the inviteLink record component.
      Returns:
      the value of the inviteLink record component
    • pinnedMessage

      public Optional<Message> pinnedMessage()
      Returns the value of the pinnedMessage record component.
      Returns:
      the value of the pinnedMessage record component
    • permissions

      public Optional<ChatPermissions> permissions()
      Returns the value of the permissions record component.
      Returns:
      the value of the permissions record component
    • slowModeDelay

      public OptionalInt slowModeDelay()
      Returns the value of the slowModeDelay record component.
      Returns:
      the value of the slowModeDelay record component
    • messageAutoDeleteTime

      public OptionalInt messageAutoDeleteTime()
      Returns the value of the messageAutoDeleteTime record component.
      Returns:
      the value of the messageAutoDeleteTime record component
    • hasProtectedContent

      public boolean hasProtectedContent()
      Returns the value of the hasProtectedContent record component.
      Returns:
      the value of the hasProtectedContent record component
    • stickerSetName

      public Optional<String> stickerSetName()
      Returns the value of the stickerSetName record component.
      Returns:
      the value of the stickerSetName record component
    • canSetStickerSet

      public Optional<Boolean> canSetStickerSet()
      Returns the value of the canSetStickerSet record component.
      Returns:
      the value of the canSetStickerSet record component
    • linkedChatId

      public OptionalInt linkedChatId()
      Returns the value of the linkedChatId record component.
      Returns:
      the value of the linkedChatId record component
    • location

      public Optional<ChatLocation> location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component