Package dev.jorel.commandapi.wrappers
Record Class CommandResult
java.lang.Object
java.lang.Record
dev.jorel.commandapi.wrappers.CommandResult
CommandResult represents an executable command. It contains the following
methods:
command- the command which thisCommandResultcontainsargs- the arguments that were provided to this commandexecute(CommandSender)- Run the command using the given CommandSender directly
-
Constructor Summary
ConstructorsConstructorDescriptionCommandResult(org.bukkit.command.Command command, String[] args) Creates an instance of aCommandResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]args()Returns the value of theargsrecord component.org.bukkit.command.Commandcommand()Returns the value of thecommandrecord component.booleanIndicates whether some other object is "equal to" this one.booleanexecute(org.bukkit.command.CommandSender sender) Executes this command with a providedCommandSender.inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.
-
Constructor Details
-
CommandResult
Creates an instance of aCommandResultrecord class.- Parameters:
command- the value for thecommandrecord componentargs- the value for theargsrecord component
-
-
Method Details
-
execute
public boolean execute(org.bukkit.command.CommandSender sender) Executes this command with a providedCommandSender. This is equivalent to runningresult.command().execute(sender, result.command().getLabel(), result.args());- Parameters:
sender- the command sender that will be used to execute this command
-
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). -
hashCode
-
toString
-
command
public org.bukkit.command.Command command()Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-