Class MethodMatcher.GenericAnalyser

  • Enclosing class:
    MethodMatcher

    private static class MethodMatcher.GenericAnalyser
    extends java.lang.Object
    • Field Detail

      • candidateMethod

        private Method candidateMethod
      • sourceTypes

        private java.util.List<Type> sourceTypes
      • targetType

        private Type targetType
      • candidateReturnType

        Type candidateReturnType
      • candidateParTypes

        java.util.List<Type> candidateParTypes
    • Constructor Detail

    • Method Detail

      • lineUp

        private boolean lineUp()
      • getCandidates

        boolean getCandidates​(java.util.Map<Type,​MethodMatcher.TypeVarCandidate> methodParCandidates)
        <T, U extends Number> T map( U in ) Resolves all method generic parameter candidates
        Parameters:
        methodParCandidates - Map, keyed by the method generic parameter (T, U extends Number), with their respective candidates
        Returns:
        false no match or conflict has been found *
      • getCandidates

        boolean getCandidates​(Type aCandidateMethodType,
                              Type matchingType,
                              java.util.Map<Type,​MethodMatcher.TypeVarCandidate> candidates)
        Parameters:
        aCandidateMethodType - parameter type or return type from candidate method
        matchingType - source type / target type to match
        candidates - Map, keyed by the method generic parameter, with the candidates
        Returns:
        false no match or conflict has been found
      • candidatesWithinBounds

        private boolean candidatesWithinBounds​(java.util.Map<Type,​MethodMatcher.TypeVarCandidate> methodParCandidates)
        Checks whether all found candidates are within the bounds of the method type var. For instance
        Parameters:
        methodParCandidates -
        Returns:
        true when all within bounds.
      • hasGenericTypeParameters

        private boolean hasGenericTypeParameters​(Type typeFromCandidateMethod)
      • resolve

        private Type resolve​(Type typeFromCandidateMethod,
                             java.util.Map<Type,​Type> pairs)
      • areEquivalent

        boolean areEquivalent​(Type a,
                              Type b)