21 lines
809 B
Java
Executable File
21 lines
809 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.entities.Groups;
|
|
import com.plannaplan.responses.models.AssignmentResponse;
|
|
|
|
public class AssignmentResponseMappers {
|
|
public static final List<AssignmentResponse> mapGroupsListToAssignmentResponseList(List<Groups> groups) {
|
|
return groups.stream().filter(Objects::nonNull).map(AssignmentResponse::new).collect(Collectors.toList());
|
|
}
|
|
|
|
public static final List<AssignmentResponse> mapAssignmentsListToAssignmentResponseList(
|
|
List<Assignment> assignments) {
|
|
return assignments.stream().filter(Objects::nonNull).map(AssignmentResponse::new).collect(Collectors.toList());
|
|
}
|
|
}
|