Answer the question
In order to leave comments, you need to log in
Stream API, how to return Map with job name and average result?
I have Stream<CourseResult>
this is how the class looks like
public class CourseResult {
private final Person person;
private final Map<String, Integer> taskResults; // Тут хранятся названия тасков и результаты
public CourseResult(final Person person, final Map<String, Integer> taskResults) {
this.person = person;
this.taskResults = taskResults;
}
public Person getPerson() {
return person;
}
public Map<String, Integer> getTaskResults() {
return taskResults;
}
}
public Map<String, Double> averageScoresPerTask(Stream<CourseResult> programmingResults) {
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question