Responses up[dated
This commit is contained in:
@ -5,16 +5,13 @@ 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;
|
||||
import com.plannaplan.responses.models.GetCurrentAssignmentsResponse;
|
||||
|
||||
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(
|
||||
public static final List<GetCurrentAssignmentsResponse> mapAssignmentsListToAssignmentResponseList(
|
||||
List<Assignment> assignments) {
|
||||
return assignments.stream().filter(Objects::nonNull).map(AssignmentResponse::new).collect(Collectors.toList());
|
||||
return assignments.stream().filter(Objects::nonNull).map(GetCurrentAssignmentsResponse::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,16 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.responses.models.GetCoursesResponse;
|
||||
import com.plannaplan.responses.models.GetCoursesWithGroupsResponse;
|
||||
|
||||
public class CoursesResponseMappers {
|
||||
public static final List<GetCoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(GetCoursesResponse::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static final List<GetCoursesWithGroupsResponse> mapCoursesWithGrtoupsListToCoursesResponseList(
|
||||
List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(GetCoursesWithGroupsResponse::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user