Package top.focess.qq.api.event
Class EventManager
- java.lang.Object
-
- top.focess.qq.api.event.EventManager
-
public class EventManager extends Object
This class is used to submit Event for developers.
-
-
Constructor Summary
Constructors Constructor Description EventManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Event>
voidsubmit(Class<T> cls, T event)Submit the event to cls and all of cls 's implemented super event classstatic <T extends Event>
voidsubmit(T event)Submit the event to all of its implemented super event classstatic <T extends Event>
voidsubmitOnce(Class<T> cls, T event)Submit the event only to cls event classstatic <T extends Event>
voidtrySubmitOnce(Class<T> cls, T event)Submit the event only to itself and no exception throws
-
-
-
Method Detail
-
submit
public static <T extends Event> void submit(T event) throws EventSubmitException
Submit the event to all of its implemented super event class- Type Parameters:
T- the event type- Parameters:
event- the event need to be submitted- Throws:
EventSubmitException- if class of this event is abstract or there is no LISTENER_HANDLER in this event
-
submit
public static <T extends Event> void submit(Class<T> cls, T event) throws EventSubmitException
Submit the event to cls and all of cls 's implemented super event class- Type Parameters:
T- the event type- Parameters:
cls- the submitting chain start eventevent- the event need to be submitted- Throws:
EventSubmitException- if class of this event is abstract or there is no LISTENER_HANDLER in this event
-
trySubmitOnce
public static <T extends Event> void trySubmitOnce(Class<T> cls, T event)
Submit the event only to itself and no exception throws- Type Parameters:
T- the event type- Parameters:
cls- the submitting chain start eventevent- the event need to be submitted
-
submitOnce
public static <T extends Event> void submitOnce(Class<T> cls, T event) throws EventSubmitException
Submit the event only to cls event class- Type Parameters:
T- the event type- Parameters:
cls- the event class the event submits toevent- the event need to be submitted- Throws:
EventSubmitException- if class of this event is abstract or there is no LISTENER_HANDLER in this event
-
-