18 lines
589 B
Java
Executable File
18 lines
589 B
Java
Executable File
package com.plannaplan.responses.mappers;
|
|
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
|
|
import com.plannaplan.entities.Assignment;
|
|
import com.plannaplan.responses.models.GetCurrentAssignmentsResponse;
|
|
|
|
public class AssignmentResponseMappers {
|
|
|
|
public static final List<GetCurrentAssignmentsResponse> mapAssignmentsListToAssignmentResponseList(
|
|
List<Assignment> assignments) {
|
|
return assignments.stream().filter(Objects::nonNull).map(GetCurrentAssignmentsResponse::new)
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|