Little refactor
This commit is contained in:
@ -9,8 +9,7 @@ import com.plannaplan.responses.models.GetCurrentAssignmentsResponse;
|
||||
|
||||
public class AssignmentResponseMappers {
|
||||
|
||||
public static final List<GetCurrentAssignmentsResponse> mapAssignmentsListToAssignmentResponseList(
|
||||
List<Assignment> assignments) {
|
||||
public static final List<GetCurrentAssignmentsResponse> mapToResponse(List<Assignment> assignments) {
|
||||
return assignments.stream().filter(Objects::nonNull).map(GetCurrentAssignmentsResponse::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
@ -9,12 +9,11 @@ import com.plannaplan.responses.models.GetCoursesResponse;
|
||||
import com.plannaplan.responses.models.GetCoursesWithGroupsResponse;
|
||||
|
||||
public class CoursesResponseMappers {
|
||||
public static final List<GetCoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
||||
public static final List<GetCoursesResponse> mapToGetCoursesResponse(List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(GetCoursesResponse::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static final List<GetCoursesWithGroupsResponse> mapCoursesWithGrtoupsListToCoursesResponseList(
|
||||
List<Course> courses) {
|
||||
public static final List<GetCoursesWithGroupsResponse> mapToGetCoursesWithGroupsResponse(List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(GetCoursesWithGroupsResponse::new)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.responses.models.abstracts.CoursesResponse;
|
||||
|
||||
public class GetCoursesResponse extends CoursesResponse {
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.responses.models.abstracts.CoursesResponse;
|
||||
import com.plannaplan.types.GroupType;
|
||||
|
||||
public class GetCoursesWithGroupsResponse extends CoursesResponse {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.plannaplan.responses.models;
|
||||
package com.plannaplan.responses.models.abstracts;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
|
Reference in New Issue
Block a user