Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/IntegerProperty.java @ 1507:c21d14e48040
Improved validation and property handling.
flys-client/trunk@3645 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 11 Jan 2012 10:21:22 +0000 |
parents | 3304608baf35 |
children |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/IntegerProperty.java Mon Jan 09 18:06:01 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/IntegerProperty.java Wed Jan 11 10:21:22 2012 +0000 @@ -22,14 +22,29 @@ */ public IntegerProperty( String name, - String value) + Integer value) { this.name = name; - this.value = value; + this.value = value.toString(); this.attributes = new HashMap<String, String>(); } + @Override + public Integer getValue() { + try { + return Integer.valueOf(this.value); + } + catch(NumberFormatException nfe) { + return null; + } + } + + + public void setValue(Integer value) { + this.value = value.toString(); + } + public Object clone() { IntegerProperty clone = new IntegerProperty(this.getName(), this.getValue());