Java Bean Mappings Using MapStruct

Categories: java

The Problem Often times we have a need to map one java object into another one, for example internal entities (persistent models) into DTO(Document Transfer Objects) objects. For this type use cases we mostly use getters and setters to translate data between objects. This seems like tedious when there are so many properties and also a lot of boilerplate code that you need to maintain when there is a new property is added or removed.

Read More →

Add Custom Validations With Lombok Builders

Categories: java

Introduction Project Lombok will be able to generate the builder pattern class to make a java bean as immutable. But for some use cases you might need to add custom property validations while building an object. Lets go through lombok features to see how it can help us solve this. See It In Action Lombok doesn’t generate any code if you implement something to complement with it’s code generation like getters, setter or any other methods.

Read More →