Interface IRedisMessageReceiveEvent

All Known Implementing Classes:
AsyncRedisMessageReceiveEvent, RedisMessageReceiveEvent

public interface IRedisMessageReceiveEvent
The interface of a Redis message receive event.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Gets the channel of the message.
    @NotNull String
    Gets the raw string message.
    <T> @NotNull Optional<T>
    getMessageObject(@NotNull Class<T> objectClass)
    Gets the object from the received message
    @NotNull String
    Gets the ID of the sending server.
    long
    Gets the timestamp of the message
  • Method Details

    • getSenderId

      @NotNull @NotNull String getSenderId()
      Gets the ID of the sending server.
      Returns:
      The ID of the sending server
    • getChannel

      @NotNull @NotNull String getChannel()
      Gets the channel of the message.
      Returns:
      THe channel name
    • getMessage

      @NotNull @NotNull String getMessage()
      Gets the raw string message.
      Returns:
      The raw string message
    • getTimestamp

      long getTimestamp()
      Gets the timestamp of the message
      Returns:
      The timestamp of the message
    • getMessageObject

      @NotNull <T> @NotNull Optional<T> getMessageObject(@NotNull @NotNull Class<T> objectClass)
      Gets the object from the received message
      Type Parameters:
      T - Object type
      Parameters:
      objectClass - Object class
      Returns:
      Parsed object, or null if it cannot be parsed