Module it.auties.cobalt
Record Class InteractiveHeader
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.interactive.InteractiveHeader
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject
public record InteractiveHeader(String title, Optional<String> subtitle, Optional<DocumentMessage> attachmentDocument, Optional<ImageMessage> attachmentImage, boolean mediaAttachment, Optional<InteractiveHeaderThumbnail> attachmentThumbnail, Optional<VideoOrGifMessage> attachmentVideo)
extends Record
implements it.auties.protobuf.model.ProtobufMessage
A model class that represents the header of a product
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<DocumentMessage> The field for theattachmentDocumentrecord component.private final Optional<ImageMessage> The field for theattachmentImagerecord component.private final Optional<InteractiveHeaderThumbnail> The field for theattachmentThumbnailrecord component.private final Optional<VideoOrGifMessage> The field for theattachmentVideorecord component.private final booleanThe field for themediaAttachmentrecord component.The field for thesubtitlerecord component.private final StringThe field for thetitlerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionInteractiveHeader(String title, Optional<String> subtitle, Optional<DocumentMessage> attachmentDocument, Optional<ImageMessage> attachmentImage, boolean mediaAttachment, Optional<InteractiveHeaderThumbnail> attachmentThumbnail, Optional<VideoOrGifMessage> attachmentVideo) Creates an instance of aInteractiveHeaderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends InteractiveHeaderAttachment> Returns the attachment of this message if presentReturns the value of theattachmentDocumentrecord component.Returns the value of theattachmentImagerecord component.Returns the value of theattachmentThumbnailrecord component.Returns the type of attachment of this messageReturns the value of theattachmentVideorecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themediaAttachmentrecord component.(package private) static InteractiveHeadersimpleBuilder(String title, String subtitle, InteractiveHeaderAttachment attachment) subtitle()Returns the value of thesubtitlerecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
title
The field for thetitlerecord component. -
subtitle
The field for thesubtitlerecord component. -
attachmentDocument
The field for theattachmentDocumentrecord component. -
attachmentImage
The field for theattachmentImagerecord component. -
mediaAttachment
private final boolean mediaAttachmentThe field for themediaAttachmentrecord component. -
attachmentThumbnail
The field for theattachmentThumbnailrecord component. -
attachmentVideo
The field for theattachmentVideorecord component.
-
-
Constructor Details
-
InteractiveHeader
public InteractiveHeader(String title, Optional<String> subtitle, Optional<DocumentMessage> attachmentDocument, Optional<ImageMessage> attachmentImage, boolean mediaAttachment, Optional<InteractiveHeaderThumbnail> attachmentThumbnail, Optional<VideoOrGifMessage> attachmentVideo) Creates an instance of aInteractiveHeaderrecord class.- Parameters:
title- the value for thetitlerecord componentsubtitle- the value for thesubtitlerecord componentattachmentDocument- the value for theattachmentDocumentrecord componentattachmentImage- the value for theattachmentImagerecord componentmediaAttachment- the value for themediaAttachmentrecord componentattachmentThumbnail- the value for theattachmentThumbnailrecord componentattachmentVideo- the value for theattachmentVideorecord component
-
-
Method Details
-
simpleBuilder
static InteractiveHeader simpleBuilder(String title, String subtitle, InteractiveHeaderAttachment attachment) -
attachmentType
Returns the type of attachment of this message- Returns:
- a non-null attachment type
-
attachment
Returns the attachment of this message if present- Returns:
- a non-null attachment 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
subtitle
Returns the value of thesubtitlerecord component.- Returns:
- the value of the
subtitlerecord component
-
attachmentDocument
Returns the value of theattachmentDocumentrecord component.- Returns:
- the value of the
attachmentDocumentrecord component
-
attachmentImage
Returns the value of theattachmentImagerecord component.- Returns:
- the value of the
attachmentImagerecord component
-
mediaAttachment
public boolean mediaAttachment()Returns the value of themediaAttachmentrecord component.- Returns:
- the value of the
mediaAttachmentrecord component
-
attachmentThumbnail
Returns the value of theattachmentThumbnailrecord component.- Returns:
- the value of the
attachmentThumbnailrecord component
-
attachmentVideo
Returns the value of theattachmentVideorecord component.- Returns:
- the value of the
attachmentVideorecord component
-