Record Class CommandFailureArgumentInvalid
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.api.command.result.CommandFailureArgumentInvalid
- Record Components:
parameter- The corresponding parameter.error- The error message.
- All Implemented Interfaces:
CommandFailure,CommandFailureArgument,CommandFailureMessage,CommandResult
public record CommandFailureArgumentInvalid(Parameter<?> parameter, String error)
extends Record
implements CommandFailureArgument
Failure result due to a provided argument being invalid.
- Since:
- 1.0
- Version:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCommandFailureArgumentInvalid(Parameter<?> parameter, String error) Creates an instance of aCommandFailureArgumentInvalidrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.message()Retrieves the message to the user.Parameter<?>Returns the value of theparameterrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
message
Description copied from interface:CommandFailureMessageRetrieves the message to the user.- Specified by:
messagein interfaceCommandFailureMessage- Returns:
- The message to the user.
-
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). -
parameter
Returns the value of theparameterrecord component.- Returns:
- the value of the
parameterrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-