17 lines
547 B
Java
Executable File
17 lines
547 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> mapToResponse(List<Assignment> assignments) {
|
|
return assignments.stream().filter(Objects::nonNull).map(GetCurrentAssignmentsResponse::new)
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|