Passing context information to custom mapping method

In this post under MapStruct, I will explain with example how to pass context information to custom mapping methods. In the previous post, I have explained how to tell MapStruct which is the context information i.e., by annotating it with “@Context” annotation as shown below @Mapping(target = "addressDTO", source = "address") PersonDTO personToPersonDTO(Person person, @Context…… Continue reading Passing context information to custom mapping method

Passing context information to mapping method

In this post under MapStruct, I will show with example how to pass context information to the mapping methods. For our example, I will have “Person” entity and map it to “PersonDTO” entity. Below is the class structure of “Person” class Person package package34; public class Person { private int id; private String name; private…… Continue reading Passing context information to mapping method

CollectionUtils transform method

In this post under Apache Collections, I will show with example, how to use and purpose of “transform” static method in Apache Collections “CollectionUtils” class. The “transform” method can be used to transform each elements in a collection. The transformer logic is implemented by implementing the “Transformer” functional interface. Please note it doesn’t create a…… Continue reading CollectionUtils transform method