changeset 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 eb54fb9f5f2c
children 261a2ee7d9bb
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java
diffstat 3 files changed, 47 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Mar 29 12:51:09 2011 +0000
+++ b/flys-client/ChangeLog	Tue Mar 29 13:44:53 2011 +0000
@@ -1,3 +1,9 @@
+2011-03-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java,
+	  src/main/java/de/intevation/flys/client/shared/model/Collection.java:
+	  Added methods to retrieve the creation time.
+
 2011-03-29  Raimund Renkert <rrenkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/MainMenu.java: Fixed code
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java	Tue Mar 29 12:51:09 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java	Tue Mar 29 13:44:53 2011 +0000
@@ -16,6 +16,8 @@
 
     public String getName();
 
+    public Date getCreationTime();
+
     public Date getLastAccess();
 
     public void addItem(CollectionItem item);
--- 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;
     }
 
 

http://dive4elements.wald.intevation.org