Package net.apartium.cocoabeans.commands
Record Class RegisteredVariant.Parameter
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.RegisteredVariant.Parameter
- Record Components:
type- The type of parameterparameterizedType- parameterized typeargumentRequirements- argument requirementsparameterName- parameter name
- Enclosing class:
RegisteredVariant
public static record RegisteredVariant.Parameter(Class<?> type, Type parameterizedType, ArgumentRequirement[] argumentRequirements, String parameterName)
extends Record
Parameter represent a parameter of the command after has been parsed
-
Constructor Summary
ConstructorsConstructorDescriptionParameter(Class<?> type, Type parameterizedType, ArgumentRequirement[] argumentRequirements, String parameterName) Creates an instance of aParameterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentRequirementsrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.static RegisteredVariant.Parameter[]of(GenericNode node, Parameter[] parameters, Map<Class<? extends ArgumentRequirementFactory>, ArgumentRequirementFactory> argumentRequirementFactories) create parameters from the given parametersReturns the value of theparameterizedTyperecord component.Returns the value of theparameterNamerecord component.toString()Returns a string representation of this record class.Class<?> type()Returns the value of thetyperecord component.
-
Constructor Details
-
Parameter
public Parameter(Class<?> type, Type parameterizedType, ArgumentRequirement[] argumentRequirements, String parameterName) Creates an instance of aParameterrecord class.- Parameters:
type- the value for thetyperecord componentparameterizedType- the value for theparameterizedTyperecord componentargumentRequirements- the value for theargumentRequirementsrecord componentparameterName- the value for theparameterNamerecord component
-
-
Method Details
-
of
@AvailableSince("0.0.37") public static RegisteredVariant.Parameter[] of(GenericNode node, Parameter[] parameters, Map<Class<? extends ArgumentRequirementFactory>, ArgumentRequirementFactory> argumentRequirementFactories) create parameters from the given parameters- Parameters:
node- instance of the nodeparameters- parametersargumentRequirementFactories- argument requirement factories for caching- Returns:
- parameters parsed
-
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). -
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. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
parameterizedType
Returns the value of theparameterizedTyperecord component.- Returns:
- the value of the
parameterizedTyperecord component
-
argumentRequirements
Returns the value of theargumentRequirementsrecord component.- Returns:
- the value of the
argumentRequirementsrecord component
-
parameterName
Returns the value of theparameterNamerecord component.- Returns:
- the value of the
parameterNamerecord component
-