comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 2128:bf67eb014443

Added convinience functions to FLYSArtifact and FLYSUtils. flys-artifacts/trunk@3703 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 18 Jan 2012 09:29:12 +0000
parents 85d31c2620e5
children 79a94c4171cb
comparison
equal deleted inserted replaced
2127:0c7847b8e85e 2128:bf67eb014443
579 { 579 {
580 String value = getDataAsString(name); 580 String value = getDataAsString(name);
581 581
582 if (value != null && value.length() > 0) { 582 if (value != null && value.length() > 0) {
583 return Integer.parseInt(value); 583 return Integer.parseInt(value);
584 }
585
586 return null;
587 }
588
589
590 /**
591 * This method returns the value of a StateData object stored in the data
592 * pool of this Artifact as Long.
593 *
594 * @param name The name of the StateData object.
595 *
596 * @return a Long representing the value of the data object or null if
597 * no object was found for <i>name</i>.
598 *
599 * @throws NumberFormatException if the value of the data object could not
600 * be transformed into a Long.
601 */
602 public Long getDataAsLong(String name)
603 throws NumberFormatException
604 {
605 String value = getDataAsString(name);
606
607 if (value != null && value.length() > 0) {
608 return Long.parseLong(value);
584 } 609 }
585 610
586 return null; 611 return null;
587 } 612 }
588 613

http://dive4elements.wald.intevation.org