Class TargetTypeSelector
- java.lang.Object
-
- org.mapstruct.ap.internal.model.source.selector.TargetTypeSelector
-
- All Implemented Interfaces:
MethodSelector
public class TargetTypeSelector extends java.lang.Object implements MethodSelector
This selector selects a best match based on the result type.Suppose: Sedan -> Car -> Vehicle, MotorCycle -> Vehicle By means of this selector one can pinpoint the exact desired return type (Sedan, Car, MotorCycle, Vehicle)
-
-
Constructor Summary
Constructors Constructor Description TargetTypeSelector(TypeUtils typeUtils)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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)Selects those methods which match the given types and other criteria
-
-
-
Field Detail
-
typeUtils
private final TypeUtils typeUtils
-
-
Constructor Detail
-
TargetTypeSelector
public TargetTypeSelector(TypeUtils typeUtils)
-
-
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:MethodSelectorSelects those methods which match the given types and other criteria- Specified by:
getMatchingMethodsin interfaceMethodSelector- Type Parameters:
T- either SourceMethod or BuiltInMethod- Parameters:
mappingMethod- mapping method, defined in Mapper for which this selection is carried outmethods- list of available methodssourceTypes- parameter type(s) that should be matchedmappingTargetType- mappingTargetType that should be matchedreturnType- return type that should be matchedcriteria- criteria used in the selection process- Returns:
- list of methods that passes the matching process
-
-