Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Tue Mar 29 12:51:09 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Tue Mar 29 13:44:53 2011 +0000 @@ -17,6 +17,12 @@ /** The uuid of the collection. */ protected String uuid; + /** The name of the collection.*/ + protected String name; + + /** The creation time of this collection.*/ + protected Date creation; + /** The list of artifacts that are managed by this Collection.*/ protected List<CollectionItem> items; @@ -39,18 +45,50 @@ } + /** + * Creates a new DefaultCollection with uuid and name. + * + * @param uuid The identifier of this collection. + * @param name The name of this collection. + */ + public DefaultCollection(String uuid, String name) { + this(uuid); + + this.name = name; + } + + + /** + * Creates a new DefaultCollection with uuid and name. + * + * @param uuid The identifier of this collection. + * @param name The name of this collection. + * @param creation The creation time. + */ + public DefaultCollection(String uuid, String name, Date creation) { + this(uuid, name); + + this.creation = creation; + } + + public String identifier() { return uuid; } + public Date getCreationTime() { + return creation; + } + + public Date getLastAccess() { return new Date(); } public String getName() { - return uuid; + return name; }