15 lines
490 B
Java
15 lines
490 B
Java
|
package com.plannaplan.responses.mappers;
|
||
|
|
||
|
import java.util.List;
|
||
|
import java.util.Objects;
|
||
|
import java.util.stream.Collectors;
|
||
|
|
||
|
import com.plannaplan.entities.Course;
|
||
|
import com.plannaplan.responses.models.CoursesResponse;
|
||
|
|
||
|
public class CoursesResponseMappers {
|
||
|
public static final List<CoursesResponse> mapCoursesListToCoursesResponseList(List<Course> courses) {
|
||
|
return courses.stream().filter(Objects::nonNull).map(CoursesResponse::new).collect(Collectors.toList());
|
||
|
}
|
||
|
}
|