2020-10-08 16:41:13 +02:00
|
|
|
package com.plannaplan.responses.mappers;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import com.plannaplan.entities.Assignment;
|
2020-10-13 17:07:04 +02:00
|
|
|
import com.plannaplan.responses.models.GetCurrentAssignmentsResponse;
|
2020-10-08 16:41:13 +02:00
|
|
|
|
|
|
|
public class AssignmentResponseMappers {
|
|
|
|
|
2020-10-13 17:13:43 +02:00
|
|
|
public static final List<GetCurrentAssignmentsResponse> mapToResponse(List<Assignment> assignments) {
|
2020-10-13 17:07:04 +02:00
|
|
|
return assignments.stream().filter(Objects::nonNull).map(GetCurrentAssignmentsResponse::new)
|
|
|
|
.collect(Collectors.toList());
|
2020-10-08 16:41:13 +02:00
|
|
|
}
|
|
|
|
}
|