Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 2013:9d5f339d83a3
#380 Validate the user selected DEM in the server.
flys-artifacts/trunk@3462 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 19 Dec 2011 10:01:17 +0000 |
parents | 1be3a4636ee3 |
children | f73036b991e2 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Mon Dec 19 09:08:40 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Mon Dec 19 10:01:17 2011 +0000 @@ -550,6 +550,31 @@ /** + * This method returns the value of a StateData object stored in the data + * pool of this Artifact as Integer. + * + * @param name The name of the StateData object. + * + * @return an Integer representing the value of the data object or null if + * no object was found for <i>name</i>. + * + * @throws NumberFormatException if the value of the data object could not + * be transformed into an Integer. + */ + public Integer getDataAsInteger(String name) + throws NumberFormatException + { + String value = getDataAsString(name); + + if (value != null && value.length() > 0) { + return Integer.parseInt(value); + } + + return null; + } + + + /** * Add StateData containing a given string. * @param name Name of the data object. * @param value String to store.