Class MethodMatcher.GenericAnalyser
- java.lang.Object
-
- org.mapstruct.ap.internal.model.source.MethodMatcher.GenericAnalyser
-
- Enclosing class:
- MethodMatcher
private static class MethodMatcher.GenericAnalyser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private MethodcandidateMethod(package private) java.util.List<Type>candidateParTypes(package private) TypecandidateReturnTypeprivate java.util.List<Type>sourceTypesprivate TypetargetTypeprivate TypeFactorytypeFactoryprivate TypeUtilstypeUtils
-
Constructor Summary
Constructors Constructor Description GenericAnalyser(TypeFactory typeFactory, TypeUtils typeUtils, Method candidateMethod, java.util.List<Type> sourceTypes, Type targetType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanareEquivalent(Type a, Type b)private booleancandidatesWithinBounds(java.util.Map<Type,MethodMatcher.TypeVarCandidate> methodParCandidates)Checks whether all found candidates are within the bounds of the method type var.(package private) booleangetCandidates(java.util.Map<Type,MethodMatcher.TypeVarCandidate> methodParCandidates)<T, U extends Number> T map( U in )Resolves all method generic parameter candidates(package private) booleangetCandidates(Type aCandidateMethodType, Type matchingType, java.util.Map<Type,MethodMatcher.TypeVarCandidate> candidates)private booleanhasGenericTypeParameters(Type typeFromCandidateMethod)private booleanlineUp()private Typeresolve(Type typeFromCandidateMethod, java.util.Map<Type,Type> pairs)
-
-
-
Field Detail
-
typeFactory
private TypeFactory typeFactory
-
typeUtils
private TypeUtils typeUtils
-
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
-
GenericAnalyser
GenericAnalyser(TypeFactory typeFactory, TypeUtils typeUtils, Method candidateMethod, java.util.List<Type> sourceTypes, Type targetType)
-
-
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 methodmatchingType- source type / target type to matchcandidates- 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)
-
-