1 package ch.busyboxes.agoo.service.impl.adapter;
2
3 import ch.busyboxes.agoo.controller.model.WebWatchedFolder;
4 import ch.busyboxes.agoo.model.WatchedFolder;
5
6
7
8
9
10
11 public class WatchedFolderAdapter {
12
13
14
15
16
17
18
19
20 public static WebWatchedFolder adaptWatchedFolderShallow(WatchedFolder watchedFolder) {
21 WebWatchedFolder webWatchedFolder = new WebWatchedFolder();
22 webWatchedFolder.setId(watchedFolder.getId());
23 webWatchedFolder.setFolderPath(watchedFolder.getFolderPath());
24 if (watchedFolder.getWatchedFiles() != null) {
25 webWatchedFolder.setWatchedFilesCount(watchedFolder.getWatchedFiles().size());
26 } else {
27 webWatchedFolder.setWatchedFilesCount(0);
28 }
29 return webWatchedFolder;
30 }
31
32 }