CollectionUtils selectRejected method

In this post under Apache Collections, I will show with example the use of “selectRejected” method. “selectRejected” is a static method available under “CollectionUtils” class. It takes two arguments1) input collection2) predicate In this method, the predicate is evaluated on each item of the collection and a new collection is returned which contains items from…… Continue reading CollectionUtils selectRejected method

Using @Lookup on method with its local and instance arguments

In my previous post under Spring Core, I have explained the use of “@Lookup” annotation and how to use it with or without its arguments. In this post, I will show with example, how we can use “@Lookup” (with or without its argument) with a method that takes a local variable and instance variable as…… Continue reading Using @Lookup on method with its local and instance arguments

Calling mapper interface method from another mapper interface code

In this post under MapStruct, I will show with example how to call one mapper interface method from another mapper interface code. For our example I will create “Address” pojo class that will be shared by “Student” and “Person” pojo class as shown below. Address package package31; public class Address { private String addressLine1; private…… Continue reading Calling mapper interface method from another mapper interface code

BeanPostProcessor example

In this post under Spring Core, I will explain with example the purpose and how to use “BeanPostProcessor” interface. In Spring framework when a bean is created, It is first constructed by calling its constructor, then dependencies are injected and initialization logic if any is executed. It is during this initialization phase that we can…… Continue reading BeanPostProcessor example

Using @Lazy annotation with @Autowired annotation example

In this post under Spring Core, I will show with example how to use “@Lazy” annotation with “@Autowired” annotation and how it change the behavior of Spring framework. In previous post, I showed with example how to use “@Lazy” annotation with “@Component” and “@Bean” annotation and how they change the behavior of Spring framework. Just…… Continue reading Using @Lazy annotation with @Autowired annotation example