I have a list of maps with simple Runner.class entities:
List<Map<String, Runner>> times
, for example:
{
"pedro": [
{ lap=1, time=00:01:16.11 },
{ lap=2, time=00:00:42.45 },
{ lap=3, time=00:00:58.23 }
],
"huan": [
{ lap=1, time=00:00:48.33 },
{ lap=2, time=00:00:41.21 }
]
"gomez": [
{ lap=1, time=00:01:02.42 },
{ lap=2, time=00:01:12.31 },
{ lap=3, time=00:01:58.14 },
{ lap=3, time=00:00:55.41 }
]
}
Here is my runner class:
public class Runner {
private Integer lap;
private LocalTime time;
// Getters and setters...
}
I need to get a map of statistics, like lambda summaryStatistics()
does, of min, max and avg time for each runner, that looks like this:
Map<String, DoubleSummaryStatistics> statsMap
, so i could iterate it and use getMin()
, getAverage()
and getMax()
methods... But I don't have any clue how to deal with LocalTime?