java.lang.Object
it.auties.whatsapp.model.message.model.ContextualMessage
it.auties.whatsapp.model.message.standard.TextMessage
All Implemented Interfaces:
it.auties.protobuf.base.ProtobufMessage, HydratedFourRowTemplateTitle, ButtonsMessageHeader, Message

public final class TextMessage extends ContextualMessage implements ButtonsMessageHeader, HydratedFourRowTemplateTitle
A model class that represents a message holding text inside
  • Field Details

    • text

      private String text
      The text that this message wraps
    • matchedText

      private String matchedText
      The substring of this text message that links to canonicalUrl, if available
    • canonicalUrl

      private String canonicalUrl
      The canonical url of the link that this text message wraps, if available
    • description

      private String description
      The description of the link that this text message wraps, if available
    • title

      private String title
      The title of the link that this text message wraps, if available
    • textArgb

      private Integer textArgb
      The color of this text message encoded as ARGB
    • backgroundArgb

      private Integer backgroundArgb
      The background color of this text message encoded as ARGB
    • font

      The type of font used for the text message.
    • previewType

      The type of preview that this text message provides. If said message contains a link, this value will probably be TextMessage.TextMessagePreviewType.VIDEO. Not all links, though, produce a preview.
    • thumbnail

      private byte[] thumbnail
      The thumbnail for this text message encoded as jpeg in an array of bytes
    • doNotPlayInline

      private boolean doNotPlayInline
      Determines whether the preview can be played inline
    • thumbnailDirectPath

      private String thumbnailDirectPath
    • thumbnailSha256

      private byte[] thumbnailSha256
    • thumbnailEncSha256

      private byte[] thumbnailEncSha256
    • mediaKey

      private byte[] mediaKey
    • mediaKeyTimestamp

      private Long mediaKeyTimestamp
    • thumbnailHeight

      private Integer thumbnailHeight
    • thumbnailWidth

      private Integer thumbnailWidth
    • inviteLinkGroupType

      private TextMessage.InviteLinkGroupType inviteLinkGroupType
    • inviteLinkParentGroupSubjectV2

      private String inviteLinkParentGroupSubjectV2
    • inviteLinkParentGroupThumbnailV2

      private byte[] inviteLinkParentGroupThumbnailV2
    • inviteLinkGroupTypeV2

      private TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2
    • viewOnce

      private boolean viewOnce
  • Constructor Details

  • Method Details

    • of

      public static TextMessage of(String text)
      Constructs a TextMessage from a text
      Parameters:
      text - the text to wrap
      Returns:
      a non-null TextMessage
    • type

      public MessageType type()
      Description copied from interface: Message
      Return message type
      Specified by:
      type in interface Message
      Returns:
      a non-null message type
    • category

      public MessageCategory category()
      Description copied from interface: Message
      Return message category
      Specified by:
      category in interface Message
      Returns:
      a non-null message category
    • hydratedTitleType

      public HydratedFourRowTemplateTitleType hydratedTitleType()
      Description copied from interface: HydratedFourRowTemplateTitle
      Return the type of this title
      Specified by:
      hydratedTitleType in interface HydratedFourRowTemplateTitle
      Returns:
      a non-null type
    • builder

      public static TextMessage.TextMessageBuilder<?,?> builder()
    • text

      public String text()
      The text that this message wraps
    • matchedText

      public String matchedText()
      The substring of this text message that links to canonicalUrl, if available
    • canonicalUrl

      public String canonicalUrl()
      The canonical url of the link that this text message wraps, if available
    • description

      public String description()
      The description of the link that this text message wraps, if available
    • title

      public String title()
      The title of the link that this text message wraps, if available
    • textArgb

      public Integer textArgb()
      The color of this text message encoded as ARGB
    • backgroundArgb

      public Integer backgroundArgb()
      The background color of this text message encoded as ARGB
    • font

      The type of font used for the text message.
    • previewType

      public TextMessage.TextMessagePreviewType previewType()
      The type of preview that this text message provides. If said message contains a link, this value will probably be TextMessage.TextMessagePreviewType.VIDEO. Not all links, though, produce a preview.
    • thumbnail

      public byte[] thumbnail()
      The thumbnail for this text message encoded as jpeg in an array of bytes
    • doNotPlayInline

      public boolean doNotPlayInline()
      Determines whether the preview can be played inline
    • thumbnailDirectPath

      public String thumbnailDirectPath()
    • thumbnailSha256

      public byte[] thumbnailSha256()
    • thumbnailEncSha256

      public byte[] thumbnailEncSha256()
    • mediaKey

      public byte[] mediaKey()
    • mediaKeyTimestamp

      public Long mediaKeyTimestamp()
    • thumbnailHeight

      public Integer thumbnailHeight()
    • thumbnailWidth

      public Integer thumbnailWidth()
    • inviteLinkGroupType

      public TextMessage.InviteLinkGroupType inviteLinkGroupType()
    • inviteLinkParentGroupSubjectV2

      public String inviteLinkParentGroupSubjectV2()
    • inviteLinkParentGroupThumbnailV2

      public byte[] inviteLinkParentGroupThumbnailV2()
    • inviteLinkGroupTypeV2

      public TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2()
    • viewOnce

      public boolean viewOnce()
    • text

      public TextMessage text(String text)
      The text that this message wraps
      Returns:
      this.
    • matchedText

      public TextMessage matchedText(String matchedText)
      The substring of this text message that links to canonicalUrl, if available
      Returns:
      this.
    • canonicalUrl

      public TextMessage canonicalUrl(String canonicalUrl)
      The canonical url of the link that this text message wraps, if available
      Returns:
      this.
    • description

      public TextMessage description(String description)
      The description of the link that this text message wraps, if available
      Returns:
      this.
    • title

      public TextMessage title(String title)
      The title of the link that this text message wraps, if available
      Returns:
      this.
    • textArgb

      public TextMessage textArgb(Integer textArgb)
      The color of this text message encoded as ARGB
      Returns:
      this.
    • backgroundArgb

      public TextMessage backgroundArgb(Integer backgroundArgb)
      The background color of this text message encoded as ARGB
      Returns:
      this.
    • font

      The type of font used for the text message.
      Returns:
      this.
    • previewType

      public TextMessage previewType(TextMessage.TextMessagePreviewType previewType)
      The type of preview that this text message provides. If said message contains a link, this value will probably be TextMessage.TextMessagePreviewType.VIDEO. Not all links, though, produce a preview.
      Returns:
      this.
    • thumbnail

      public TextMessage thumbnail(byte[] thumbnail)
      The thumbnail for this text message encoded as jpeg in an array of bytes
      Returns:
      this.
    • doNotPlayInline

      public TextMessage doNotPlayInline(boolean doNotPlayInline)
      Determines whether the preview can be played inline
      Returns:
      this.
    • thumbnailDirectPath

      public TextMessage thumbnailDirectPath(String thumbnailDirectPath)
      Returns:
      this.
    • thumbnailSha256

      public TextMessage thumbnailSha256(byte[] thumbnailSha256)
      Returns:
      this.
    • thumbnailEncSha256

      public TextMessage thumbnailEncSha256(byte[] thumbnailEncSha256)
      Returns:
      this.
    • mediaKey

      public TextMessage mediaKey(byte[] mediaKey)
      Returns:
      this.
    • mediaKeyTimestamp

      public TextMessage mediaKeyTimestamp(Long mediaKeyTimestamp)
      Returns:
      this.
    • thumbnailHeight

      public TextMessage thumbnailHeight(Integer thumbnailHeight)
      Returns:
      this.
    • thumbnailWidth

      public TextMessage thumbnailWidth(Integer thumbnailWidth)
      Returns:
      this.
    • inviteLinkGroupType

      public TextMessage inviteLinkGroupType(TextMessage.InviteLinkGroupType inviteLinkGroupType)
      Returns:
      this.
    • inviteLinkParentGroupSubjectV2

      public TextMessage inviteLinkParentGroupSubjectV2(String inviteLinkParentGroupSubjectV2)
      Returns:
      this.
    • inviteLinkParentGroupThumbnailV2

      public TextMessage inviteLinkParentGroupThumbnailV2(byte[] inviteLinkParentGroupThumbnailV2)
      Returns:
      this.
    • inviteLinkGroupTypeV2

      public TextMessage inviteLinkGroupTypeV2(TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2)
      Returns:
      this.
    • viewOnce

      public TextMessage viewOnce(boolean viewOnce)
      Returns:
      this.
    • toString

      public String toString()
      Overrides:
      toString in class ContextualMessage
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ContextualMessage
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class ContextualMessage
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ContextualMessage