Record Class HighlyStructuredLocalizableParameter

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

public record HighlyStructuredLocalizableParameter(String defaultValue, Optional<HighlyStructuredCurrency> parameterCurrency, Optional<HighlyStructuredDateTime> parameterDateTime) extends Record implements it.auties.protobuf.model.ProtobufMessage
A model class that represents a time a localizable parameter
  • Field Details

    • defaultValue

      private final String defaultValue
      The field for the defaultValue record component.
    • parameterCurrency

      private final Optional<HighlyStructuredCurrency> parameterCurrency
      The field for the parameterCurrency record component.
    • parameterDateTime

      private final Optional<HighlyStructuredDateTime> parameterDateTime
      The field for the parameterDateTime record component.
  • Constructor Details

    • HighlyStructuredLocalizableParameter

      public HighlyStructuredLocalizableParameter(String defaultValue, Optional<HighlyStructuredCurrency> parameterCurrency, Optional<HighlyStructuredDateTime> parameterDateTime)
      Creates an instance of a HighlyStructuredLocalizableParameter record class.
      Parameters:
      defaultValue - the value for the defaultValue record component
      parameterCurrency - the value for the parameterCurrency record component
      parameterDateTime - the value for the parameterDateTime record component
  • Method Details

    • of

      Constructs a new localizable parameter with a default value and a parameter
      Parameters:
      defaultValue - the default value
      parameter - the parameter
      Returns:
      a non-null localizable parameter
    • parameterType

      Returns the type of parameter that this message wraps
      Returns:
      a non-null parameter type
    • parameter

      public Optional<? extends HighlyStructuredLocalizableParameterValue> parameter()
      Returns the parameter that this message wraps
      Returns:
      a non-null optional
    • 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.
    • defaultValue

      public String defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component
    • parameterCurrency

      public Optional<HighlyStructuredCurrency> parameterCurrency()
      Returns the value of the parameterCurrency record component.
      Returns:
      the value of the parameterCurrency record component
    • parameterDateTime

      public Optional<HighlyStructuredDateTime> parameterDateTime()
      Returns the value of the parameterDateTime record component.
      Returns:
      the value of the parameterDateTime record component