Record Class Invokers.Args
java.lang.Object
java.lang.Record
pro.verron.officestamper.core.Invokers.Args
- Record Components:
sourceTypes- a list of parameter types representing the method's signature.
- Enclosing class:
Invokers
Represents argument types associated with method invocation.
This record encapsulates a list of parameter types and provides a method to validate whether a list of target types matches the source types.
The validation logic ensures that each target type is compatible with the corresponding source type. A type is
compatible if it matches precisely or is assignable from the source type. Additionally, the Any class acts as
a wildcard placeholder, making any type compatible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thesourceTypesrecord component.final StringtoString()Returns a string representation of this record class.booleanValidates if the provided list of classes matches the source types according to the compatibility rules.
-
Constructor Details
-
Args
Creates an instance of aArgsrecord class.- Parameters:
sourceTypes- the value for thesourceTypesrecord component
-
-
Method Details
-
validate
Validates if the provided list of classes matches the source types according to the compatibility rules. A type is considered compatible if it matches precisely or is assignable from the corresponding source type. Additionally, theAnyclass serves as a wildcard, making any type compatible.- Parameters:
searchedTypes- the list of classes to validate against the source types.- Returns:
- true if all the searched classes are compatible with the source types; false otherwise.
-
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 withObjects::equals(Object,Object). -
sourceTypes
Returns the value of thesourceTypesrecord component.- Returns:
- the value of the
sourceTypesrecord component
-