Record Class TextHandlers.Impl
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.api.command.handler.TextHandlers.Impl
- Record Components:
invocation
- The invocation handler to use.result
- The result handlers to use.
- All Implemented Interfaces:
Handlers
,InteractionHandlers
,MessageHandlers
,SlashHandlers
,TextHandlers
- Enclosing interface:
- TextHandlers
public static record TextHandlers.Impl(InvocationHandler<CommandContext> invocation, List<? extends ResultHandler<CommandContext>> result)
extends Record
implements TextHandlers
A record-based implementation.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.api.command.handler.TextHandlers
TextHandlers.Impl
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionImpl
(InvocationHandler<CommandContext> invocation, List<? extends ResultHandler<CommandContext>> 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.Returns the value of theinvocation
record component.List<? extends ResultHandler<CommandContext>>
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<CommandContext> invocation, List<? extends ResultHandler<CommandContext>> 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 interfaceInteractionHandlers
- Specified by:
invocation
in interfaceMessageHandlers
- Specified by:
invocation
in interfaceSlashHandlers
- Specified by:
invocation
in interfaceTextHandlers
- 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 interfaceInteractionHandlers
- Specified by:
result
in interfaceMessageHandlers
- Specified by:
result
in interfaceSlashHandlers
- Specified by:
result
in interfaceTextHandlers
- Returns:
- the value of the
result
record component
-