hari-p
6/22/2017 - 6:30 AM

Java8 stream to count number of items in csv string in a list

Java8 stream to count number of items in csv string in a list

//The line returns sum of csv items in a each download request matched string
Long downloadCount = downloadRequests.stream().map(DownloadRequest::getMatchedRecords).mapToLong(s -> s.split(",").length).sum();