Record Class MessageIndexInfo

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.info.MessageIndexInfo
Record Components:
type - the type of the change
chatJid - the chat where the change happened
messageId - the nullable id of the message regarding the chane
fromMe - whether the change regards yourself
All Implemented Interfaces:
Info

public record MessageIndexInfo(String type, Optional<Jid> chatJid, Optional<String> messageId, boolean fromMe) extends Record implements Info
An index that contains data about a setting change or an action
  • Field Details

    • type

      private final String type
      The field for the type record component.
    • chatJid

      private final Optional<Jid> chatJid
      The field for the chatJid record component.
    • messageId

      private final Optional<String> messageId
      The field for the messageId record component.
    • fromMe

      private final boolean fromMe
      The field for the fromMe record component.
  • Constructor Details

    • MessageIndexInfo

      public MessageIndexInfo(String type, Optional<Jid> chatJid, Optional<String> messageId, boolean fromMe)
      Creates an instance of a MessageIndexInfo record class.
      Parameters:
      type - the value for the type record component
      chatJid - the value for the chatJid record component
      messageId - the value for the messageId record component
      fromMe - the value for the fromMe record component
  • Method Details

    • of

      public static MessageIndexInfo of(String type, Jid chatJid, String messageId, boolean fromMe)
      Constructs a new message index info
      Parameters:
      type - the type of the change
      chatJid - the chat where the change happened
      messageId - the nullable id of the message regarding the chane
      fromMe - whether the change regards yourself
      Returns:
      a non-null message index info
    • ofJson

      public static MessageIndexInfo ofJson(String json)
      Constructs a new index info from a json string
      Parameters:
      json - the non-null json string
      Returns:
      a non-null index info
    • getProperty

      private static Optional<String> getProperty(List<String> list, int index)
    • 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.
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • chatJid

      public Optional<Jid> chatJid()
      Returns the value of the chatJid record component.
      Returns:
      the value of the chatJid record component
    • messageId

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

      public boolean fromMe()
      Returns the value of the fromMe record component.
      Returns:
      the value of the fromMe record component