Class AsyncRedisMessageReceiveEvent
java.lang.Object
org.bukkit.event.Event
dev.demeng.pluginbase.redis.event.AsyncRedisMessageReceiveEvent
- All Implemented Interfaces:
IRedisMessageReceiveEvent
public class AsyncRedisMessageReceiveEvent
extends org.bukkit.event.Event
implements IRedisMessageReceiveEvent
Asynchronous event called when a Redis message is received by the server.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionAsyncRedisMessageReceiveEvent(@NotNull String channel, @NotNull MessageTransferObject mto) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerList@NotNull StringGets the raw string message.<T> @NotNull Optional<T>getMessageObject(@NotNull Class<T> objectClass) Gets the object from the received message@NotNull StringGets the ID of the sending server.longGets the timestamp of the messageMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.demeng.pluginbase.redis.event.IRedisMessageReceiveEvent
getChannel
-
Constructor Details
-
AsyncRedisMessageReceiveEvent
public AsyncRedisMessageReceiveEvent(@NotNull @NotNull String channel, @NotNull @NotNull MessageTransferObject mto)
-
-
Method Details
-
getSenderId
Description copied from interface:IRedisMessageReceiveEventGets the ID of the sending server.- Specified by:
getSenderIdin interfaceIRedisMessageReceiveEvent- Returns:
- The ID of the sending server
-
getMessage
Description copied from interface:IRedisMessageReceiveEventGets the raw string message.- Specified by:
getMessagein interfaceIRedisMessageReceiveEvent- Returns:
- The raw string message
-
getMessageObject
Description copied from interface:IRedisMessageReceiveEventGets the object from the received message- Specified by:
getMessageObjectin interfaceIRedisMessageReceiveEvent- Type Parameters:
T- Object type- Parameters:
objectClass- Object class- Returns:
- Parsed object, or null if it cannot be parsed
-
getTimestamp
public long getTimestamp()Description copied from interface:IRedisMessageReceiveEventGets the timestamp of the message- Specified by:
getTimestampin interfaceIRedisMessageReceiveEvent- Returns:
- The timestamp of the message
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-