Record Class HydratedTemplateButton

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

public record HydratedTemplateButton(HydratedQuickReplyButton quickReplyButton, HydratedURLButton urlButton, HydratedCallButton callButton, int index) extends Record implements it.auties.protobuf.model.ProtobufMessage
A model class that represents a hydrated template for a button
  • Field Details

    • quickReplyButton

      private final HydratedQuickReplyButton quickReplyButton
      The field for the quickReplyButton record component.
    • urlButton

      private final HydratedURLButton urlButton
      The field for the urlButton record component.
    • callButton

      private final HydratedCallButton callButton
      The field for the callButton record component.
    • index

      private final int index
      The field for the index record component.
  • Constructor Details

    • HydratedTemplateButton

      public HydratedTemplateButton(HydratedQuickReplyButton quickReplyButton, HydratedURLButton urlButton, HydratedCallButton callButton, int index)
      Creates an instance of a HydratedTemplateButton record class.
      Parameters:
      quickReplyButton - the value for the quickReplyButton record component
      urlButton - the value for the urlButton record component
      callButton - the value for the callButton record component
      index - the value for the index record component
  • Method Details

    • of

      public static HydratedTemplateButton of(HydratedButton button)
      Constructs a new template button
      Parameters:
      button - the non-null button
      Returns:
      a non-null button template
    • of

      public static HydratedTemplateButton of(int index, HydratedButton button)
      Constructs a new template button
      Parameters:
      index - the index
      button - the non-null button
      Returns:
      a non-null button template
    • button

      public Optional<HydratedButton> button()
      Returns this button
      Returns:
      a non-null optional
    • buttonType

      public HydratedButton.Type buttonType()
      Returns the type of button that this message wraps
      Returns:
      a non-null button 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.
    • quickReplyButton

      public HydratedQuickReplyButton quickReplyButton()
      Returns the value of the quickReplyButton record component.
      Returns:
      the value of the quickReplyButton record component
    • urlButton

      public HydratedURLButton urlButton()
      Returns the value of the urlButton record component.
      Returns:
      the value of the urlButton record component
    • callButton

      public HydratedCallButton callButton()
      Returns the value of the callButton record component.
      Returns:
      the value of the callButton record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component