コード例 #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;
   }
 }
コード例 #2
0
 public CourseDTO translateCourseToDataTransferObject(CourseBO courseBO) {
   return new CourseDTO(courseBO.getCourseId(), courseBO.getName(), courseBO.getNoOfStudents());
 }