diff --git a/processor/src/main/java/org/mapstruct/ap/model/Type.java b/processor/src/main/java/org/mapstruct/ap/model/Type.java index 8ba814cd0..bcc2bd769 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/Type.java +++ b/processor/src/main/java/org/mapstruct/ap/model/Type.java @@ -148,6 +148,21 @@ public class Type extends AbstractModelElement implements Comparable { Collections.emptySet(); } + /** + * Whether this type is assignable to the given other type. + * + * @param other The other type. + * + * @return {@code true} if and only if this type is assignable to the given other type. + */ + public boolean isAssignableTo(Type other) { + if ( equals( other ) ) { + return true; + } + + return typeUtils.isAssignable( typeMirror, other.typeMirror ); + } + @Override public int hashCode() { final int prime = 31; diff --git a/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java index 7cdfa39b0..ce93eb171 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java @@ -207,7 +207,7 @@ public class MethodRetrievalProcessor implements ModelElementProcessor