Consider I have a DTO class like below:
class MyDTO {
Type property1;
Type property2;
// ... and so on
}
Now I have an API that returns a list of MyDTO objects. But I want to filter out and get the single object MyDTO from this list of objects based on some criteria (say property1 == some value).
I know , I can do this by using streams after getting the list of objects. But is there any Jackson way of doing it? so that in my Feign Client call I can have single object as a return type.
// returns a single object after filtering
// for one object while serializing.
MyDTO feignCallApi()