Package dev.sympho.bot_utils.event
Class AbstractEventContext<E extends @NonNull Event>
java.lang.Object
dev.sympho.bot_utils.event.AbstractEventContext<E>
- Type Parameters:
E- The event type.
- All Implemented Interfaces:
AccessContext,AccessValidator,EventContext
public abstract class AbstractEventContext<E extends @NonNull Event>
extends Object
implements EventContext
Convenience base for implementing an event context.
Most leaf interfaces here should be able to be implemented on top of this class without any further overrides as they already have default methods pulling all necessary data from the event.
- Since:
- 1.0
- Version:
- 1.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEventContext(E event, AccessManager accessManager) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionevent()Retrieves the triggering event.The access validator used in this context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AbstractEventContext
Creates a new instance.- Parameters:
event- The triggering event.accessManager- The access manager to use.
-
-
Method Details
-
event
Description copied from interface:EventContextRetrieves the triggering event.- Specified by:
eventin interfaceEventContext- Returns:
- The event.
-
validator
Description copied from interface:EventContextThe access validator used in this context.- Specified by:
validatorin interfaceEventContext- Returns:
- The validator.
-