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, Message

public final class TextMessage extends ContextualMessage
A model class that represents a message holding text inside
  • 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
      Returns:
      a non-null message type
    • category

      public MessageCategory category()
      Description copied from interface: Message
      Return message category
      Returns:
      a non-null message category
    • 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
    • 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.
    • 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