Package dev.sympho.bot_utils.event
Class AbstractChannelEventContext<E extends @NonNull Event>
java.lang.Object
dev.sympho.bot_utils.event.AbstractChannelEventContext<E>
- Type Parameters:
E- The event type.
- All Implemented Interfaces:
AccessContext,AccessValidator,ChannelAccessContext,ChannelAccessValidator,ChannelEventContext,EventContext
- Direct Known Subclasses:
AbstractRepliableContext
public abstract class AbstractChannelEventContext<E extends @NonNull Event>
extends Object
implements ChannelEventContext
Convenience base for implementing a channel-bound 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
ConstructorsModifierConstructorDescriptionprotectedAbstractChannelEventContext(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, waitMethods inherited from interface dev.sympho.bot_utils.access.AccessContext
asGuild, guild, guildId, isPrivate, member, member, userMethods inherited from interface dev.sympho.bot_utils.access.ChannelAccessContext
asUser, channel, channelIdMethods inherited from interface dev.sympho.bot_utils.event.ChannelEventContext
belongs, belongs, belongs, belongs, hasAccess, hasAccess, validateMethods inherited from interface dev.sympho.bot_utils.event.EventContext
client, validate
-
Constructor Details
-
AbstractChannelEventContext
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 interfaceChannelEventContext- Specified by:
validatorin interfaceEventContext- Returns:
- The validator.
-