Class SocketMessageMetadata

java.lang.Object
com.github.twitch4j.eventsub.socket.domain.SocketMessageMetadata

public class SocketMessageMetadata extends Object
An object that identifies the message sent over EventSub Websockets.
  • Constructor Details

    • SocketMessageMetadata

      public SocketMessageMetadata()
  • Method Details

    • getParsedSubscriptionType

      @Nullable public @Nullable SubscriptionType<?,?,?> getParsedSubscriptionType()
      Returns:
      the parsed SubscriptionType associated with the raw type and version contained in this metadata for a notification or revocation.
    • getMessageId

      public String getMessageId()
      An ID that uniquely identifies the message.

      Twitch sends messages at least once, but if Twitch is unsure of whether you received a notification, it’ll resend the message. This means you may receive a notification twice. If Twitch resends the message, the message ID will be the same.

    • getMessageType

      public SocketMessageType getMessageType()
      The type of message.
    • getMessageTimestamp

      public Instant getMessageTimestamp()
      The UTC date and time that the message was sent.
    • getSubscriptionType

      @Nullable public @Nullable String getSubscriptionType()
      The type of event sent in the message.

      Only present if getMessageType() is SocketMessageType.NOTIFICATION or SocketMessageType.REVOCATION.

    • getSubscriptionVersion

      @Nullable public @Nullable String getSubscriptionVersion()
      The version number of the subscription type’s definition.

      This is the same value specified in the subscription request.

      Only present if getMessageType() is SocketMessageType.NOTIFICATION or SocketMessageType.REVOCATION.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object