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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
TextMessage.TextMessageBuilder<C extends TextMessage,
B extends TextMessage.TextMessageBuilder<C, B>> (package private) static final class
static enum
The constants of this enumerated type describe the various types of fonts that aTextMessage
supports.static enum
The constants of this enumerated type describe the various types of previuew that aTextMessage
can provide.Nested classes/interfaces inherited from class it.auties.whatsapp.model.message.model.ContextualMessage
ContextualMessage.ContextualMessageBuilder<C extends ContextualMessage,
B extends ContextualMessage.ContextualMessageBuilder<C, B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Integer
The background color of this text message encoded as ARGBprivate String
The canonical url of the link that this text message wraps, if availableprivate String
The description of the link that this text message wraps, if availableprivate boolean
Determines whether the preview can be played inlineprivate TextMessage.TextMessageFontType
The type of font used for the text message.private TextMessage.InviteLinkGroupType
private TextMessage.InviteLinkGroupType
private String
private byte[]
private String
The substring of this text message that links tocanonicalUrl
, if availableprivate byte[]
private Long
The type of preview that this text message provides.private String
The text that this message wrapsprivate Integer
The color of this text message encoded as ARGBprivate byte[]
The thumbnail for this text message encoded as jpeg in an array of bytesprivate String
private byte[]
private Integer
private byte[]
private Integer
private String
The title of the link that this text message wraps, if availableprivate boolean
Fields inherited from class it.auties.whatsapp.model.message.model.ContextualMessage
contextInfo
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TextMessage
(String text) Constructs a TextMessage from a textTextMessage
(String text, String matchedText, String canonicalUrl, String description, String title, Integer textArgb, Integer backgroundArgb, TextMessage.TextMessageFontType font, TextMessage.TextMessagePreviewType previewType, byte[] thumbnail, boolean doNotPlayInline, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, byte[] mediaKey, Long mediaKeyTimestamp, Integer thumbnailHeight, Integer thumbnailWidth, TextMessage.InviteLinkGroupType inviteLinkGroupType, String inviteLinkParentGroupSubjectV2, byte[] inviteLinkParentGroupThumbnailV2, TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2, boolean viewOnce) -
Method Summary
Modifier and TypeMethodDescriptionThe background color of this text message encoded as ARGBbackgroundArgb
(Integer backgroundArgb) The background color of this text message encoded as ARGBstatic TextMessage.TextMessageBuilder<?,
?> builder()
protected boolean
The canonical url of the link that this text message wraps, if availablecanonicalUrl
(String canonicalUrl) The canonical url of the link that this text message wraps, if availablecategory()
Return message categoryThe description of the link that this text message wraps, if availabledescription
(String description) The description of the link that this text message wraps, if availableboolean
Determines whether the preview can be played inlinedoNotPlayInline
(boolean doNotPlayInline) Determines whether the preview can be played inlineboolean
font()
The type of font used for the text message.The type of font used for the text message.int
hashCode()
Return the type of this titleinviteLinkGroupType
(TextMessage.InviteLinkGroupType inviteLinkGroupType) inviteLinkGroupTypeV2
(TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2) inviteLinkParentGroupSubjectV2
(String inviteLinkParentGroupSubjectV2) byte[]
inviteLinkParentGroupThumbnailV2
(byte[] inviteLinkParentGroupThumbnailV2) The substring of this text message that links tocanonicalUrl
, if availablematchedText
(String matchedText) The substring of this text message that links tocanonicalUrl
, if availablebyte[]
mediaKey()
mediaKey
(byte[] mediaKey) mediaKeyTimestamp
(Long mediaKeyTimestamp) static TextMessage
Constructs a TextMessage from a textThe type of preview that this text message provides.previewType
(TextMessage.TextMessagePreviewType previewType) The type of preview that this text message provides.text()
The text that this message wrapsThe text that this message wrapstextArgb()
The color of this text message encoded as ARGBThe color of this text message encoded as ARGBbyte[]
The thumbnail for this text message encoded as jpeg in an array of bytesthumbnail
(byte[] thumbnail) The thumbnail for this text message encoded as jpeg in an array of bytesthumbnailDirectPath
(String thumbnailDirectPath) byte[]
thumbnailEncSha256
(byte[] thumbnailEncSha256) thumbnailHeight
(Integer thumbnailHeight) byte[]
thumbnailSha256
(byte[] thumbnailSha256) thumbnailWidth
(Integer thumbnailWidth) title()
The title of the link that this text message wraps, if availableThe title of the link that this text message wraps, if availabletoString()
type()
Return message typeboolean
viewOnce()
viewOnce
(boolean viewOnce) Methods inherited from class it.auties.whatsapp.model.message.model.ContextualMessage
contextInfo, contextInfo, hasContextInfo
-
Field Details
-
text
The text that this message wraps -
matchedText
The substring of this text message that links tocanonicalUrl
, if available -
canonicalUrl
The canonical url of the link that this text message wraps, if available -
description
The description of the link that this text message wraps, if available -
title
The title of the link that this text message wraps, if available -
textArgb
The color of this text message encoded as ARGB -
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 beTextMessage.TextMessagePreviewType.VIDEO
. Not all links, though, produce a preview. -
thumbnail
private byte[] thumbnailThe thumbnail for this text message encoded as jpeg in an array of bytes -
doNotPlayInline
private boolean doNotPlayInlineDetermines whether the preview can be played inline -
thumbnailDirectPath
-
thumbnailSha256
private byte[] thumbnailSha256 -
thumbnailEncSha256
private byte[] thumbnailEncSha256 -
mediaKey
private byte[] mediaKey -
mediaKeyTimestamp
-
thumbnailHeight
-
thumbnailWidth
-
inviteLinkGroupType
-
inviteLinkParentGroupSubjectV2
-
inviteLinkParentGroupThumbnailV2
private byte[] inviteLinkParentGroupThumbnailV2 -
inviteLinkGroupTypeV2
-
viewOnce
private boolean viewOnce
-
-
Constructor Details
-
TextMessage
Constructs a TextMessage from a text- Parameters:
text
- the text to wrap
-
TextMessage
-
TextMessage
public TextMessage(String text, String matchedText, String canonicalUrl, String description, String title, Integer textArgb, Integer backgroundArgb, TextMessage.TextMessageFontType font, TextMessage.TextMessagePreviewType previewType, byte[] thumbnail, boolean doNotPlayInline, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, byte[] mediaKey, Long mediaKeyTimestamp, Integer thumbnailHeight, Integer thumbnailWidth, TextMessage.InviteLinkGroupType inviteLinkGroupType, String inviteLinkParentGroupSubjectV2, byte[] inviteLinkParentGroupThumbnailV2, TextMessage.InviteLinkGroupType inviteLinkGroupTypeV2, boolean viewOnce) -
TextMessage
public TextMessage()
-
-
Method Details
-
of
Constructs a TextMessage from a text- Parameters:
text
- the text to wrap- Returns:
- a non-null TextMessage
-
type
Description copied from interface:Message
Return message type -
category
Description copied from interface:Message
Return message category -
hydratedTitleType
Description copied from interface:HydratedFourRowTemplateTitle
Return the type of this title- Specified by:
hydratedTitleType
in interfaceHydratedFourRowTemplateTitle
- Returns:
- a non-null type
-
builder
-
text
The text that this message wraps -
matchedText
The substring of this text message that links tocanonicalUrl
, if available -
canonicalUrl
The canonical url of the link that this text message wraps, if available -
description
The description of the link that this text message wraps, if available -
title
The title of the link that this text message wraps, if available -
textArgb
The color of this text message encoded as ARGB -
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 beTextMessage.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
-
thumbnailSha256
public byte[] thumbnailSha256() -
thumbnailEncSha256
public byte[] thumbnailEncSha256() -
mediaKey
public byte[] mediaKey() -
mediaKeyTimestamp
-
thumbnailHeight
-
thumbnailWidth
-
inviteLinkGroupType
-
inviteLinkParentGroupSubjectV2
-
inviteLinkParentGroupThumbnailV2
public byte[] inviteLinkParentGroupThumbnailV2() -
inviteLinkGroupTypeV2
-
viewOnce
public boolean viewOnce() -
text
The text that this message wraps- Returns:
this
.
-
matchedText
The substring of this text message that links tocanonicalUrl
, if available- Returns:
this
.
-
canonicalUrl
The canonical url of the link that this text message wraps, if available- Returns:
this
.
-
description
The description of the link that this text message wraps, if available- Returns:
this
.
-
title
The title of the link that this text message wraps, if available- Returns:
this
.
-
textArgb
The color of this text message encoded as ARGB- Returns:
this
.
-
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
The type of preview that this text message provides. If said message contains a link, this value will probably beTextMessage.TextMessagePreviewType.VIDEO
. Not all links, though, produce a preview.- Returns:
this
.
-
thumbnail
The thumbnail for this text message encoded as jpeg in an array of bytes- Returns:
this
.
-
doNotPlayInline
Determines whether the preview can be played inline- Returns:
this
.
-
thumbnailDirectPath
- Returns:
this
.
-
thumbnailSha256
- Returns:
this
.
-
thumbnailEncSha256
- Returns:
this
.
-
mediaKey
- Returns:
this
.
-
mediaKeyTimestamp
- Returns:
this
.
-
thumbnailHeight
- Returns:
this
.
-
thumbnailWidth
- Returns:
this
.
-
inviteLinkGroupType
- Returns:
this
.
-
inviteLinkParentGroupSubjectV2
- Returns:
this
.
-
inviteLinkParentGroupThumbnailV2
- Returns:
this
.
-
inviteLinkGroupTypeV2
- Returns:
this
.
-
viewOnce
- Returns:
this
.
-
toString
- Overrides:
toString
in classContextualMessage
-
equals
- Overrides:
equals
in classContextualMessage
-
canEqual
- Overrides:
canEqual
in classContextualMessage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classContextualMessage
-