Record Class MethodResolutionResult
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.support.MethodResolutionResult
public record MethodResolutionResult(MethodSymbol methodSymbol, double matchPercentage, boolean requiresPromotion)
extends Record
Result of method resolution including cost analysis.
Contains the resolved method and information about whether promotion is required.
-
Constructor Summary
ConstructorsConstructorDescriptionMethodResolutionResult(MethodSymbol methodSymbol, double matchPercentage, boolean requiresPromotion) Creates an instance of aMethodResolutionResultrecord class. -
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.booleanCheck if this method resolution failed.booleanCheck if this is a perfect match (no coercion needed).doubleReturns the value of thematchPercentagerecord component.Returns the value of themethodSymbolrecord component.booleanReturns the value of therequiresPromotionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MethodResolutionResult
public MethodResolutionResult(MethodSymbol methodSymbol, double matchPercentage, boolean requiresPromotion) Creates an instance of aMethodResolutionResultrecord class.- Parameters:
methodSymbol- the value for themethodSymbolrecord componentmatchPercentage- the value for thematchPercentagerecord componentrequiresPromotion- the value for therequiresPromotionrecord component
-
-
Method Details
-
isPerfectMatch
public boolean isPerfectMatch()Check if this is a perfect match (no coercion needed). -
isInvalid
public boolean isInvalid()Check if this method resolution failed. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
methodSymbol
Returns the value of themethodSymbolrecord component.- Returns:
- the value of the
methodSymbolrecord component
-
matchPercentage
public double matchPercentage()Returns the value of thematchPercentagerecord component.- Returns:
- the value of the
matchPercentagerecord component
-
requiresPromotion
public boolean requiresPromotion()Returns the value of therequiresPromotionrecord component.- Returns:
- the value of the
requiresPromotionrecord component
-