Package net.apartium.cocoabeans.commands
Record Class RegisteredVariant
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.RegisteredVariant
- Record Components:
method- target method to runparameters- parametersnode- node instanceargumentIndexList- list of argument indexes that will be passed to the methodpriority- the priority of the variant
public record RegisteredVariant(MethodHandle method, RegisteredVariant.Parameter[] parameters, GenericNode node, List<ArgumentIndex<?>> argumentIndexList, int priority)
extends Record
Registered variant for a command
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordParameter represent a parameter of the command after has been parsed -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<RegisteredVariant> Comparator for registered variants -
Constructor Summary
ConstructorsConstructorDescriptionRegisteredVariant(MethodHandle method, RegisteredVariant.Parameter[] parameters, GenericNode node, List<ArgumentIndex<?>> argumentIndexList, int priority) Creates an instance of aRegisteredVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<ArgumentIndex<?>> Returns the value of theargumentIndexListrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.node()Returns the value of thenoderecord component.Returns the value of theparametersrecord component.intpriority()Returns the value of thepriorityrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
REGISTERED_VARIANT_COMPARATOR
Comparator for registered variants
-
-
Constructor Details
-
RegisteredVariant
public RegisteredVariant(MethodHandle method, RegisteredVariant.Parameter[] parameters, GenericNode node, List<ArgumentIndex<?>> argumentIndexList, int priority) Creates an instance of aRegisteredVariantrecord class.- Parameters:
method- the value for themethodrecord componentparameters- the value for theparametersrecord componentnode- the value for thenoderecord componentargumentIndexList- the value for theargumentIndexListrecord componentpriority- the value for thepriorityrecord component
-
-
Method Details
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
node
Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-
argumentIndexList
Returns the value of theargumentIndexListrecord component.- Returns:
- the value of the
argumentIndexListrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-