Record Class CommandRegistry.CommandResult
java.lang.Object
java.lang.Record
fr.fidorial.command.CommandRegistry.CommandResult
- Record Components:
returnValue- the raw brigadier return value fromCommandDispatcher.execute(ParseResults).0is used both when the command failed to parse or execute, and when a command had no effect.
- Enclosing interface:
CommandRegistry
The outcome of a command dispatch.
- Since:
- 0.1.0
- API Note:
- Use
executed()to distinguish outcome from raw value.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandResult(int returnValue) Creates an instance of aCommandResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanexecuted()Returns whether the dispatch had any effect.final inthashCode()Returns a hash code value for this object.intReturns the value of thereturnValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CommandResult
public CommandResult(int returnValue) Creates an instance of aCommandResultrecord class.- Parameters:
returnValue- the value for thereturnValuerecord component
-
-
Method Details
-
executed
public boolean executed()Returns whether the dispatch had any effect.- Returns:
trueifreturnValue()is at leastCommand.SINGLE_SUCCESS- Since:
- 0.1.0
-
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 with thecomparemethod from their corresponding wrapper classes. -
returnValue
public int returnValue()Returns the value of thereturnValuerecord component.- Returns:
- the value of the
returnValuerecord component
-