Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java @ 95:e2abb6b9dc7e
A collection provides a method to retrieve its creation time now.
flys-client/trunk@1608 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 Mar 2011 13:44:53 +0000 |
parents | 74257b95567b |
children | ba238f917b94 |
comparison
equal
deleted
inserted
replaced
94:eb54fb9f5f2c | 95:e2abb6b9dc7e |
---|---|
14 */ | 14 */ |
15 public class DefaultCollection implements Collection { | 15 public class DefaultCollection implements Collection { |
16 | 16 |
17 /** The uuid of the collection. */ | 17 /** The uuid of the collection. */ |
18 protected String uuid; | 18 protected String uuid; |
19 | |
20 /** The name of the collection.*/ | |
21 protected String name; | |
22 | |
23 /** The creation time of this collection.*/ | |
24 protected Date creation; | |
19 | 25 |
20 /** The list of artifacts that are managed by this Collection.*/ | 26 /** The list of artifacts that are managed by this Collection.*/ |
21 protected List<CollectionItem> items; | 27 protected List<CollectionItem> items; |
22 | 28 |
23 | 29 |
37 this.uuid = uuid; | 43 this.uuid = uuid; |
38 this.items = new ArrayList<CollectionItem>(); | 44 this.items = new ArrayList<CollectionItem>(); |
39 } | 45 } |
40 | 46 |
41 | 47 |
48 /** | |
49 * Creates a new DefaultCollection with uuid and name. | |
50 * | |
51 * @param uuid The identifier of this collection. | |
52 * @param name The name of this collection. | |
53 */ | |
54 public DefaultCollection(String uuid, String name) { | |
55 this(uuid); | |
56 | |
57 this.name = name; | |
58 } | |
59 | |
60 | |
61 /** | |
62 * Creates a new DefaultCollection with uuid and name. | |
63 * | |
64 * @param uuid The identifier of this collection. | |
65 * @param name The name of this collection. | |
66 * @param creation The creation time. | |
67 */ | |
68 public DefaultCollection(String uuid, String name, Date creation) { | |
69 this(uuid, name); | |
70 | |
71 this.creation = creation; | |
72 } | |
73 | |
74 | |
42 public String identifier() { | 75 public String identifier() { |
43 return uuid; | 76 return uuid; |
77 } | |
78 | |
79 | |
80 public Date getCreationTime() { | |
81 return creation; | |
44 } | 82 } |
45 | 83 |
46 | 84 |
47 public Date getLastAccess() { | 85 public Date getLastAccess() { |
48 return new Date(); | 86 return new Date(); |
49 } | 87 } |
50 | 88 |
51 | 89 |
52 public String getName() { | 90 public String getName() { |
53 return uuid; | 91 return name; |
54 } | 92 } |
55 | 93 |
56 | 94 |
57 public void addItem(CollectionItem item) { | 95 public void addItem(CollectionItem item) { |
58 if (item != null) { | 96 if (item != null) { |