You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some use cases where it would be great to be able to have an interface as a result type. One of those is the usage of Immutables beans. Because of there structure, it is not recommended to inherit from beans annotated with @Value.Immutables. Meaning that inheritance in this case is handled this way: A ---> @Value.Immutable AbstractA ---> ImmutableA A ---> B ---> @Value.Immutable AbstractB ---> ImmutableB
A consequence of this is that if we want to use @InheritConfiguration in our mappers, we need to use A and B as result types rather than AbstractA and AbstractB (leading to mapstruct not detecting the beans to be Immutables). A nice way to solving that would be for mapstruct to be able to "replace" the result type with the type provided as @BeanMapping#resultType allowing to implement mappers like this:
There are some use cases where it would be great to be able to have an interface as a result type. One of those is the usage of Immutables beans. Because of there structure, it is not recommended to inherit from beans annotated with
@Value.Immutables
. Meaning that inheritance in this case is handled this way:A ---> @Value.Immutable AbstractA ---> ImmutableA
A ---> B ---> @Value.Immutable AbstractB ---> ImmutableB
A consequence of this is that if we want to use
@InheritConfiguration
in our mappers, we need to useA
andB
as result types rather thanAbstractA
andAbstractB
(leading to mapstruct not detecting the beans to be Immutables). A nice way to solving that would be for mapstruct to be able to "replace" the result type with the type provided as@BeanMapping#resultType
allowing to implement mappers like this:An example of the issue (with a branch
expected-behavior
describing the proposed solution) is available here.The text was updated successfully, but these errors were encountered: