Record Class CommandSpec
java.lang.Object
java.lang.Record
dev.plex.command.CommandSpec
- Record Components:
name- primary command namedescription- short command descriptionusage- command usage text;<command>is replaced with the command namealiases- alternate root labels for the commandpermission- permission node required to use the commandrequiredSource- source restriction for command execution
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for command specs. -
Constructor Summary
ConstructorsConstructorDescriptionCommandSpec(String name, String description, String usage, List<String> aliases, String permission, RequiredCommandSource requiredSource) Creates and validates command data. -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.static CommandSpec.BuilderCreates a command spec builder for the given primary name.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thepermissionrecord component.Returns the value of therequiredSourcerecord component.Returns usage text with the command placeholder expanded.final StringtoString()Returns a string representation of this record class.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
CommandSpec
-
-
Method Details
-
builder
Creates a command spec builder for the given primary name.- Parameters:
name- primary command name- Returns:
- command spec builder
-
resolvedUsage
Returns usage text with the command placeholder expanded.- Returns:
- command usage text for this command
-
toString
-
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). -
name
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
usage
-
aliases
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
requiredSource
Returns the value of therequiredSourcerecord component.- Returns:
- the value of the
requiredSourcerecord component
-