Record Class RegisterableCommand
java.lang.Object
java.lang.Record
com.zetaplugins.zetacore.services.commands.RegisterableCommand
- Record Components:
name- The name of the commandaliases- The aliases of the commanddescription- The description of the commandusage- The usage of the commandpermission- The permission of the command
public record RegisterableCommand(String name, List<String> aliases, String description, String usage, String permission)
extends Record
A command that can be registered
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static RegisterableCommandfromAnnotation(String name, AutoRegisterCommand annotation) Creates a RegisterableCommand from an AutoRegisterCommand annotationfinal inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thepermissionrecord component.booleanregister(JavaPlugin plugin, String commandNamespace, CommandMap commandMap, CommandExecutor executor, TabCompleter tabCompleter) Registers the commandfinal StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
RegisterableCommand
public RegisterableCommand(String name, List<String> aliases, String description, String usage, String permission) Creates an instance of aRegisterableCommandrecord class.- Parameters:
name- the value for thenamerecord componentaliases- the value for thealiasesrecord componentdescription- the value for thedescriptionrecord componentusage- the value for theusagerecord componentpermission- the value for thepermissionrecord component
-
-
Method Details
-
register
public boolean register(JavaPlugin plugin, String commandNamespace, CommandMap commandMap, CommandExecutor executor, TabCompleter tabCompleter) Registers the command- Parameters:
plugin- The plugin instancecommandNamespace- The command namespacecommandMap- The command mapexecutor- The command executortabCompleter- The tab completer- Returns:
- True if the command was registered successfully, false otherwise
-
fromAnnotation
Creates a RegisterableCommand from an AutoRegisterCommand annotation- Parameters:
name- The name of the commandannotation- The AutoRegisterCommand annotation- Returns:
- The RegisterableCommand
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
aliases
Returns the value of thealiasesrecord component.- Returns:
- the value of the
aliasesrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-