Package dev.jorel.commandapi
Record Class RegisteredCommand
java.lang.Object
java.lang.Record
dev.jorel.commandapi.RegisteredCommand
public record RegisteredCommand(String commandName, List<String> argsAsStr, List<AbstractArgument<?,?,?,?>> arguments, Optional<String> shortDescription, Optional<String> fullDescription, Optional<String[]> usageDescription, Optional<Object> helpTopic, String[] aliases, CommandPermission permission, String namespace)
extends Record
Class to store a registered command which has its command name and a list of
arguments as a string. The arguments are expected to be of the form
node_name:class_name, for example value:IntegerArgument. This
class also contains the information required to construct a meaningful help
topic for a command-
Constructor Summary
ConstructorsConstructorDescriptionRegisteredCommand(String commandName, List<String> argsAsStr, List<AbstractArgument<?, ?, ?, ?>> arguments, Optional<String> shortDescription, Optional<String> fullDescription, Optional<String[]> usageDescription, Optional<Object> helpTopic, String[] aliases, CommandPermission permission, String namespace) Creates an instance of aRegisteredCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]aliases()Returns the value of thealiasesrecord component.Returns the value of theargsAsStrrecord component.List<AbstractArgument<?, ?, ?, ?>> Returns the value of theargumentsrecord component.Returns the value of thecommandNamerecord component.booleanIndicates whether some other object is "equal to" this one.Returns the value of thefullDescriptionrecord component.inthashCode()Returns a hash code value for this object.Returns the value of thehelpTopicrecord component.Returns the value of thenamespacerecord component.Returns the value of thepermissionrecord component.Returns the value of theshortDescriptionrecord component.toString()Returns a string representation of this record class.Returns the value of theusageDescriptionrecord component.
-
Constructor Details
-
RegisteredCommand
public RegisteredCommand(String commandName, List<String> argsAsStr, List<AbstractArgument<?, ?, ?, ?>> arguments, Optional<String> shortDescription, Optional<String> fullDescription, Optional<String[]> usageDescription, Optional<Object> helpTopic, String[] aliases, CommandPermission permission, String namespace) Creates an instance of aRegisteredCommandrecord class.- Parameters:
commandName- the value for thecommandNamerecord componentargsAsStr- the value for theargsAsStrrecord componentarguments- the value for theargumentsrecord componentshortDescription- the value for theshortDescriptionrecord componentfullDescription- the value for thefullDescriptionrecord componentusageDescription- the value for theusageDescriptionrecord componenthelpTopic- the value for thehelpTopicrecord componentaliases- the value for thealiasesrecord componentpermission- the value for thepermissionrecord componentnamespace- the value for thenamespacerecord component
-
-
Method Details
-
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). -
toString
-
commandName
Returns the value of thecommandNamerecord component.- Returns:
- the value of the
commandNamerecord component
-
argsAsStr
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
shortDescription
-
fullDescription
-
usageDescription
-
helpTopic
-
aliases
Returns the value of thealiasesrecord component.- Returns:
- the value of the
aliasesrecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-