1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oness.common.model.auditing;
17
18 import java.util.Collection;
19 import java.util.Iterator;
20 import java.util.LinkedList;
21
22
23 /***
24 * Utils to manage Auditable objects
25 *
26 * @author Carlos Sanchez
27 * @version $Revision: 1.1 $
28 */
29 public class AuditingUtils {
30
31 /***
32 * Get the values not deleted from a collection
33 *
34 * @param values
35 * Colection of Auditable objects
36 * @return
37 */
38 public static Collection notDeleted(Collection values) {
39 Collection c = new LinkedList();
40 Iterator iter = values.iterator();
41 while (iter.hasNext()) {
42 Auditable value = (Auditable) iter.next();
43 if (value.getTransactionTime().isOpen())
44 c.add(value);
45 }
46 return c;
47 }
48 }