Record Class Message

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

public record Message(OptionalLong messageId, Optional<User> user, Optional<Chat> senderChat, int date, Chat chat, Optional<User> forwardFrom, Optional<Chat> forwardFromChat, Optional<Integer> forwardFromMessageId, Optional<String> forwardSignature, Optional<String> forwardSenderName, Optional<Integer> forwardDate, Optional<Message> replyToMessage, Optional<User> viaBot, Optional<Integer> editDate, Optional<String> mediaGroupId, Optional<String> authorSignature, Optional<String> text, Optional<List<MessageEntity>> entities, Optional<Animation> animation, Optional<Audio> audio, Optional<Document> document, Optional<List<PhotoSize>> photo, Optional<Sticker> sticker, Optional<Video> video, Optional<VideoNote> video_note, Optional<Voice> voice, Optional<String> caption, Optional<List<MessageEntity>> captionEntities, Optional<Contact> contact, Optional<Dice> dice, Optional<Game> game, Optional<Poll> poll, Optional<Location> location, Optional<List<User>> newChatMembers, Optional<User> leftChatMember, Optional<String> newChatTitle, Optional<List<PhotoSize>> newChatPhoto, Optional<Boolean> deleteChatPhoto, Optional<Boolean> groupChatCreated, Optional<Boolean> supergroupChatCreated, Optional<MessageAutoDeleteTimerChanged> messageAutoDeleteTimerChanged, Optional<Integer> migrateToChatId, Optional<Integer> migrateFromChatId, Optional<Message> pinnedMessage, Optional<Invoice> invoice, Optional<SuccessfulPayment> successfulPayment, Optional<String> connectedWebsite, Optional<PassportData> passportData, Optional<ProximityAlertTriggered> proximityAlertTriggered, Optional<VoiceChatScheduled> voiceChatScheduled, Optional<VoiceChatStarted> voiceChatStarted, Optional<VoiceChatEnded> voiceChatEnded, Optional<VoiceChatParticipantsInvited> voiceChatParticipantsInvited, Optional<InlineKeyboardMarkup> replyMarkup) extends Record
  • Constructor Details

    • Message

      public Message(OptionalLong messageId, Optional<User> user, Optional<Chat> senderChat, int date, Chat chat, Optional<User> forwardFrom, Optional<Chat> forwardFromChat, Optional<Integer> forwardFromMessageId, Optional<String> forwardSignature, Optional<String> forwardSenderName, Optional<Integer> forwardDate, Optional<Message> replyToMessage, Optional<User> viaBot, Optional<Integer> editDate, Optional<String> mediaGroupId, Optional<String> authorSignature, Optional<String> text, Optional<List<MessageEntity>> entities, Optional<Animation> animation, Optional<Audio> audio, Optional<Document> document, Optional<List<PhotoSize>> photo, Optional<Sticker> sticker, Optional<Video> video, Optional<VideoNote> video_note, Optional<Voice> voice, Optional<String> caption, Optional<List<MessageEntity>> captionEntities, Optional<Contact> contact, Optional<Dice> dice, Optional<Game> game, Optional<Poll> poll, Optional<Location> location, Optional<List<User>> newChatMembers, Optional<User> leftChatMember, Optional<String> newChatTitle, Optional<List<PhotoSize>> newChatPhoto, Optional<Boolean> deleteChatPhoto, Optional<Boolean> groupChatCreated, Optional<Boolean> supergroupChatCreated, Optional<MessageAutoDeleteTimerChanged> messageAutoDeleteTimerChanged, Optional<Integer> migrateToChatId, Optional<Integer> migrateFromChatId, Optional<Message> pinnedMessage, Optional<Invoice> invoice, Optional<SuccessfulPayment> successfulPayment, Optional<String> connectedWebsite, Optional<PassportData> passportData, Optional<ProximityAlertTriggered> proximityAlertTriggered, Optional<VoiceChatScheduled> voiceChatScheduled, Optional<VoiceChatStarted> voiceChatStarted, Optional<VoiceChatEnded> voiceChatEnded, Optional<VoiceChatParticipantsInvited> voiceChatParticipantsInvited, Optional<InlineKeyboardMarkup> replyMarkup)
      Creates an instance of a Message record class.
      Parameters:
      messageId - the value for the messageId record component
      user - the value for the user record component
      senderChat - the value for the senderChat record component
      date - the value for the date record component
      chat - the value for the chat record component
      forwardFrom - the value for the forwardFrom record component
      forwardFromChat - the value for the forwardFromChat record component
      forwardFromMessageId - the value for the forwardFromMessageId record component
      forwardSignature - the value for the forwardSignature record component
      forwardSenderName - the value for the forwardSenderName record component
      forwardDate - the value for the forwardDate record component
      replyToMessage - the value for the replyToMessage record component
      viaBot - the value for the viaBot record component
      editDate - the value for the editDate record component
      mediaGroupId - the value for the mediaGroupId record component
      authorSignature - the value for the authorSignature record component
      text - the value for the text record component
      entities - the value for the entities record component
      animation - the value for the animation record component
      audio - the value for the audio record component
      document - the value for the document record component
      photo - the value for the photo record component
      sticker - the value for the sticker record component
      video - the value for the video record component
      video_note - the value for the video_note record component
      voice - the value for the voice record component
      caption - the value for the caption record component
      captionEntities - the value for the captionEntities record component
      contact - the value for the contact record component
      dice - the value for the dice record component
      game - the value for the game record component
      poll - the value for the poll record component
      location - the value for the location record component
      newChatMembers - the value for the newChatMembers record component
      leftChatMember - the value for the leftChatMember record component
      newChatTitle - the value for the newChatTitle record component
      newChatPhoto - the value for the newChatPhoto record component
      deleteChatPhoto - the value for the deleteChatPhoto record component
      groupChatCreated - the value for the groupChatCreated record component
      supergroupChatCreated - the value for the supergroupChatCreated record component
      messageAutoDeleteTimerChanged - the value for the messageAutoDeleteTimerChanged record component
      migrateToChatId - the value for the migrateToChatId record component
      migrateFromChatId - the value for the migrateFromChatId record component
      pinnedMessage - the value for the pinnedMessage record component
      invoice - the value for the invoice record component
      successfulPayment - the value for the successfulPayment record component
      connectedWebsite - the value for the connectedWebsite record component
      passportData - the value for the passportData record component
      proximityAlertTriggered - the value for the proximityAlertTriggered record component
      voiceChatScheduled - the value for the voiceChatScheduled record component
      voiceChatStarted - the value for the voiceChatStarted record component
      voiceChatEnded - the value for the voiceChatEnded record component
      voiceChatParticipantsInvited - the value for the voiceChatParticipantsInvited record component
      replyMarkup - the value for the replyMarkup 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.
    • messageId

      public OptionalLong messageId()
      Returns the value of the messageId record component.
      Returns:
      the value of the messageId record component
    • user

      public Optional<User> user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component
    • senderChat

      public Optional<Chat> senderChat()
      Returns the value of the senderChat record component.
      Returns:
      the value of the senderChat record component
    • date

      public int date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • chat

      public Chat chat()
      Returns the value of the chat record component.
      Returns:
      the value of the chat record component
    • forwardFrom

      public Optional<User> forwardFrom()
      Returns the value of the forwardFrom record component.
      Returns:
      the value of the forwardFrom record component
    • forwardFromChat

      public Optional<Chat> forwardFromChat()
      Returns the value of the forwardFromChat record component.
      Returns:
      the value of the forwardFromChat record component
    • forwardFromMessageId

      public Optional<Integer> forwardFromMessageId()
      Returns the value of the forwardFromMessageId record component.
      Returns:
      the value of the forwardFromMessageId record component
    • forwardSignature

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

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

      public Optional<Integer> forwardDate()
      Returns the value of the forwardDate record component.
      Returns:
      the value of the forwardDate record component
    • replyToMessage

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

      public Optional<User> viaBot()
      Returns the value of the viaBot record component.
      Returns:
      the value of the viaBot record component
    • editDate

      public Optional<Integer> editDate()
      Returns the value of the editDate record component.
      Returns:
      the value of the editDate record component
    • mediaGroupId

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

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

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

      public Optional<List<MessageEntity>> entities()
      Returns the value of the entities record component.
      Returns:
      the value of the entities record component
    • animation

      public Optional<Animation> animation()
      Returns the value of the animation record component.
      Returns:
      the value of the animation record component
    • audio

      public Optional<Audio> audio()
      Returns the value of the audio record component.
      Returns:
      the value of the audio record component
    • document

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

      public Optional<List<PhotoSize>> photo()
      Returns the value of the photo record component.
      Returns:
      the value of the photo record component
    • sticker

      public Optional<Sticker> sticker()
      Returns the value of the sticker record component.
      Returns:
      the value of the sticker record component
    • video

      public Optional<Video> video()
      Returns the value of the video record component.
      Returns:
      the value of the video record component
    • video_note

      public Optional<VideoNote> video_note()
      Returns the value of the video_note record component.
      Returns:
      the value of the video_note record component
    • voice

      public Optional<Voice> voice()
      Returns the value of the voice record component.
      Returns:
      the value of the voice record component
    • caption

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

      public Optional<List<MessageEntity>> captionEntities()
      Returns the value of the captionEntities record component.
      Returns:
      the value of the captionEntities record component
    • contact

      public Optional<Contact> contact()
      Returns the value of the contact record component.
      Returns:
      the value of the contact record component
    • dice

      public Optional<Dice> dice()
      Returns the value of the dice record component.
      Returns:
      the value of the dice record component
    • game

      public Optional<Game> game()
      Returns the value of the game record component.
      Returns:
      the value of the game record component
    • poll

      public Optional<Poll> poll()
      Returns the value of the poll record component.
      Returns:
      the value of the poll record component
    • location

      public Optional<Location> location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • newChatMembers

      public Optional<List<User>> newChatMembers()
      Returns the value of the newChatMembers record component.
      Returns:
      the value of the newChatMembers record component
    • leftChatMember

      public Optional<User> leftChatMember()
      Returns the value of the leftChatMember record component.
      Returns:
      the value of the leftChatMember record component
    • newChatTitle

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

      public Optional<List<PhotoSize>> newChatPhoto()
      Returns the value of the newChatPhoto record component.
      Returns:
      the value of the newChatPhoto record component
    • deleteChatPhoto

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

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

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

      public Optional<MessageAutoDeleteTimerChanged> messageAutoDeleteTimerChanged()
      Returns the value of the messageAutoDeleteTimerChanged record component.
      Returns:
      the value of the messageAutoDeleteTimerChanged record component
    • migrateToChatId

      public Optional<Integer> migrateToChatId()
      Returns the value of the migrateToChatId record component.
      Returns:
      the value of the migrateToChatId record component
    • migrateFromChatId

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

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

      public Optional<Invoice> invoice()
      Returns the value of the invoice record component.
      Returns:
      the value of the invoice record component
    • successfulPayment

      public Optional<SuccessfulPayment> successfulPayment()
      Returns the value of the successfulPayment record component.
      Returns:
      the value of the successfulPayment record component
    • connectedWebsite

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

      public Optional<PassportData> passportData()
      Returns the value of the passportData record component.
      Returns:
      the value of the passportData record component
    • proximityAlertTriggered

      public Optional<ProximityAlertTriggered> proximityAlertTriggered()
      Returns the value of the proximityAlertTriggered record component.
      Returns:
      the value of the proximityAlertTriggered record component
    • voiceChatScheduled

      public Optional<VoiceChatScheduled> voiceChatScheduled()
      Returns the value of the voiceChatScheduled record component.
      Returns:
      the value of the voiceChatScheduled record component
    • voiceChatStarted

      public Optional<VoiceChatStarted> voiceChatStarted()
      Returns the value of the voiceChatStarted record component.
      Returns:
      the value of the voiceChatStarted record component
    • voiceChatEnded

      public Optional<VoiceChatEnded> voiceChatEnded()
      Returns the value of the voiceChatEnded record component.
      Returns:
      the value of the voiceChatEnded record component
    • voiceChatParticipantsInvited

      public Optional<VoiceChatParticipantsInvited> voiceChatParticipantsInvited()
      Returns the value of the voiceChatParticipantsInvited record component.
      Returns:
      the value of the voiceChatParticipantsInvited record component
    • replyMarkup

      public Optional<InlineKeyboardMarkup> replyMarkup()
      Returns the value of the replyMarkup record component.
      Returns:
      the value of the replyMarkup record component