java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.button.ListMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ButtonMessage,ContextualMessage,Message
public record ListMessage(String title, Optional<String> description, String button, ListMessage.Type listType, List<ButtonSection> sections, Optional<ProductListInfo> productListInfo, Optional<String> footer, Optional<ContextInfo> contextInfo)
extends Record
implements ContextualMessage, ButtonMessage
A model class that represents a message that contains a list of buttons or a list of products
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe constants of this enumerated type describe the various types ofListMessage -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thebuttonrecord component.private final Optional<ContextInfo> The field for thecontextInforecord component.The field for thedescriptionrecord component.The field for thefooterrecord component.private final ListMessage.TypeThe field for thelistTyperecord component.private final Optional<ProductListInfo> The field for theproductListInforecord component.private final List<ButtonSection> The field for thesectionsrecord component.private final StringThe field for thetitlerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionListMessage(String title, Optional<String> description, String button, ListMessage.Type listType, List<ButtonSection> sections, Optional<ProductListInfo> productListInfo, Optional<String> footer, Optional<ContextInfo> contextInfo) Creates an instance of aListMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbutton()Returns the value of thebuttonrecord component.Returns the value of thecontextInforecord component.Returns the value of thedescriptionrecord 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.listType()Returns the value of thelistTyperecord component.Returns the value of theproductListInforecord component.sections()Returns the value of thesectionsrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.type()Return message typeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface it.auties.whatsapp.model.message.model.ButtonMessage
category
-
Field Details
-
title
The field for thetitlerecord component. -
description
The field for thedescriptionrecord component. -
button
The field for thebuttonrecord component. -
listType
The field for thelistTyperecord component. -
sections
The field for thesectionsrecord component. -
productListInfo
The field for theproductListInforecord component. -
contextInfo
The field for thecontextInforecord component.
-
-
Constructor Details
-
ListMessage
public ListMessage(String title, Optional<String> description, String button, ListMessage.Type listType, List<ButtonSection> sections, Optional<ProductListInfo> productListInfo, Optional<String> footer, Optional<ContextInfo> contextInfo) Creates an instance of aListMessagerecord class.- Parameters:
title- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentbutton- the value for thebuttonrecord componentlistType- the value for thelistTyperecord componentsections- the value for thesectionsrecord componentproductListInfo- the value for theproductListInforecord componentfooter- the value for thefooterrecord componentcontextInfo- the value for thecontextInforecord component
-
-
Method Details
-
type
Description copied from interface:MessageReturn message type -
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). -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
button
Returns the value of thebuttonrecord component.- Returns:
- the value of the
buttonrecord component
-
listType
Returns the value of thelistTyperecord component.- Returns:
- the value of the
listTyperecord component
-
sections
Returns the value of thesectionsrecord component.- Returns:
- the value of the
sectionsrecord component
-
productListInfo
Returns the value of theproductListInforecord component.- Returns:
- the value of the
productListInforecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-