Record Class HydratedFourRowTemplate

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.template.hydrated.HydratedFourRowTemplate
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject, TemplateFormatter

public record HydratedFourRowTemplate(Optional<DocumentMessage> titleDocument, Optional<HydratedFourRowTemplateTextTitle> titleText, Optional<ImageMessage> titleImage, Optional<VideoOrGifMessage> titleVideo, Optional<LocationMessage> titleLocation, String body, Optional<String> footer, List<HydratedTemplateButton> hydratedButtons, String templateId) extends Record implements TemplateFormatter
A model class that represents a hydrated four row template
  • Field Details

    • titleDocument

      private final Optional<DocumentMessage> titleDocument
      The field for the titleDocument record component.
    • titleText

      private final Optional<HydratedFourRowTemplateTextTitle> titleText
      The field for the titleText record component.
    • titleImage

      private final Optional<ImageMessage> titleImage
      The field for the titleImage record component.
    • titleVideo

      private final Optional<VideoOrGifMessage> titleVideo
      The field for the titleVideo record component.
    • titleLocation

      private final Optional<LocationMessage> titleLocation
      The field for the titleLocation record component.
    • body

      private final String body
      The field for the body record component.
    • hydratedButtons

      private final List<HydratedTemplateButton> hydratedButtons
      The field for the hydratedButtons record component.
    • templateId

      private final String templateId
      The field for the templateId record component.
  • Constructor Details

    • HydratedFourRowTemplate

      public HydratedFourRowTemplate(Optional<DocumentMessage> titleDocument, Optional<HydratedFourRowTemplateTextTitle> titleText, Optional<ImageMessage> titleImage, Optional<VideoOrGifMessage> titleVideo, Optional<LocationMessage> titleLocation, String body, Optional<String> footer, List<HydratedTemplateButton> hydratedButtons, String templateId)
      Creates an instance of a HydratedFourRowTemplate record class.
      Parameters:
      titleDocument - the value for the titleDocument record component
      titleText - the value for the titleText record component
      titleImage - the value for the titleImage record component
      titleVideo - the value for the titleVideo record component
      titleLocation - the value for the titleLocation record component
      body - the value for the body record component
      footer - the value for the footer record component
      hydratedButtons - the value for the hydratedButtons record component
      templateId - the value for the templateId record component
  • Method Details

    • customBuilder

      static HydratedFourRowTemplate customBuilder(HydratedFourRowTemplateTitle title, String body, String footer, List<HydratedTemplateButton> buttons, String templateId)
    • getIndexedButtons

      private static List<HydratedTemplateButton> getIndexedButtons(List<HydratedTemplateButton> buttons)
    • titleType

      Returns the type of title that this template wraps
      Returns:
      a non-null title type
    • title

      public Optional<? extends HydratedFourRowTemplateTitle> title()
      Returns the title of this template
      Returns:
      an optional
    • templateType

      public TemplateFormatter.Type templateType()
      Description copied from interface: TemplateFormatter
      Returns the type of this formatter
      Specified by:
      templateType in interface TemplateFormatter
      Returns:
      a non-null 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • titleDocument

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

      Returns the value of the titleText record component.
      Returns:
      the value of the titleText record component
    • titleImage

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

      public Optional<VideoOrGifMessage> titleVideo()
      Returns the value of the titleVideo record component.
      Returns:
      the value of the titleVideo record component
    • titleLocation

      public Optional<LocationMessage> titleLocation()
      Returns the value of the titleLocation record component.
      Returns:
      the value of the titleLocation record component
    • body

      public String body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • footer

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

      public List<HydratedTemplateButton> hydratedButtons()
      Returns the value of the hydratedButtons record component.
      Returns:
      the value of the hydratedButtons record component
    • templateId

      public String templateId()
      Returns the value of the templateId record component.
      Returns:
      the value of the templateId record component