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 Details

    • title

      private final String title
      The field for the title record component.
    • subtitle

      private final Optional<String> subtitle
      The field for the subtitle record component.
    • attachmentDocument

      private final Optional<DocumentMessage> attachmentDocument
      The field for the attachmentDocument record component.
    • attachmentImage

      private final Optional<ImageMessage> attachmentImage
      The field for the attachmentImage record component.
    • mediaAttachment

      private final boolean mediaAttachment
      The field for the mediaAttachment record component.
    • attachmentThumbnail

      private final Optional<InteractiveHeaderThumbnail> attachmentThumbnail
      The field for the attachmentThumbnail record component.
    • attachmentVideo

      private final Optional<VideoOrGifMessage> attachmentVideo
      The field for the attachmentVideo record 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 a InteractiveHeader record class.
      Parameters:
      title - the value for the title record component
      subtitle - the value for the subtitle record component
      attachmentDocument - the value for the attachmentDocument record component
      attachmentImage - the value for the attachmentImage record component
      mediaAttachment - the value for the mediaAttachment record component
      attachmentThumbnail - the value for the attachmentThumbnail record component
      attachmentVideo - the value for the attachmentVideo record component
  • Method Details

    • simpleBuilder

      static InteractiveHeader simpleBuilder(String title, String subtitle, InteractiveHeaderAttachment attachment)
    • attachmentType

      public InteractiveHeaderAttachment.Type attachmentType()
      Returns the type of attachment of this message
      Returns:
      a non-null attachment type
    • attachment

      public Optional<? extends InteractiveHeaderAttachment> attachment()
      Returns the attachment of this message if present
      Returns:
      a non-null attachment type
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • subtitle

      public Optional<String> subtitle()
      Returns the value of the subtitle record component.
      Returns:
      the value of the subtitle record component
    • attachmentDocument

      public Optional<DocumentMessage> attachmentDocument()
      Returns the value of the attachmentDocument record component.
      Returns:
      the value of the attachmentDocument record component
    • attachmentImage

      public Optional<ImageMessage> attachmentImage()
      Returns the value of the attachmentImage record component.
      Returns:
      the value of the attachmentImage record component
    • mediaAttachment

      public boolean mediaAttachment()
      Returns the value of the mediaAttachment record component.
      Returns:
      the value of the mediaAttachment record component
    • attachmentThumbnail

      public Optional<InteractiveHeaderThumbnail> attachmentThumbnail()
      Returns the value of the attachmentThumbnail record component.
      Returns:
      the value of the attachmentThumbnail record component
    • attachmentVideo

      public Optional<VideoOrGifMessage> attachmentVideo()
      Returns the value of the attachmentVideo record component.
      Returns:
      the value of the attachmentVideo record component