Record Class InvocationContext<T extends GenericInteractionCreateEvent>
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.dispatching.context.InvocationContext<T>
- Type Parameters:
T- The used type ofGenericInteractionCreateEvent- Record Components:
util- A set of framework functionalities exposed to the user, includingI18netc.data- The data hold by thisInvocationContext, including the event, interaction definition etc.
- All Implemented Interfaces:
ErrorMessageFactory.ErrorContext
public record InvocationContext<T extends GenericInteractionCreateEvent>(InvocationContext.Utility util, InvocationContext.Data<T extends GenericInteractionCreateEvent> data)
extends Record
implements ErrorMessageFactory.ErrorContext
Bundles data that is important for the execution of an interaction, especially for invoking the user defined method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn object holding data exposed to the user that is crucial for invoking the user defined method.static final recordAn object providing access to some framework functionality. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aInvocationContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionSequencedCollection<@Nullable Object> voidcancel(MessageCreateData errorMessage) Stops further execution of this invocation at the next suitable moment.booleandata()Returns the value of thedatarecord component.TheInteractionDefinitionthat models the interaction of theErrorMessageFactory.ErrorContext.event().final booleanIndicates whether some other object is "equal to" this one.event()TheGenericInteractionCreateEventin whose execution the error occurred.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.util()Returns the value of theutilrecord component.
-
Constructor Details
-
Method Details
-
event
Description copied from interface:ErrorMessageFactory.ErrorContextTheGenericInteractionCreateEventin whose execution the error occurred.- Specified by:
eventin interfaceErrorMessageFactory.ErrorContext
-
definition
Description copied from interface:ErrorMessageFactory.ErrorContextTheInteractionDefinitionthat models the interaction of theErrorMessageFactory.ErrorContext.event().- Specified by:
definitionin interfaceErrorMessageFactory.ErrorContext
-
arguments
- Returns:
- same as
data()#rawArguementsbut withOptionals replaced bynull
-
cancel
Stops further execution of this invocation at the next suitable moment.- Parameters:
errorMessage- the error message that should be sent to the user as a reply- Implementation Note:
- This will interrupt the current event thread
-
cancelled
public boolean cancelled()- Returns:
- if the current invocation is cancelled
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
util
-
data
-