Package com.ultikits.ultitools.manager
Class TriggerContext
java.lang.Object
com.ultikits.ultitools.manager.TriggerContext
Immutable context describing what triggered an error.
All player info is captured as strings at construction time
to be safe across async thread boundaries.
- Since:
- 6.2.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringprivate final Stringprivate final TriggerContext.TriggerType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTriggerContext(TriggerContext.TriggerType triggerType, String triggerDetail, String playerName, String playerUUID) -
Method Summary
Modifier and TypeMethodDescriptionstatic TriggerContextCreate context for an AOP interceptor trigger.static TriggerContextCreate context for a command trigger.static TriggerContextCreate context for an event trigger.static TriggerContextCreate context for a scheduled task trigger.static TriggerContextCreate context for an uncaught exception.
-
Field Details
-
triggerType
-
triggerDetail
-
playerName
-
playerUUID
-
-
Constructor Details
-
TriggerContext
private TriggerContext(TriggerContext.TriggerType triggerType, String triggerDetail, String playerName, String playerUUID)
-
-
Method Details
-
command
Create context for a command trigger. Captures player info immediately (safe for async use).- Parameters:
sender- the command sendercommandLine- the full command line (e.g., "uc msg Hello")- Returns:
- trigger context
-
event
Create context for an event trigger.- Parameters:
eventClassName- the simple name of the event class- Returns:
- trigger context
-
aop
Create context for an AOP interceptor trigger.- Parameters:
className- the simple name of the declaring classmethodName- the method name- Returns:
- trigger context
-
scheduled
Create context for a scheduled task trigger.- Parameters:
detail- description of the scheduled task- Returns:
- trigger context
-
uncaught
Create context for an uncaught exception.- Parameters:
detail- description of where the error occurred- Returns:
- trigger context
-
getTriggerType
-
getTriggerDetail
-
getPlayerName
-
getPlayerUUID
-