Record Class CommandSyntax
java.lang.Object
java.lang.Record
org.teleight.teleightbots.commands.builder.CommandSyntax
- Record Components:
condition- interface that checks if a command can be executed via certain conditionsexecutor- the command executorargs- array of command arguments
public record CommandSyntax(@Nullable CommandCondition condition, @NotNull CommandExecutor executor, @NotNull Argument<?>[] args)
extends Record
Class representing a command syntax.
Every command can have multiple syntaxes, and this class is a representation of each syntax
-
Constructor Summary
ConstructorsConstructorDescriptionCommandSyntax(@Nullable CommandCondition condition, @NotNull CommandExecutor executor, @NotNull Argument<?>[] args) Creates an instance of aCommandSyntaxrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Argument<?>[]args()Returns the value of theargsrecord component.@Nullable CommandConditionReturns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull CommandExecutorexecutor()Returns the value of theexecutorrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CommandSyntax
public CommandSyntax(@Nullable @Nullable CommandCondition condition, @NotNull @NotNull CommandExecutor executor, @NotNull @NotNull Argument<?>[] args) Creates an instance of aCommandSyntaxrecord class.
-
-
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). -
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
executor
Returns the value of theexecutorrecord component.- Returns:
- the value of the
executorrecord component
-
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-