Record Class HighlyStructuredMessage

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.template.highlyStructured.HighlyStructuredMessage
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject, HighlyStructuredFourRowTemplateTitle, ButtonMessage, Message

public record HighlyStructuredMessage(String namespace, String elementName, List<String> params, Optional<String> fallbackLg, Optional<String> fallbackLc, List<HighlyStructuredLocalizableParameter> localizableParameters, Optional<String> deterministicLg, Optional<String> deterministicLc, TemplateMessage templateMessage) extends Record implements ButtonMessage, HighlyStructuredFourRowTemplateTitle
A model class that represents a message that contains a highly structured message inside. Not really clear how this could be used, contributions are welcomed.
  • Field Details

    • namespace

      private final String namespace
      The field for the namespace record component.
    • elementName

      private final String elementName
      The field for the elementName record component.
    • params

      private final List<String> params
      The field for the params record component.
    • fallbackLg

      private final Optional<String> fallbackLg
      The field for the fallbackLg record component.
    • fallbackLc

      private final Optional<String> fallbackLc
      The field for the fallbackLc record component.
    • localizableParameters

      private final List<HighlyStructuredLocalizableParameter> localizableParameters
      The field for the localizableParameters record component.
    • deterministicLg

      private final Optional<String> deterministicLg
      The field for the deterministicLg record component.
    • deterministicLc

      private final Optional<String> deterministicLc
      The field for the deterministicLc record component.
    • templateMessage

      private final TemplateMessage templateMessage
      The field for the templateMessage record component.
  • Constructor Details

    • HighlyStructuredMessage

      public HighlyStructuredMessage(String namespace, String elementName, List<String> params, Optional<String> fallbackLg, Optional<String> fallbackLc, List<HighlyStructuredLocalizableParameter> localizableParameters, Optional<String> deterministicLg, Optional<String> deterministicLc, TemplateMessage templateMessage)
      Creates an instance of a HighlyStructuredMessage record class.
      Parameters:
      namespace - the value for the namespace record component
      elementName - the value for the elementName record component
      params - the value for the params record component
      fallbackLg - the value for the fallbackLg record component
      fallbackLc - the value for the fallbackLc record component
      localizableParameters - the value for the localizableParameters record component
      deterministicLg - the value for the deterministicLg record component
      deterministicLc - the value for the deterministicLc record component
      templateMessage - the value for the templateMessage 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
    • titleType

      Description copied from interface: HighlyStructuredFourRowTemplateTitle
      Return the type of this title
      Specified by:
      titleType in interface HighlyStructuredFourRowTemplateTitle
      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.
    • namespace

      public String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • elementName

      public String elementName()
      Returns the value of the elementName record component.
      Returns:
      the value of the elementName record component
    • params

      public List<String> params()
      Returns the value of the params record component.
      Returns:
      the value of the params record component
    • fallbackLg

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

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

      public List<HighlyStructuredLocalizableParameter> localizableParameters()
      Returns the value of the localizableParameters record component.
      Returns:
      the value of the localizableParameters record component
    • deterministicLg

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

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

      public TemplateMessage templateMessage()
      Returns the value of the templateMessage record component.
      Returns:
      the value of the templateMessage record component