How to map optional fields with MapStruct
Nick Tinnemeier, on 5-02-2021Category: Development Tags: mapping MapStruct Java Optional mappers
Introduction MapStruct is a framework that alleviates us, programmers, from the unexciting task of writing code to copy one object model to another, field by field. In this blog we show you how to map optional fields with MapStruct. If, after reading this, you still wonder what MapStruct is and what it can do for you, then this blog could answer those questions for you: https://techlab.bol.com/mapping-object-models-case-study/. This blog zooms in on MapStruct’s capabilities of dealing with source fields that are not always present, i.e. might be null. In particular, we…
Read more