Record Class ProtocolMessage

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.server.ProtocolMessage
All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage, it.auties.protobuf.model.ProtobufObject, Message, ServerMessage

public record ProtocolMessage(Optional<ChatMessageKey> key, ProtocolMessage.Type protocolType, long ephemeralExpiration, long ephemeralSettingTimestampSeconds, Optional<HistorySyncNotification> historySyncNotification, Optional<AppStateSyncKeyShare> appStateSyncKeyShare, Optional<AppStateSyncKeyRequest> appStateSyncKeyRequest, Optional<InitialSecurityNotificationSettingSync> initialSecurityNotificationSettingSync, Optional<AppStateFatalExceptionNotification> appStateFatalExceptionNotification, Optional<ChatDisappear> disappearingMode, Optional<MessageContainer> editedMessage, long timestampMilliseconds) extends Record implements ServerMessage
A model class that represents a message sent by a WhatsappWeb.
  • Field Details

    • key

      private final Optional<ChatMessageKey> key
      The field for the key record component.
    • protocolType

      private final ProtocolMessage.Type protocolType
      The field for the protocolType record component.
    • ephemeralExpiration

      private final long ephemeralExpiration
      The field for the ephemeralExpiration record component.
    • ephemeralSettingTimestampSeconds

      private final long ephemeralSettingTimestampSeconds
      The field for the ephemeralSettingTimestampSeconds record component.
    • historySyncNotification

      private final Optional<HistorySyncNotification> historySyncNotification
      The field for the historySyncNotification record component.
    • appStateSyncKeyShare

      private final Optional<AppStateSyncKeyShare> appStateSyncKeyShare
      The field for the appStateSyncKeyShare record component.
    • appStateSyncKeyRequest

      private final Optional<AppStateSyncKeyRequest> appStateSyncKeyRequest
      The field for the appStateSyncKeyRequest record component.
    • initialSecurityNotificationSettingSync

      private final Optional<InitialSecurityNotificationSettingSync> initialSecurityNotificationSettingSync
      The field for the initialSecurityNotificationSettingSync record component.
    • appStateFatalExceptionNotification

      private final Optional<AppStateFatalExceptionNotification> appStateFatalExceptionNotification
      The field for the appStateFatalExceptionNotification record component.
    • disappearingMode

      private final Optional<ChatDisappear> disappearingMode
      The field for the disappearingMode record component.
    • editedMessage

      private final Optional<MessageContainer> editedMessage
      The field for the editedMessage record component.
    • timestampMilliseconds

      private final long timestampMilliseconds
      The field for the timestampMilliseconds record component.
  • Constructor Details

    • ProtocolMessage

      public ProtocolMessage(Optional<ChatMessageKey> key, ProtocolMessage.Type protocolType, long ephemeralExpiration, long ephemeralSettingTimestampSeconds, Optional<HistorySyncNotification> historySyncNotification, Optional<AppStateSyncKeyShare> appStateSyncKeyShare, Optional<AppStateSyncKeyRequest> appStateSyncKeyRequest, Optional<InitialSecurityNotificationSettingSync> initialSecurityNotificationSettingSync, Optional<AppStateFatalExceptionNotification> appStateFatalExceptionNotification, Optional<ChatDisappear> disappearingMode, Optional<MessageContainer> editedMessage, long timestampMilliseconds)
      Creates an instance of a ProtocolMessage record class.
      Parameters:
      key - the value for the key record component
      protocolType - the value for the protocolType record component
      ephemeralExpiration - the value for the ephemeralExpiration record component
      ephemeralSettingTimestampSeconds - the value for the ephemeralSettingTimestampSeconds record component
      historySyncNotification - the value for the historySyncNotification record component
      appStateSyncKeyShare - the value for the appStateSyncKeyShare record component
      appStateSyncKeyRequest - the value for the appStateSyncKeyRequest record component
      initialSecurityNotificationSettingSync - the value for the initialSecurityNotificationSettingSync record component
      appStateFatalExceptionNotification - the value for the appStateFatalExceptionNotification record component
      disappearingMode - the value for the disappearingMode record component
      editedMessage - the value for the editedMessage record component
      timestampMilliseconds - the value for the timestampMilliseconds 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.
    • key

      public Optional<ChatMessageKey> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • protocolType

      public ProtocolMessage.Type protocolType()
      Returns the value of the protocolType record component.
      Returns:
      the value of the protocolType record component
    • ephemeralExpiration

      public long ephemeralExpiration()
      Returns the value of the ephemeralExpiration record component.
      Returns:
      the value of the ephemeralExpiration record component
    • ephemeralSettingTimestampSeconds

      public long ephemeralSettingTimestampSeconds()
      Returns the value of the ephemeralSettingTimestampSeconds record component.
      Returns:
      the value of the ephemeralSettingTimestampSeconds record component
    • historySyncNotification

      public Optional<HistorySyncNotification> historySyncNotification()
      Returns the value of the historySyncNotification record component.
      Returns:
      the value of the historySyncNotification record component
    • appStateSyncKeyShare

      public Optional<AppStateSyncKeyShare> appStateSyncKeyShare()
      Returns the value of the appStateSyncKeyShare record component.
      Returns:
      the value of the appStateSyncKeyShare record component
    • appStateSyncKeyRequest

      public Optional<AppStateSyncKeyRequest> appStateSyncKeyRequest()
      Returns the value of the appStateSyncKeyRequest record component.
      Returns:
      the value of the appStateSyncKeyRequest record component
    • initialSecurityNotificationSettingSync

      public Optional<InitialSecurityNotificationSettingSync> initialSecurityNotificationSettingSync()
      Returns the value of the initialSecurityNotificationSettingSync record component.
      Returns:
      the value of the initialSecurityNotificationSettingSync record component
    • appStateFatalExceptionNotification

      public Optional<AppStateFatalExceptionNotification> appStateFatalExceptionNotification()
      Returns the value of the appStateFatalExceptionNotification record component.
      Returns:
      the value of the appStateFatalExceptionNotification record component
    • disappearingMode

      public Optional<ChatDisappear> disappearingMode()
      Returns the value of the disappearingMode record component.
      Returns:
      the value of the disappearingMode record component
    • editedMessage

      public Optional<MessageContainer> editedMessage()
      Returns the value of the editedMessage record component.
      Returns:
      the value of the editedMessage record component
    • timestampMilliseconds

      public long timestampMilliseconds()
      Returns the value of the timestampMilliseconds record component.
      Returns:
      the value of the timestampMilliseconds record component