Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to find the maximum value of an attribute of an item in a stream java

Stream<String> stringStream = stringList.stream();
String coolest = stringStream.reduce((a,b)-> 
    coolnessIndex(a) > coolnessIndex(b) ? a:b;
).get()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #maximum #attribute #item #stream #java
ADD COMMENT
Topic
Name
5+4 =