Record Class SlashHandlers.Impl
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.api.command.handler.SlashHandlers.Impl
- Record Components:
invocation
- The invocation handler to use.result
- The result handlers to use.
- All Implemented Interfaces:
Handlers
,SlashHandlers
- Enclosing interface:
- SlashHandlers
public static record SlashHandlers.Impl(InvocationHandler<? super SlashCommandContext> invocation, List<? extends ResultHandler<? super SlashCommandContext>> result)
extends Record
implements SlashHandlers
A record-based implementation.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.api.command.handler.SlashHandlers
SlashHandlers.Impl
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionImpl
(InvocationHandler<? super SlashCommandContext> invocation, List<? extends ResultHandler<? super SlashCommandContext>> result) Creates an instance of aImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.InvocationHandler<? super SlashCommandContext>
Returns the value of theinvocation
record component.List<? extends ResultHandler<? super SlashCommandContext>>
result()
Returns the value of theresult
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Impl
public Impl(InvocationHandler<? super SlashCommandContext> invocation, List<? extends ResultHandler<? super SlashCommandContext>> result) Creates an instance of aImpl
record class.- Parameters:
invocation
- the value for theinvocation
record componentresult
- the value for theresult
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
invocation
Returns the value of theinvocation
record component.- Specified by:
invocation
in interfaceHandlers
- Specified by:
invocation
in interfaceSlashHandlers
- Returns:
- the value of the
invocation
record component
-
result
Returns the value of theresult
record component.- Specified by:
result
in interfaceHandlers
- Specified by:
result
in interfaceSlashHandlers
- Returns:
- the value of the
result
record component
-