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, Optional<String> shortDescription, Optional<String> fullDescription, String[] aliases, CommandPermission permission)
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, Optional<String> shortDescription, Optional<String> fullDescription, String[] aliases, CommandPermission permission) Creates an instance of aRegisteredCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]aliases()Returns the value of thealiasesrecord component.Returns the value of theargsAsStrrecord component.Returns the value of thecommandNamerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefullDescriptionrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thepermissionrecord component.Returns the value of theshortDescriptionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RegisteredCommand
public RegisteredCommand(String commandName, List<String> argsAsStr, Optional<String> shortDescription, Optional<String> fullDescription, String[] aliases, CommandPermission permission) Creates an instance of aRegisteredCommandrecord class.- Parameters:
commandName- the value for thecommandNamerecord componentargsAsStr- the value for theargsAsStrrecord componentshortDescription- the value for theshortDescriptionrecord componentfullDescription- the value for thefullDescriptionrecord componentaliases- the value for thealiasesrecord componentpermission- the value for thepermissionrecord 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). -
commandName
Returns the value of thecommandNamerecord component.- Returns:
- the value of the
commandNamerecord component
-
argsAsStr
Returns the value of theargsAsStrrecord component.- Returns:
- the value of the
argsAsStrrecord component
-
shortDescription
Returns the value of theshortDescriptionrecord component.- Returns:
- the value of the
shortDescriptionrecord component
-
fullDescription
Returns the value of thefullDescriptionrecord component.- Returns:
- the value of the
fullDescriptionrecord component
-
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
-