Module it.auties.cobalt
Record Class InteractiveMessage
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.button.InteractiveMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,TemplateFormatter,ButtonMessage,ContextualMessage,Message
public record InteractiveMessage(Optional<InteractiveHeader> header, Optional<InteractiveBody> body, Optional<InteractiveFooter> footer, Optional<InteractiveShop> contentShop, Optional<InteractiveCollection> contentCollection, Optional<InteractiveNativeFlow> contentNativeFlow, Optional<ContextInfo> contextInfo)
extends Record
implements ContextualMessage, ButtonMessage, TemplateFormatter
A model class that represents a message holding an interactive message inside. Not really clear
how this could be used, contributions are welcomed.
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.auties.whatsapp.model.button.template.TemplateFormatter
TemplateFormatter.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<InteractiveBody> The field for thebodyrecord component.private final Optional<InteractiveCollection> The field for thecontentCollectionrecord component.private final Optional<InteractiveNativeFlow> The field for thecontentNativeFlowrecord component.private final Optional<InteractiveShop> The field for thecontentShoprecord component.private final Optional<ContextInfo> The field for thecontextInforecord component.private final Optional<InteractiveFooter> The field for thefooterrecord component.private final Optional<InteractiveHeader> The field for theheaderrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionInteractiveMessage(Optional<InteractiveHeader> header, Optional<InteractiveBody> body, Optional<InteractiveFooter> footer, Optional<InteractiveShop> contentShop, Optional<InteractiveCollection> contentCollection, Optional<InteractiveNativeFlow> contentNativeFlow, Optional<ContextInfo> contextInfo) Creates an instance of aInteractiveMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.category()Return message categoryOptional<? extends InteractiveMessageContent> content()Returns the content of this message if it's thereReturns the value of thecontentCollectionrecord component.Returns the value of thecontentNativeFlowrecord component.Returns the value of thecontentShoprecord component.Returns the type of content that this message wrapsReturns the value of thecontextInforecord component.final booleanIndicates whether some other object is "equal to" this one.footer()Returns the value of thefooterrecord component.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.(package private) static InteractiveMessagesimpleBuilder(InteractiveHeader header, String body, String footer, InteractiveMessageContent content, ContextInfo contextInfo) Returns the type of this formatterfinal StringtoString()Returns a string representation of this record class.type()Return message type
-
Field Details
-
header
The field for theheaderrecord component. -
body
The field for thebodyrecord component. -
contentShop
The field for thecontentShoprecord component. -
contentCollection
The field for thecontentCollectionrecord component. -
contentNativeFlow
The field for thecontentNativeFlowrecord component. -
contextInfo
The field for thecontextInforecord component.
-
-
Constructor Details
-
InteractiveMessage
public InteractiveMessage(Optional<InteractiveHeader> header, Optional<InteractiveBody> body, Optional<InteractiveFooter> footer, Optional<InteractiveShop> contentShop, Optional<InteractiveCollection> contentCollection, Optional<InteractiveNativeFlow> contentNativeFlow, Optional<ContextInfo> contextInfo) Creates an instance of aInteractiveMessagerecord class.- Parameters:
header- the value for theheaderrecord componentbody- the value for thebodyrecord componentfooter- the value for thefooterrecord componentcontentShop- the value for thecontentShoprecord componentcontentCollection- the value for thecontentCollectionrecord componentcontentNativeFlow- the value for thecontentNativeFlowrecord componentcontextInfo- the value for thecontextInforecord component
-
-
Method Details
-
simpleBuilder
static InteractiveMessage simpleBuilder(InteractiveHeader header, String body, String footer, InteractiveMessageContent content, ContextInfo contextInfo) -
contentType
Returns the type of content that this message wraps- Returns:
- a non-null content type
-
content
Returns the content of this message if it's there- Returns:
- a non-null content type
-
templateType
Description copied from interface:TemplateFormatterReturns the type of this formatter- Specified by:
templateTypein interfaceTemplateFormatter- Returns:
- a non-null type
-
type
Description copied from interface:MessageReturn message type -
category
Description copied from interface:MessageReturn message category- Specified by:
categoryin interfaceButtonMessage- Specified by:
categoryin interfaceMessage- Returns:
- a non-null message category
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
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). -
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
contentShop
Returns the value of thecontentShoprecord component.- Returns:
- the value of the
contentShoprecord component
-
contentCollection
Returns the value of thecontentCollectionrecord component.- Returns:
- the value of the
contentCollectionrecord component
-
contentNativeFlow
Returns the value of thecontentNativeFlowrecord component.- Returns:
- the value of the
contentNativeFlowrecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-