2020-10-09 14:53:54 +02:00
|
|
|
package com.plannaplan.responses.mappers;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import com.plannaplan.entities.Course;
|
2020-10-13 16:19:40 +02:00
|
|
|
import com.plannaplan.responses.models.GetCoursesResponse;
|
2020-10-09 14:53:54 +02:00
|
|
|
|
|
|
|
public class CoursesResponseMappers {
|
2020-10-13 16:19:40 +02:00
|
|
|
public static final List<GetCoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
|
|
|
return courses.stream().filter(Objects::nonNull).map(GetCoursesResponse::new).collect(Collectors.toList());
|
2020-10-09 14:53:54 +02:00
|
|
|
}
|
|
|
|
}
|