I want to filter collection of Java DTO Objects using JsonPath
library.
I have List<AuthorGetDto>
with some objects and I want to do something like this:
List<AuthorGetDto> authors = authorService.getAllAuthors();
List<AthorGetDto> filtered = JsonPath.read(authors, "$.[?(@.authorId=='985')]");
Is it possible to do something like this? Or I must firstly parse this objects to String than filter them using JsonPath, and after that convert them to List<AuthorGetDto>
?