Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
2012:514d26021728 | 2013:9d5f339d83a3 |
---|---|
544 | 544 |
545 | 545 |
546 public String getDataAsString(String name) { | 546 public String getDataAsString(String name) { |
547 StateData data = getData(name); | 547 StateData data = getData(name); |
548 return data != null ? (String) data.getValue() : null; | 548 return data != null ? (String) data.getValue() : null; |
549 } | |
550 | |
551 | |
552 /** | |
553 * This method returns the value of a StateData object stored in the data | |
554 * pool of this Artifact as Integer. | |
555 * | |
556 * @param name The name of the StateData object. | |
557 * | |
558 * @return an Integer representing the value of the data object or null if | |
559 * no object was found for <i>name</i>. | |
560 * | |
561 * @throws NumberFormatException if the value of the data object could not | |
562 * be transformed into an Integer. | |
563 */ | |
564 public Integer getDataAsInteger(String name) | |
565 throws NumberFormatException | |
566 { | |
567 String value = getDataAsString(name); | |
568 | |
569 if (value != null && value.length() > 0) { | |
570 return Integer.parseInt(value); | |
571 } | |
572 | |
573 return null; | |
549 } | 574 } |
550 | 575 |
551 | 576 |
552 /** | 577 /** |
553 * Add StateData containing a given string. | 578 * Add StateData containing a given string. |