filter and map multiple fields from java stream

Solutions on MaxInterview for filter and map multiple fields from java stream by the best coders in the world

showing results for - "filter and map multiple fields from java stream"
Nicolò
31 Jun 2019
1// Note that you shouldn't normally use == on objects
2Predicate<Detail> itemPredicate = d-> item.equals(d.getItem());
3Predicate<Detail> namePredicate = d-> name.equals(d.getName());
4
5details.stream()
6    .filter(itemPredicate.and(namePredicate))
7    .collect(Collectors.toList());