java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.button.ButtonsMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ButtonMessage,ContextualMessage,Message
public record ButtonsMessage(Optional<ButtonsMessageHeaderText> headerText, Optional<DocumentMessage> headerDocument, Optional<ImageMessage> headerImage, Optional<VideoOrGifMessage> headerVideo, Optional<LocationMessage> headerLocation, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo, List<Button> buttons, ButtonsMessageHeader.Type headerType)
extends Record
implements ButtonMessage, ContextualMessage
A model class that represents a message that contains buttons inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebodyrecord component.The field for thebuttonsrecord component.private final Optional<ContextInfo> The field for thecontextInforecord component.The field for thefooterrecord component.private final Optional<DocumentMessage> The field for theheaderDocumentrecord component.private final Optional<ImageMessage> The field for theheaderImagerecord component.private final Optional<LocationMessage> The field for theheaderLocationrecord component.private final Optional<ButtonsMessageHeaderText> The field for theheaderTextrecord component.private final ButtonsMessageHeader.TypeThe field for theheaderTyperecord component.private final Optional<VideoOrGifMessage> The field for theheaderVideorecord component. -
Constructor Summary
ConstructorsConstructorDescriptionButtonsMessage(Optional<ButtonsMessageHeaderText> headerText, Optional<DocumentMessage> headerDocument, Optional<ImageMessage> headerImage, Optional<VideoOrGifMessage> headerVideo, Optional<LocationMessage> headerLocation, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo, List<Button> buttons, ButtonsMessageHeader.Type headerType) Creates an instance of aButtonsMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.buttons()Returns the value of thebuttonsrecord component.Returns the value of thecontextInforecord component.(package private) static ButtonsMessagecustomBuilder(ButtonsMessageHeader header, String body, String footer, ContextInfo contextInfo, List<Button> buttons) 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.Optional<? extends ButtonsMessageHeader> header()Returns the header of this messageReturns the value of theheaderDocumentrecord component.Returns the value of theheaderImagerecord component.Returns the value of theheaderLocationrecord component.Returns the value of theheaderTextrecord component.Returns the value of theheaderTyperecord component.Returns the value of theheaderVideorecord component.final StringtoString()Returns a string representation of this record class.type()Returns the type of this messageMethods 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
-
headerText
The field for theheaderTextrecord component. -
headerDocument
The field for theheaderDocumentrecord component. -
headerImage
The field for theheaderImagerecord component. -
headerVideo
The field for theheaderVideorecord component. -
headerLocation
The field for theheaderLocationrecord component. -
body
The field for thebodyrecord component. -
contextInfo
The field for thecontextInforecord component. -
buttons
The field for thebuttonsrecord component. -
headerType
The field for theheaderTyperecord component.
-
-
Constructor Details
-
ButtonsMessage
public ButtonsMessage(Optional<ButtonsMessageHeaderText> headerText, Optional<DocumentMessage> headerDocument, Optional<ImageMessage> headerImage, Optional<VideoOrGifMessage> headerVideo, Optional<LocationMessage> headerLocation, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo, List<Button> buttons, ButtonsMessageHeader.Type headerType) Creates an instance of aButtonsMessagerecord class.- Parameters:
headerText- the value for theheaderTextrecord componentheaderDocument- the value for theheaderDocumentrecord componentheaderImage- the value for theheaderImagerecord componentheaderVideo- the value for theheaderVideorecord componentheaderLocation- the value for theheaderLocationrecord componentbody- the value for thebodyrecord componentfooter- the value for thefooterrecord componentcontextInfo- the value for thecontextInforecord componentbuttons- the value for thebuttonsrecord componentheaderType- the value for theheaderTyperecord component
-
-
Method Details
-
customBuilder
static ButtonsMessage customBuilder(ButtonsMessageHeader header, String body, String footer, ContextInfo contextInfo, List<Button> buttons) -
type
Returns the type of this message -
header
Returns the header of this message- Returns:
- an optional
-
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). -
headerText
Returns the value of theheaderTextrecord component.- Returns:
- the value of the
headerTextrecord component
-
headerDocument
Returns the value of theheaderDocumentrecord component.- Returns:
- the value of the
headerDocumentrecord component
-
headerImage
Returns the value of theheaderImagerecord component.- Returns:
- the value of the
headerImagerecord component
-
headerVideo
Returns the value of theheaderVideorecord component.- Returns:
- the value of the
headerVideorecord component
-
headerLocation
Returns the value of theheaderLocationrecord component.- Returns:
- the value of the
headerLocationrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-
buttons
Returns the value of thebuttonsrecord component.- Returns:
- the value of the
buttonsrecord component
-
headerType
Returns the value of theheaderTyperecord component.- Returns:
- the value of the
headerTyperecord component
-