changeset 256:55d08706ccf2

Added a getData(String) method to a State to get just a single StateData object. artifacts/trunk@1757 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 10:27:27 +0000
parents efbad8c5c0e5
children 8c2b6cdf22ad
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java
diffstat 3 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Apr 28 08:10:03 2011 +0000
+++ b/ChangeLog	Thu Apr 28 10:27:27 2011 +0000
@@ -1,3 +1,9 @@
+2011-04-28  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java:
+	  States have now a method getData(String) to retrieve just a single StateData object.
+
 2011-04-28  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java	Thu Apr 28 08:10:03 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java	Thu Apr 28 10:27:27 2011 +0000
@@ -142,6 +142,18 @@
 
 
     /**
+     * Returns a specific data object of the state.
+     *
+     * @param name The name of the data object.
+     *
+     * @return a data object of the state or null if no such data object exists.
+     */
+    public StateData getData(String name) {
+        return data.get(name);
+    }
+
+
+    /**
      * Add new data to the state. NOTE: If there is already an object existing
      * with the key <i>name</i>, this object is overwritten by the new value.
      *
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Thu Apr 28 08:10:03 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java	Thu Apr 28 10:27:27 2011 +0000
@@ -54,6 +54,16 @@
 
 
     /**
+     * Returns a single desired StateData object based on its name.
+     *
+     * @param name The name of the desired StateData object.
+     *
+     * @return the desired StateData object.
+     */
+    public StateData getData(String name);
+
+
+    /**
      * This method should be used to add a new {@link StateData} object to the
      * data pool of the state.
      *

http://dive4elements.wald.intevation.org