Record Class TemplateReplyMessage

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.button.TemplateReplyMessage
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject, ButtonMessage, ButtonReplyMessage, ContextualMessage, Message

public record TemplateReplyMessage(String id, String buttonText, Optional<ContextInfo> contextInfo, int index) extends Record implements ButtonReplyMessage
A model class that represents a message that contains a newsletters to a previous HighlyStructuredMessage
  • Field Details

    • id

      private final String id
      The field for the id record component.
    • buttonText

      private final String buttonText
      The field for the buttonText record component.
    • contextInfo

      private final Optional<ContextInfo> contextInfo
      The field for the contextInfo record component.
    • index

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

    • TemplateReplyMessage

      public TemplateReplyMessage(String id, String buttonText, Optional<ContextInfo> contextInfo, int index)
      Creates an instance of a TemplateReplyMessage record class.
      Parameters:
      id - the value for the id record component
      buttonText - the value for the buttonText record component
      contextInfo - the value for the contextInfo record component
      index - the value for the index record component
  • Method Details

    • type

      public MessageType type()
      Description copied from interface: Message
      Return message type
      Specified by:
      type in interface Message
      Returns:
      a non-null message 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • buttonText

      public String buttonText()
      Returns the value of the buttonText record component.
      Returns:
      the value of the buttonText record component
    • contextInfo

      public Optional<ContextInfo> contextInfo()
      Returns the value of the contextInfo record component.
      Specified by:
      contextInfo in interface ContextualMessage
      Returns:
      the value of the contextInfo record component
    • index

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