Moved CoursesResponse To Abstract
This commit is contained in:
@ -5,10 +5,10 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.responses.models.CoursesResponse;
|
||||
import com.plannaplan.responses.models.GetCoursesResponse;
|
||||
|
||||
public class CoursesResponseMappers {
|
||||
public static final List<CoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(CoursesResponse::new).collect(Collectors.toList());
|
||||
public static final List<GetCoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
||||
return courses.stream().filter(Objects::nonNull).map(GetCoursesResponse::new).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
|
||||
public class CoursesResponse {
|
||||
public abstract class CoursesResponse {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
|
@ -0,0 +1,11 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
|
||||
public class GetCoursesResponse extends CoursesResponse {
|
||||
|
||||
public GetCoursesResponse(Course course) {
|
||||
super(course);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user