Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

filter and map multiple fields from java stream

// Note that you shouldn't normally use == on objects
Predicate<Detail> itemPredicate = d-> item.equals(d.getItem());
Predicate<Detail> namePredicate = d-> name.equals(d.getName());

details.stream()
    .filter(itemPredicate.and(namePredicate))
    .collect(Collectors.toList());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #map #multiple #fields #java #stream
ADD COMMENT
Topic
Name
3+2 =