Record Class InteractionResult
java.lang.Object
java.lang.Record
de.chojo.jdautil.interactions.dispatching.InteractionResult
public record InteractionResult(GenericCommandInteractionEvent event, boolean failed, Throwable exception, InteractionContext context)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionInteractionResult(GenericCommandInteractionEvent event, boolean failed, Throwable exception, InteractionContext context) Creates an instance of aInteractionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.Returns the value of theexceptionrecord component.booleanfailed()Returns the value of thefailedrecord component.static InteractionResultfailed(GenericCommandInteractionEvent event, InteractionContext context, Throwable exception) final inthashCode()Returns a hash code value for this object.static InteractionResultsuccess(GenericCommandInteractionEvent event, InteractionContext context) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InteractionResult
public InteractionResult(GenericCommandInteractionEvent event, boolean failed, Throwable exception, InteractionContext context) Creates an instance of aInteractionResultrecord class.- Parameters:
event- the value for theeventrecord componentfailed- the value for thefailedrecord componentexception- the value for theexceptionrecord componentcontext- the value for thecontextrecord component
-
-
Method Details
-
success
public static InteractionResult success(GenericCommandInteractionEvent event, InteractionContext context) -
failed
public static InteractionResult failed(GenericCommandInteractionEvent event, InteractionContext context, Throwable exception) -
commandAsString
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
failed
public boolean failed()Returns the value of thefailedrecord component.- Returns:
- the value of the
failedrecord component
-
exception
Returns the value of theexceptionrecord component.- Returns:
- the value of the
exceptionrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-