Module it.auties.cobalt
Record Class MessageContainer
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.model.MessageContainer
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject
public record MessageContainer(Optional<String> textWithNoContextMessage, Optional<SenderKeyDistributionMessage> senderKeyDistributionMessage, Optional<ImageMessage> imageMessage, Optional<ContactMessage> contactMessage, Optional<LocationMessage> locationMessage, Optional<TextMessage> textMessage, Optional<DocumentMessage> documentMessage, Optional<AudioMessage> audioMessage, Optional<VideoOrGifMessage> videoMessage, Optional<CallMessage> callMessage, Optional<ProtocolMessage> protocolMessage, Optional<ContactsMessage> contactsArrayMessage, Optional<HighlyStructuredMessage> highlyStructuredMessage, Optional<SendPaymentMessage> sendPaymentMessage, Optional<LiveLocationMessage> liveLocationMessage, Optional<RequestPaymentMessage> requestPaymentMessage, Optional<DeclinePaymentRequestMessage> declinePaymentRequestMessage, Optional<CancelPaymentRequestMessage> cancelPaymentRequestMessage, Optional<TemplateMessage> templateMessage, Optional<StickerMessage> stickerMessage, Optional<GroupInviteMessage> groupInviteMessage, Optional<TemplateReplyMessage> templateReplyMessage, Optional<ProductMessage> productMessage, Optional<DeviceSentMessage> deviceSentMessage, Optional<DeviceSyncMessage> deviceSyncMessage, Optional<ListMessage> listMessage, Optional<FutureMessageContainer> viewOnceMessage, Optional<PaymentOrderMessage> orderMessage, Optional<ListResponseMessage> listResponseMessage, Optional<FutureMessageContainer> ephemeralMessage, Optional<PaymentInvoiceMessage> invoiceMessage, Optional<ButtonsMessage> buttonsMessage, Optional<ButtonsResponseMessage> buttonsResponseMessage, Optional<PaymentInviteMessage> paymentInviteMessage, Optional<InteractiveMessage> interactiveMessage, Optional<ReactionMessage> reactionMessage, Optional<StickerSyncRMRMessage> stickerSyncMessage, Optional<InteractiveResponseMessage> interactiveResponseMessage, Optional<PollCreationMessage> pollCreationMessage, Optional<PollUpdateMessage> pollUpdateMessage, Optional<KeepInChatMessage> keepInChatMessage, Optional<FutureMessageContainer> documentWithCaptionMessage, Optional<RequestPhoneNumberMessage> requestPhoneNumberMessage, Optional<FutureMessageContainer> viewOnceV2Message, Optional<EncryptedReactionMessage> encryptedReactionMessage, Optional<FutureMessageContainer> editedMessage, Optional<FutureMessageContainer> viewOnceV2ExtensionMessage, Optional<DeviceContextInfo> deviceInfo)
extends Record
implements it.auties.protobuf.model.ProtobufMessage
A container for all types of messages known currently to WhatsappWeb.
Only one of these properties should be populated, however it's not certain as Whatsapp's Protobuf doesn't use a one of instruction as it would be logical to in said case. This may imply that in some particular and rare cases more than one property can be populated.
There are several categories of messages:
- Server messages
- Button messages
- Product messages
- Payment messages
- Standard messages
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<AudioMessage> The field for theaudioMessagerecord component.private final Optional<ButtonsMessage> The field for thebuttonsMessagerecord component.private final Optional<ButtonsResponseMessage> The field for thebuttonsResponseMessagerecord component.private final Optional<CallMessage> The field for thecallMessagerecord component.private final Optional<CancelPaymentRequestMessage> The field for thecancelPaymentRequestMessagerecord component.private final Optional<ContactMessage> The field for thecontactMessagerecord component.private final Optional<ContactsMessage> The field for thecontactsArrayMessagerecord component.private final Optional<DeclinePaymentRequestMessage> The field for thedeclinePaymentRequestMessagerecord component.private final Optional<DeviceContextInfo> The field for thedeviceInforecord component.private final Optional<DeviceSentMessage> The field for thedeviceSentMessagerecord component.private final Optional<DeviceSyncMessage> The field for thedeviceSyncMessagerecord component.private final Optional<DocumentMessage> The field for thedocumentMessagerecord component.private final Optional<FutureMessageContainer> The field for thedocumentWithCaptionMessagerecord component.private final Optional<FutureMessageContainer> The field for theeditedMessagerecord component.private static final EmptyMessageAn empty messageprivate final Optional<EncryptedReactionMessage> The field for theencryptedReactionMessagerecord component.private final Optional<FutureMessageContainer> The field for theephemeralMessagerecord component.private final Optional<GroupInviteMessage> The field for thegroupInviteMessagerecord component.private final Optional<HighlyStructuredMessage> The field for thehighlyStructuredMessagerecord component.private final Optional<ImageMessage> The field for theimageMessagerecord component.private final Optional<InteractiveMessage> The field for theinteractiveMessagerecord component.private final Optional<InteractiveResponseMessage> The field for theinteractiveResponseMessagerecord component.private final Optional<PaymentInvoiceMessage> The field for theinvoiceMessagerecord component.private final Optional<KeepInChatMessage> The field for thekeepInChatMessagerecord component.private final Optional<ListMessage> The field for thelistMessagerecord component.private final Optional<ListResponseMessage> The field for thelistResponseMessagerecord component.private final Optional<LiveLocationMessage> The field for theliveLocationMessagerecord component.private final Optional<LocationMessage> The field for thelocationMessagerecord component.private final Optional<PaymentOrderMessage> The field for theorderMessagerecord component.private final Optional<PaymentInviteMessage> The field for thepaymentInviteMessagerecord component.private final Optional<PollCreationMessage> The field for thepollCreationMessagerecord component.private final Optional<PollUpdateMessage> The field for thepollUpdateMessagerecord component.private final Optional<ProductMessage> The field for theproductMessagerecord component.private final Optional<ProtocolMessage> The field for theprotocolMessagerecord component.private final Optional<ReactionMessage> The field for thereactionMessagerecord component.private final Optional<RequestPaymentMessage> The field for therequestPaymentMessagerecord component.private final Optional<RequestPhoneNumberMessage> The field for therequestPhoneNumberMessagerecord component.private final Optional<SenderKeyDistributionMessage> The field for thesenderKeyDistributionMessagerecord component.private final Optional<SendPaymentMessage> The field for thesendPaymentMessagerecord component.private final Optional<StickerMessage> The field for thestickerMessagerecord component.private final Optional<StickerSyncRMRMessage> The field for thestickerSyncMessagerecord component.private final Optional<TemplateMessage> The field for thetemplateMessagerecord component.private final Optional<TemplateReplyMessage> The field for thetemplateReplyMessagerecord component.private final Optional<TextMessage> The field for thetextMessagerecord component.The field for thetextWithNoContextMessagerecord component.private final Optional<VideoOrGifMessage> The field for thevideoMessagerecord component.private final Optional<FutureMessageContainer> The field for theviewOnceMessagerecord component.private final Optional<FutureMessageContainer> The field for theviewOnceV2ExtensionMessagerecord component.private final Optional<FutureMessageContainer> The field for theviewOnceV2Messagerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMessageContainer(Optional<String> textWithNoContextMessage, Optional<SenderKeyDistributionMessage> senderKeyDistributionMessage, Optional<ImageMessage> imageMessage, Optional<ContactMessage> contactMessage, Optional<LocationMessage> locationMessage, Optional<TextMessage> textMessage, Optional<DocumentMessage> documentMessage, Optional<AudioMessage> audioMessage, Optional<VideoOrGifMessage> videoMessage, Optional<CallMessage> callMessage, Optional<ProtocolMessage> protocolMessage, Optional<ContactsMessage> contactsArrayMessage, Optional<HighlyStructuredMessage> highlyStructuredMessage, Optional<SendPaymentMessage> sendPaymentMessage, Optional<LiveLocationMessage> liveLocationMessage, Optional<RequestPaymentMessage> requestPaymentMessage, Optional<DeclinePaymentRequestMessage> declinePaymentRequestMessage, Optional<CancelPaymentRequestMessage> cancelPaymentRequestMessage, Optional<TemplateMessage> templateMessage, Optional<StickerMessage> stickerMessage, Optional<GroupInviteMessage> groupInviteMessage, Optional<TemplateReplyMessage> templateReplyMessage, Optional<ProductMessage> productMessage, Optional<DeviceSentMessage> deviceSentMessage, Optional<DeviceSyncMessage> deviceSyncMessage, Optional<ListMessage> listMessage, Optional<FutureMessageContainer> viewOnceMessage, Optional<PaymentOrderMessage> orderMessage, Optional<ListResponseMessage> listResponseMessage, Optional<FutureMessageContainer> ephemeralMessage, Optional<PaymentInvoiceMessage> invoiceMessage, Optional<ButtonsMessage> buttonsMessage, Optional<ButtonsResponseMessage> buttonsResponseMessage, Optional<PaymentInviteMessage> paymentInviteMessage, Optional<InteractiveMessage> interactiveMessage, Optional<ReactionMessage> reactionMessage, Optional<StickerSyncRMRMessage> stickerSyncMessage, Optional<InteractiveResponseMessage> interactiveResponseMessage, Optional<PollCreationMessage> pollCreationMessage, Optional<PollUpdateMessage> pollUpdateMessage, Optional<KeepInChatMessage> keepInChatMessage, Optional<FutureMessageContainer> documentWithCaptionMessage, Optional<RequestPhoneNumberMessage> requestPhoneNumberMessage, Optional<FutureMessageContainer> viewOnceV2Message, Optional<EncryptedReactionMessage> encryptedReactionMessage, Optional<FutureMessageContainer> editedMessage, Optional<FutureMessageContainer> viewOnceV2ExtensionMessage, Optional<DeviceContextInfo> deviceInfo) Creates an instance of aMessageContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaudioMessagerecord component.Returns the value of thebuttonsMessagerecord component.Returns the value of thebuttonsResponseMessagerecord component.Returns the value of thecallMessagerecord component.Returns the value of thecancelPaymentRequestMessagerecord component.category()Returns the category of the messageReturns the value of thecontactMessagerecord component.Returns the value of thecontactsArrayMessagerecord component.content()Returns the first populated message inside this container.Returns the first populated contextual message inside this containerReturns the value of thedeclinePaymentRequestMessagerecord component.deepType()Returns the deep type of the message unwrapping ephemeral and view once messagesReturns the value of thedeviceInforecord component.Returns the value of thedeviceSentMessagerecord component.Returns the value of thedeviceSyncMessagerecord component.Returns the value of thedocumentMessagerecord component.Returns the value of thedocumentWithCaptionMessagerecord component.Returns the value of theeditedMessagerecord component.static MessageContainerempty()Returns an empty message containerReturns the value of theencryptedReactionMessagerecord component.Returns the value of theephemeralMessagerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegroupInviteMessagerecord component.booleanhasCategory(MessageCategory category) Checks whether the message that this container wraps matches the provided categoryfinal inthashCode()Returns a hash code value for this object.booleanhasType(MessageType type) Checks whether the message that this container wraps matches the provided typeReturns the value of thehighlyStructuredMessagerecord component.Returns the value of theimageMessagerecord component.Returns the value of theinteractiveMessagerecord component.Returns the value of theinteractiveResponseMessagerecord component.Returns the value of theinvoiceMessagerecord component.booleanisEmpty()Returns whether this container is emptyReturns the value of thekeepInChatMessagerecord component.Returns the value of thelistMessagerecord component.Returns the value of thelistResponseMessagerecord component.Returns the value of theliveLocationMessagerecord component.Returns the value of thelocationMessagerecord component.static MessageContainerConstructs a new MessageContainer from a text messagestatic <T extends Message>
MessageContainerof(T message) Constructs a new MessageContainer from a message of any typestatic <T extends Message>
MessageContainerBuilderofBuilder(T message) Constructs a new MessageContainerBuilder from a message of any typestatic <T extends Message>
MessageContainerofDocumentWithCaption(T message) Constructs a new MessageContainer from a document with caption messagestatic <T extends Message>
MessageContainerofEditedMessage(T message) Constructs a new MessageContainer from an edited messagestatic <T extends Message>
MessageContainerofEphemeral(T message) Constructs a new MessageContainer from a message of any type marking it as ephemeralstatic <T extends Message>
MessageContainerofViewOnce(T message) Constructs a new MessageContainer from a message of any type that can only be seen oncestatic <T extends Message>
MessageContainerofViewOnceV2(T message) Constructs a new MessageContainer from a message of any type that can only be seen once(version v2)Returns the value of theorderMessagerecord component.Returns the value of thepaymentInviteMessagerecord component.Returns the value of thepollCreationMessagerecord component.Returns the value of thepollUpdateMessagerecord component.Returns the value of theproductMessagerecord component.Returns the value of theprotocolMessagerecord component.Returns the value of thereactionMessagerecord component.Returns the value of therequestPaymentMessagerecord component.Returns the value of therequestPhoneNumberMessagerecord component.Returns the value of thesenderKeyDistributionMessagerecord component.Returns the value of thesendPaymentMessagerecord component.Returns the value of thestickerMessagerecord component.Returns the value of thestickerSyncMessagerecord component.Returns the value of thetemplateMessagerecord component.Returns the value of thetemplateReplyMessagerecord component.Returns the value of thetextMessagerecord component.Returns the value of thetextWithNoContextMessagerecord component.Converts this message to an ephemeral messagetoString()Converts this container into a StringConverts this message to a view once messagetype()Returns the type of the messageunbox()Returns an unboxed message where are all future-proof messages(i.e.Returns the value of thevideoMessagerecord component.Returns the value of theviewOnceMessagerecord component.Returns the value of theviewOnceV2ExtensionMessagerecord component.Returns the value of theviewOnceV2Messagerecord component.withDeviceInfo(DeviceContextInfo deviceInfo) Returns a copy of this container with a different device info
-
Field Details
-
textWithNoContextMessage
The field for thetextWithNoContextMessagerecord component. -
senderKeyDistributionMessage
The field for thesenderKeyDistributionMessagerecord component. -
imageMessage
The field for theimageMessagerecord component. -
contactMessage
The field for thecontactMessagerecord component. -
locationMessage
The field for thelocationMessagerecord component. -
textMessage
The field for thetextMessagerecord component. -
documentMessage
The field for thedocumentMessagerecord component. -
audioMessage
The field for theaudioMessagerecord component. -
videoMessage
The field for thevideoMessagerecord component. -
callMessage
The field for thecallMessagerecord component. -
protocolMessage
The field for theprotocolMessagerecord component. -
contactsArrayMessage
The field for thecontactsArrayMessagerecord component. -
highlyStructuredMessage
The field for thehighlyStructuredMessagerecord component. -
sendPaymentMessage
The field for thesendPaymentMessagerecord component. -
liveLocationMessage
The field for theliveLocationMessagerecord component. -
requestPaymentMessage
The field for therequestPaymentMessagerecord component. -
declinePaymentRequestMessage
The field for thedeclinePaymentRequestMessagerecord component. -
cancelPaymentRequestMessage
The field for thecancelPaymentRequestMessagerecord component. -
templateMessage
The field for thetemplateMessagerecord component. -
stickerMessage
The field for thestickerMessagerecord component. -
groupInviteMessage
The field for thegroupInviteMessagerecord component. -
templateReplyMessage
The field for thetemplateReplyMessagerecord component. -
productMessage
The field for theproductMessagerecord component. -
deviceSentMessage
The field for thedeviceSentMessagerecord component. -
deviceSyncMessage
The field for thedeviceSyncMessagerecord component. -
listMessage
The field for thelistMessagerecord component. -
viewOnceMessage
The field for theviewOnceMessagerecord component. -
orderMessage
The field for theorderMessagerecord component. -
listResponseMessage
The field for thelistResponseMessagerecord component. -
ephemeralMessage
The field for theephemeralMessagerecord component. -
invoiceMessage
The field for theinvoiceMessagerecord component. -
buttonsMessage
The field for thebuttonsMessagerecord component. -
buttonsResponseMessage
The field for thebuttonsResponseMessagerecord component. -
paymentInviteMessage
The field for thepaymentInviteMessagerecord component. -
interactiveMessage
The field for theinteractiveMessagerecord component. -
reactionMessage
The field for thereactionMessagerecord component. -
stickerSyncMessage
The field for thestickerSyncMessagerecord component. -
interactiveResponseMessage
The field for theinteractiveResponseMessagerecord component. -
pollCreationMessage
The field for thepollCreationMessagerecord component. -
pollUpdateMessage
The field for thepollUpdateMessagerecord component. -
keepInChatMessage
The field for thekeepInChatMessagerecord component. -
documentWithCaptionMessage
The field for thedocumentWithCaptionMessagerecord component. -
requestPhoneNumberMessage
The field for therequestPhoneNumberMessagerecord component. -
viewOnceV2Message
The field for theviewOnceV2Messagerecord component. -
encryptedReactionMessage
The field for theencryptedReactionMessagerecord component. -
editedMessage
The field for theeditedMessagerecord component. -
viewOnceV2ExtensionMessage
The field for theviewOnceV2ExtensionMessagerecord component. -
deviceInfo
The field for thedeviceInforecord component. -
EMPTY_MESSAGE
An empty message
-
-
Constructor Details
-
MessageContainer
public MessageContainer(Optional<String> textWithNoContextMessage, Optional<SenderKeyDistributionMessage> senderKeyDistributionMessage, Optional<ImageMessage> imageMessage, Optional<ContactMessage> contactMessage, Optional<LocationMessage> locationMessage, Optional<TextMessage> textMessage, Optional<DocumentMessage> documentMessage, Optional<AudioMessage> audioMessage, Optional<VideoOrGifMessage> videoMessage, Optional<CallMessage> callMessage, Optional<ProtocolMessage> protocolMessage, Optional<ContactsMessage> contactsArrayMessage, Optional<HighlyStructuredMessage> highlyStructuredMessage, Optional<SendPaymentMessage> sendPaymentMessage, Optional<LiveLocationMessage> liveLocationMessage, Optional<RequestPaymentMessage> requestPaymentMessage, Optional<DeclinePaymentRequestMessage> declinePaymentRequestMessage, Optional<CancelPaymentRequestMessage> cancelPaymentRequestMessage, Optional<TemplateMessage> templateMessage, Optional<StickerMessage> stickerMessage, Optional<GroupInviteMessage> groupInviteMessage, Optional<TemplateReplyMessage> templateReplyMessage, Optional<ProductMessage> productMessage, Optional<DeviceSentMessage> deviceSentMessage, Optional<DeviceSyncMessage> deviceSyncMessage, Optional<ListMessage> listMessage, Optional<FutureMessageContainer> viewOnceMessage, Optional<PaymentOrderMessage> orderMessage, Optional<ListResponseMessage> listResponseMessage, Optional<FutureMessageContainer> ephemeralMessage, Optional<PaymentInvoiceMessage> invoiceMessage, Optional<ButtonsMessage> buttonsMessage, Optional<ButtonsResponseMessage> buttonsResponseMessage, Optional<PaymentInviteMessage> paymentInviteMessage, Optional<InteractiveMessage> interactiveMessage, Optional<ReactionMessage> reactionMessage, Optional<StickerSyncRMRMessage> stickerSyncMessage, Optional<InteractiveResponseMessage> interactiveResponseMessage, Optional<PollCreationMessage> pollCreationMessage, Optional<PollUpdateMessage> pollUpdateMessage, Optional<KeepInChatMessage> keepInChatMessage, Optional<FutureMessageContainer> documentWithCaptionMessage, Optional<RequestPhoneNumberMessage> requestPhoneNumberMessage, Optional<FutureMessageContainer> viewOnceV2Message, Optional<EncryptedReactionMessage> encryptedReactionMessage, Optional<FutureMessageContainer> editedMessage, Optional<FutureMessageContainer> viewOnceV2ExtensionMessage, Optional<DeviceContextInfo> deviceInfo) Creates an instance of aMessageContainerrecord class.- Parameters:
textWithNoContextMessage- the value for thetextWithNoContextMessagerecord componentsenderKeyDistributionMessage- the value for thesenderKeyDistributionMessagerecord componentimageMessage- the value for theimageMessagerecord componentcontactMessage- the value for thecontactMessagerecord componentlocationMessage- the value for thelocationMessagerecord componenttextMessage- the value for thetextMessagerecord componentdocumentMessage- the value for thedocumentMessagerecord componentaudioMessage- the value for theaudioMessagerecord componentvideoMessage- the value for thevideoMessagerecord componentcallMessage- the value for thecallMessagerecord componentprotocolMessage- the value for theprotocolMessagerecord componentcontactsArrayMessage- the value for thecontactsArrayMessagerecord componenthighlyStructuredMessage- the value for thehighlyStructuredMessagerecord componentsendPaymentMessage- the value for thesendPaymentMessagerecord componentliveLocationMessage- the value for theliveLocationMessagerecord componentrequestPaymentMessage- the value for therequestPaymentMessagerecord componentdeclinePaymentRequestMessage- the value for thedeclinePaymentRequestMessagerecord componentcancelPaymentRequestMessage- the value for thecancelPaymentRequestMessagerecord componenttemplateMessage- the value for thetemplateMessagerecord componentstickerMessage- the value for thestickerMessagerecord componentgroupInviteMessage- the value for thegroupInviteMessagerecord componenttemplateReplyMessage- the value for thetemplateReplyMessagerecord componentproductMessage- the value for theproductMessagerecord componentdeviceSentMessage- the value for thedeviceSentMessagerecord componentdeviceSyncMessage- the value for thedeviceSyncMessagerecord componentlistMessage- the value for thelistMessagerecord componentviewOnceMessage- the value for theviewOnceMessagerecord componentorderMessage- the value for theorderMessagerecord componentlistResponseMessage- the value for thelistResponseMessagerecord componentephemeralMessage- the value for theephemeralMessagerecord componentinvoiceMessage- the value for theinvoiceMessagerecord componentbuttonsMessage- the value for thebuttonsMessagerecord componentbuttonsResponseMessage- the value for thebuttonsResponseMessagerecord componentpaymentInviteMessage- the value for thepaymentInviteMessagerecord componentinteractiveMessage- the value for theinteractiveMessagerecord componentreactionMessage- the value for thereactionMessagerecord componentstickerSyncMessage- the value for thestickerSyncMessagerecord componentinteractiveResponseMessage- the value for theinteractiveResponseMessagerecord componentpollCreationMessage- the value for thepollCreationMessagerecord componentpollUpdateMessage- the value for thepollUpdateMessagerecord componentkeepInChatMessage- the value for thekeepInChatMessagerecord componentdocumentWithCaptionMessage- the value for thedocumentWithCaptionMessagerecord componentrequestPhoneNumberMessage- the value for therequestPhoneNumberMessagerecord componentviewOnceV2Message- the value for theviewOnceV2Messagerecord componentencryptedReactionMessage- the value for theencryptedReactionMessagerecord componenteditedMessage- the value for theeditedMessagerecord componentviewOnceV2ExtensionMessage- the value for theviewOnceV2ExtensionMessagerecord componentdeviceInfo- the value for thedeviceInforecord component
-
-
Method Details
-
empty
Returns an empty message container- Returns:
- a non-null container
-
of
Constructs a new MessageContainer from a message of any type- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap- Returns:
- a non-null container
-
ofBuilder
Constructs a new MessageContainerBuilder from a message of any type- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap- Returns:
- a non-null builder
-
of
Constructs a new MessageContainer from a text message- Parameters:
message- the text message with no context
-
ofViewOnce
Constructs a new MessageContainer from a message of any type that can only be seen once- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap
-
ofViewOnceV2
Constructs a new MessageContainer from a message of any type that can only be seen once(version v2)- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap
-
ofEphemeral
Constructs a new MessageContainer from a message of any type marking it as ephemeral- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap
-
ofEditedMessage
Constructs a new MessageContainer from an edited message- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap
-
ofDocumentWithCaption
Constructs a new MessageContainer from a document with caption message- Type Parameters:
T- the type of the message- Parameters:
message- the message that the new container should wrap
-
content
Returns the first populated message inside this container. If no message is found,EmptyMessageis returned- Returns:
- a non-null message
-
contentWithContext
Returns the first populated contextual message inside this container- Returns:
- a non-null Optional ContextualMessage
-
hasType
Checks whether the message that this container wraps matches the provided type- Parameters:
type- the non-null type to check against- Returns:
- a boolean
-
hasCategory
Checks whether the message that this container wraps matches the provided category- Parameters:
category- the non-null category to check against- Returns:
- a boolean
-
type
Returns the type of the message- Returns:
- a non-null type
-
deepType
Returns the deep type of the message unwrapping ephemeral and view once messages- Returns:
- a non-null type
-
category
Returns the category of the message- Returns:
- a non-null category
-
toEphemeral
Converts this message to an ephemeral message- Returns:
- a non-null message container
-
toViewOnce
Converts this message to a view once message- Returns:
- a non-null message container
-
unbox
Returns an unboxed message where are all future-proof messages(i.e. ephemeral and view once) have been unboxed- Returns:
- a non-null message container
-
withDeviceInfo
Returns a copy of this container with a different device info- Returns:
- a non-null message container
-
isEmpty
public boolean isEmpty()Returns whether this container is empty- Returns:
- a boolean
-
toString
Converts this container into a String -
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. -
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
textWithNoContextMessage
Returns the value of thetextWithNoContextMessagerecord component.- Returns:
- the value of the
textWithNoContextMessagerecord component
-
senderKeyDistributionMessage
Returns the value of thesenderKeyDistributionMessagerecord component.- Returns:
- the value of the
senderKeyDistributionMessagerecord component
-
imageMessage
Returns the value of theimageMessagerecord component.- Returns:
- the value of the
imageMessagerecord component
-
contactMessage
Returns the value of thecontactMessagerecord component.- Returns:
- the value of the
contactMessagerecord component
-
locationMessage
Returns the value of thelocationMessagerecord component.- Returns:
- the value of the
locationMessagerecord component
-
textMessage
Returns the value of thetextMessagerecord component.- Returns:
- the value of the
textMessagerecord component
-
documentMessage
Returns the value of thedocumentMessagerecord component.- Returns:
- the value of the
documentMessagerecord component
-
audioMessage
Returns the value of theaudioMessagerecord component.- Returns:
- the value of the
audioMessagerecord component
-
videoMessage
Returns the value of thevideoMessagerecord component.- Returns:
- the value of the
videoMessagerecord component
-
callMessage
Returns the value of thecallMessagerecord component.- Returns:
- the value of the
callMessagerecord component
-
protocolMessage
Returns the value of theprotocolMessagerecord component.- Returns:
- the value of the
protocolMessagerecord component
-
contactsArrayMessage
Returns the value of thecontactsArrayMessagerecord component.- Returns:
- the value of the
contactsArrayMessagerecord component
-
highlyStructuredMessage
Returns the value of thehighlyStructuredMessagerecord component.- Returns:
- the value of the
highlyStructuredMessagerecord component
-
sendPaymentMessage
Returns the value of thesendPaymentMessagerecord component.- Returns:
- the value of the
sendPaymentMessagerecord component
-
liveLocationMessage
Returns the value of theliveLocationMessagerecord component.- Returns:
- the value of the
liveLocationMessagerecord component
-
requestPaymentMessage
Returns the value of therequestPaymentMessagerecord component.- Returns:
- the value of the
requestPaymentMessagerecord component
-
declinePaymentRequestMessage
Returns the value of thedeclinePaymentRequestMessagerecord component.- Returns:
- the value of the
declinePaymentRequestMessagerecord component
-
cancelPaymentRequestMessage
Returns the value of thecancelPaymentRequestMessagerecord component.- Returns:
- the value of the
cancelPaymentRequestMessagerecord component
-
templateMessage
Returns the value of thetemplateMessagerecord component.- Returns:
- the value of the
templateMessagerecord component
-
stickerMessage
Returns the value of thestickerMessagerecord component.- Returns:
- the value of the
stickerMessagerecord component
-
groupInviteMessage
Returns the value of thegroupInviteMessagerecord component.- Returns:
- the value of the
groupInviteMessagerecord component
-
templateReplyMessage
Returns the value of thetemplateReplyMessagerecord component.- Returns:
- the value of the
templateReplyMessagerecord component
-
productMessage
Returns the value of theproductMessagerecord component.- Returns:
- the value of the
productMessagerecord component
-
deviceSentMessage
Returns the value of thedeviceSentMessagerecord component.- Returns:
- the value of the
deviceSentMessagerecord component
-
deviceSyncMessage
Returns the value of thedeviceSyncMessagerecord component.- Returns:
- the value of the
deviceSyncMessagerecord component
-
listMessage
Returns the value of thelistMessagerecord component.- Returns:
- the value of the
listMessagerecord component
-
viewOnceMessage
Returns the value of theviewOnceMessagerecord component.- Returns:
- the value of the
viewOnceMessagerecord component
-
orderMessage
Returns the value of theorderMessagerecord component.- Returns:
- the value of the
orderMessagerecord component
-
listResponseMessage
Returns the value of thelistResponseMessagerecord component.- Returns:
- the value of the
listResponseMessagerecord component
-
ephemeralMessage
Returns the value of theephemeralMessagerecord component.- Returns:
- the value of the
ephemeralMessagerecord component
-
invoiceMessage
Returns the value of theinvoiceMessagerecord component.- Returns:
- the value of the
invoiceMessagerecord component
-
buttonsMessage
Returns the value of thebuttonsMessagerecord component.- Returns:
- the value of the
buttonsMessagerecord component
-
buttonsResponseMessage
Returns the value of thebuttonsResponseMessagerecord component.- Returns:
- the value of the
buttonsResponseMessagerecord component
-
paymentInviteMessage
Returns the value of thepaymentInviteMessagerecord component.- Returns:
- the value of the
paymentInviteMessagerecord component
-
interactiveMessage
Returns the value of theinteractiveMessagerecord component.- Returns:
- the value of the
interactiveMessagerecord component
-
reactionMessage
Returns the value of thereactionMessagerecord component.- Returns:
- the value of the
reactionMessagerecord component
-
stickerSyncMessage
Returns the value of thestickerSyncMessagerecord component.- Returns:
- the value of the
stickerSyncMessagerecord component
-
interactiveResponseMessage
Returns the value of theinteractiveResponseMessagerecord component.- Returns:
- the value of the
interactiveResponseMessagerecord component
-
pollCreationMessage
Returns the value of thepollCreationMessagerecord component.- Returns:
- the value of the
pollCreationMessagerecord component
-
pollUpdateMessage
Returns the value of thepollUpdateMessagerecord component.- Returns:
- the value of the
pollUpdateMessagerecord component
-
keepInChatMessage
Returns the value of thekeepInChatMessagerecord component.- Returns:
- the value of the
keepInChatMessagerecord component
-
documentWithCaptionMessage
Returns the value of thedocumentWithCaptionMessagerecord component.- Returns:
- the value of the
documentWithCaptionMessagerecord component
-
requestPhoneNumberMessage
Returns the value of therequestPhoneNumberMessagerecord component.- Returns:
- the value of the
requestPhoneNumberMessagerecord component
-
viewOnceV2Message
Returns the value of theviewOnceV2Messagerecord component.- Returns:
- the value of the
viewOnceV2Messagerecord component
-
encryptedReactionMessage
Returns the value of theencryptedReactionMessagerecord component.- Returns:
- the value of the
encryptedReactionMessagerecord component
-
editedMessage
Returns the value of theeditedMessagerecord component.- Returns:
- the value of the
editedMessagerecord component
-
viewOnceV2ExtensionMessage
Returns the value of theviewOnceV2ExtensionMessagerecord component.- Returns:
- the value of the
viewOnceV2ExtensionMessagerecord component
-
deviceInfo
Returns the value of thedeviceInforecord component.- Returns:
- the value of the
deviceInforecord component
-