How to map optional fields with MapStruct

    Nick Tinnemeier, on 5-02-2021
    Category: Development

    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

    Mapping object models with MapStruct – a case study

    Nick Tinnemeier, on 6-01-2021
    Category: Development

    Introduction I was once told that a good programmer is a lazy programmer. A good programmer avoids typing tedious code, where the code could basically write itself. Self-writing code – wouldn’t that be great? Unfortunately, we’re not quite there yet. We show you how close to self-writing code you can get. In this blog we will present a case study using MapStruct for mapping object models. In particular, we zoom in on how the MapStruct framework alleviates us from the dull task of writing code to copy one object model…

    Read more