Record Class CommandInfo
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.command.CommandInfo
- Record Components:
name- the root name of the command.aliases- all aliases of the root command.permission- the permission that is needed to execute the command.description- the description of the command which is used for the help command.docsUrl- the url to the documentation of the command.usage- the correct syntax usages for each sub command.
- All Implemented Interfaces:
Named
public record CommandInfo(@NonNull String name, @NonNull Set<String> aliases, @NonNull String permission, @NonNull String description, @Nullable String docsUrl, @NonNull List<String> usage)
extends Record
implements Named
Represents a command information object which holds all information for a single command that is registered on a
node.
The command info has one main identification point. It's identified by the name of the command. The command represented by the command info is always the root of the command. Subcommands don't have an own command info, every needed information is stored in the root command info. The usage contains the syntax for every possible command, here are subcommands included too.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thealiasesrecord component.The field for thedescriptionrecord component.The field for thedocsUrlrecord component.The field for thenamerecord component.The field for thepermissionrecord component.The field for theusagerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.Returns the value of thedescriptionrecord component.docsUrl()Returns the value of thedocsUrlrecord component.booleaninthashCode()joinNameToAliases(@NonNull String separator) Joins the name of the registered command and the specified aliases into one String seperated by the separator.name()Returns the value of thenamerecord component.Returns the value of thepermissionrecord component.final StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Field Details
-
name
-
aliases
-
permission
The field for thepermissionrecord component. -
description
The field for thedescriptionrecord component. -
docsUrl
-
usage
-
-
Constructor Details
-
CommandInfo
public CommandInfo(@NonNull @NonNull String name, @NonNull @NonNull Set<String> aliases, @NonNull @NonNull String permission, @NonNull @NonNull String description, @Nullable @Nullable String docsUrl, @NonNull @NonNull List<String> usage) Creates an instance of aCommandInforecord class.- Parameters:
name- the value for thenamerecord componentaliases- the value for thealiasesrecord componentpermission- the value for thepermissionrecord componentdescription- the value for thedescriptionrecord componentdocsUrl- the value for thedocsUrlrecord componentusage- the value for theusagerecord component
-
-
Method Details
-
joinNameToAliases
Joins the name of the registered command and the specified aliases into one String seperated by the separator.- Parameters:
separator- the separator to join with.- Returns:
- the joined String with the name and all aliases.
- Throws:
NullPointerException- if separator is null.
-
equals
-
hashCode
-
toString
-
name
-
aliases
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
docsUrl
-
usage
-