Class InheritanceSelector

  • All Implemented Interfaces:
    MethodSelector

    public class InheritanceSelector
    extends java.lang.Object
    implements MethodSelector
    Selects on inheritance distance, e.g. the amount of inheritance steps from the parameter type.
    • Constructor Detail

      • InheritanceSelector

        public InheritanceSelector()
    • Method Detail

      • getMatchingMethods

        public <T extends Method> java.util.List<SelectedMethod<T>> getMatchingMethods​(Method mappingMethod,
                                                                                       java.util.List<SelectedMethod<T>> methods,
                                                                                       java.util.List<Type> sourceTypes,
                                                                                       Type mappingTargetType,
                                                                                       Type returnType,
                                                                                       SelectionCriteria criteria)
        Description copied from interface: MethodSelector
        Selects those methods which match the given types and other criteria
        Specified by:
        getMatchingMethods in interface MethodSelector
        Type Parameters:
        T - either SourceMethod or BuiltInMethod
        Parameters:
        mappingMethod - mapping method, defined in Mapper for which this selection is carried out
        methods - list of available methods
        sourceTypes - parameter type(s) that should be matched
        mappingTargetType - mappingTargetType that should be matched
        returnType - return type that should be matched
        criteria - criteria used in the selection process
        Returns:
        list of methods that passes the matching process
      • addToCandidateListIfMinimal

        private <T extends Method> int addToCandidateListIfMinimal​(java.util.List<SelectedMethod<T>> candidatesWithBestMathingType,
                                                                   int bestMatchingTypeDistance,
                                                                   SelectedMethod<T> method,
                                                                   int currentTypeDistance)