1 package ch.busyboxes.agoo.service.impl.adapter;
2
3 import java.util.LinkedList;
4 import java.util.List;
5
6 import ch.busyboxes.agoo.controller.model.WebWatchedFile;
7 import ch.busyboxes.agoo.model.WatchedFile;
8
9
10
11
12
13
14 public class WatchedFileAdapter {
15
16
17
18
19
20
21
22 public static WebWatchedFile adaptWatchedFile(WatchedFile watchedFile) {
23 WebWatchedFile webWatchedFile = new WebWatchedFile();
24 webWatchedFile.setId(watchedFile.getId());
25 webWatchedFile.setFilename(watchedFile.getFilename());
26 webWatchedFile.setLastCheck(watchedFile.getLastCheck());
27 webWatchedFile.setMd5Hash(watchedFile.getMd5Hash());
28 webWatchedFile.setWatchedFileState(watchedFile.getWatchedFileState());
29 return webWatchedFile;
30 }
31
32
33
34
35
36
37
38 public static List<WebWatchedFile> adaptWatchedFiles(List<WatchedFile> watchedFiles) {
39 List<WebWatchedFile> webWatchedFiles = new LinkedList<WebWatchedFile>();
40 for (WatchedFile watchedFile : watchedFiles) {
41 webWatchedFiles.add(adaptWatchedFile(watchedFile));
42 }
43 return webWatchedFiles;
44 }
45
46
47 }