Java Bean Mapping with MapStruct

MapStruct is a nice tool to generate mappers for converting one Java bean into another e.g. for projections, data-transfer-objects and so on …​ As long as fields in source and target beans do match, the mapper is able to generate the data setting automatically .. else we may specify which source fields to map into which target fields or to register custom converters with ease. Using Maven, we need to add dependencies and plugin integration to our pom.xml: ...

March 31, 2022 · 3 min · 459 words · Micha Kops