Record Class MethodModel
java.lang.Object
java.lang.Record
io.github.projectunified.craftcommand.processor.model.MethodModel
- Record Components:
methodName- the Java method namesubcommandName- the subcommand name, ornullaliases- the subcommand aliasesdescription- the subcommand descriptionsenderParameter- the sender parameterparameters- the command argument parametersisDefault- whether this is the default actionelement- the underlying method element
public record MethodModel(String methodName, String subcommandName, List<String> aliases, String description, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element)
extends Record
Model representing a command or subcommand method.
-
Constructor Summary
ConstructorsConstructorDescriptionMethodModel(String methodName, String subcommandName, List<String> aliases, String description, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element) Creates an instance of aMethodModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.Returns the value of thedescriptionrecord component.element()Returns the value of theelementrecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the type of the sender parameter.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisDefaultrecord component.Returns the value of themethodNamerecord component.Returns the value of theparametersrecord component.Returns the value of thesenderParameterrecord component.Returns the value of thesubcommandNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MethodModel
public MethodModel(String methodName, String subcommandName, List<String> aliases, String description, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element) Creates an instance of aMethodModelrecord class.- Parameters:
methodName- the value for themethodNamerecord componentsubcommandName- the value for thesubcommandNamerecord componentaliases- the value for thealiasesrecord componentdescription- the value for thedescriptionrecord componentsenderParameter- the value for thesenderParameterrecord componentparameters- the value for theparametersrecord componentisDefault- the value for theisDefaultrecord componentelement- the value for theelementrecord component
-
-
Method Details
-
getSenderType
Gets the type of the sender parameter.- Returns:
- the sender type mirror
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
methodName
Returns the value of themethodNamerecord component.- Returns:
- the value of the
methodNamerecord component
-
subcommandName
Returns the value of thesubcommandNamerecord component.- Returns:
- the value of the
subcommandNamerecord component
-
aliases
Returns the value of thealiasesrecord component.- Returns:
- the value of the
aliasesrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
senderParameter
Returns the value of thesenderParameterrecord component.- Returns:
- the value of the
senderParameterrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
isDefault
public boolean isDefault()Returns the value of theisDefaultrecord component.- Returns:
- the value of the
isDefaultrecord component
-
element
Returns the value of theelementrecord component.- Returns:
- the value of the
elementrecord component
-