Esempio n. 1
0
 public List<CourseDTO> translateAllCoursestoDataTransferObject(List<CourseBO> coursesToAttend) {
   if (CollectionUtils.isEmpty(coursesToAttend)) {
     return Collections.emptyList();
   } else {
     List<CourseDTO> coursesToAttendDTO = new ArrayList<CourseDTO>();
     for (CourseBO courseBO : coursesToAttend) {
       coursesToAttendDTO.add(
           new CourseDTO(courseBO.getCourseId(), courseBO.getName(), courseBO.getNoOfStudents()));
     }
     return coursesToAttendDTO;
   }
 }
Esempio n. 2
0
 public CourseDTO translateCourseToDataTransferObject(CourseBO courseBO) {
   return new CourseDTO(courseBO.getCourseId(), courseBO.getName(), courseBO.getNoOfStudents());
 }