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
A model class that represents a message holding text inside
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TextMessage.TextMessageBuilder<C extends TextMessage,
B extends TextMessage.TextMessageBuilder<C, B>> 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>> -
Constructor Summary
ModifierConstructorDescriptionprotected
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) -
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()
The substring of this text message that links tocanonicalUrl
, if availablematchedText
(String matchedText) The substring of this text message that links tocanonicalUrl
, if availablestatic 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 bytestitle()
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 typeMethods inherited from class it.auties.whatsapp.model.message.model.ContextualMessage
contextInfo, contextInfo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface it.auties.protobuf.base.ProtobufMessage
isValueBased, toValue
-
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) -
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- Returns:
- a non-null message type
-
category
Description copied from interface:Message
Return message category- Returns:
- a non-null message category
-
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 -
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
.
-
toString
- Overrides:
toString
in classContextualMessage
-
equals
- Overrides:
equals
in classContextualMessage
-
canEqual
- Overrides:
canEqual
in classContextualMessage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classContextualMessage
-