We want to map
abstract Person
PersonRole1 extends Person
PersonRole2 extends Person
to
abstract PersonDto
PersonDtoRoleX extends PersonDto
PersonDtoRoleY extends PersonDto
PersonDtoRoleZ extends PersonDto
The mapper would get Person Type as parameter (either PersonRole1
or PersonRole2
). Depending on the properties of that parameter it should decide to which Dto Type to map (one of PersonDtoRoleX
, PersonDtoRoleY
, PersonDtoRoleZ
).
What would be the best way to structure the mapstruct mapper definition?