Record Class PaymentOrderMessage

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.payment.PaymentOrderMessage
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject, ContextualMessage, Message, PaymentMessage

public record PaymentOrderMessage(String id, Optional<byte[]> thumbnail, int itemCount, PaymentOrderMessage.Status status, PaymentOrderMessage.PaymentOrderSurface surface, Optional<String> message, Optional<String> title, Jid sellerId, String token, long amount, String currency, Optional<ContextInfo> contextInfo) extends Record implements ContextualMessage, PaymentMessage
A model class that represents a message to pay an order.
  • Field Details

    • id

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

      private final Optional<byte[]> thumbnail
      The field for the thumbnail record component.
    • itemCount

      private final int itemCount
      The field for the itemCount record component.
    • status

      private final PaymentOrderMessage.Status status
      The field for the status record component.
    • surface

      The field for the surface record component.
    • message

      private final Optional<String> message
      The field for the message record component.
    • title

      private final Optional<String> title
      The field for the title record component.
    • sellerId

      private final Jid sellerId
      The field for the sellerId record component.
    • token

      private final String token
      The field for the token record component.
    • amount

      private final long amount
      The field for the amount record component.
    • currency

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

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

    • PaymentOrderMessage

      public PaymentOrderMessage(String id, Optional<byte[]> thumbnail, int itemCount, PaymentOrderMessage.Status status, PaymentOrderMessage.PaymentOrderSurface surface, Optional<String> message, Optional<String> title, Jid sellerId, String token, long amount, String currency, Optional<ContextInfo> contextInfo)
      Creates an instance of a PaymentOrderMessage record class.
      Parameters:
      id - the value for the id record component
      thumbnail - the value for the thumbnail record component
      itemCount - the value for the itemCount record component
      status - the value for the status record component
      surface - the value for the surface record component
      message - the value for the message record component
      title - the value for the title record component
      sellerId - the value for the sellerId record component
      token - the value for the token record component
      amount - the value for the amount record component
      currency - the value for the currency record component
      contextInfo - the value for the contextInfo 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
    • thumbnail

      public Optional<byte[]> thumbnail()
      Returns the value of the thumbnail record component.
      Returns:
      the value of the thumbnail record component
    • itemCount

      public int itemCount()
      Returns the value of the itemCount record component.
      Returns:
      the value of the itemCount record component
    • status

      public PaymentOrderMessage.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • surface

      Returns the value of the surface record component.
      Returns:
      the value of the surface record component
    • message

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

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

      public Jid sellerId()
      Returns the value of the sellerId record component.
      Returns:
      the value of the sellerId record component
    • token

      public String token()
      Returns the value of the token record component.
      Returns:
      the value of the token record component
    • amount

      public long amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • currency

      public String currency()
      Returns the value of the currency record component.
      Returns:
      the value of the currency 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