← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1327: Changed zeroIsSignificant to Boolean and added null-safe get method.

 

------------------------------------------------------------
revno: 1327
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-01-22 10:23:03 +0100
message:
  Changed zeroIsSignificant to Boolean and added null-safe get method.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2010-01-22 03:15:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2010-01-22 09:23:03 +0000
@@ -163,7 +163,7 @@
      * There is no point of saving 0's for this data element default is false
      * ,we don't want to store 0's if not set to true
      */
-    private boolean zeroIsSignificant;
+    private Boolean zeroIsSignificant;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -237,14 +237,12 @@
 
     public DimensionType getDimensionType()
     {
-        return null; // DataElement is DimensionOption for the static
-        // DataElement dimension
+        return null; // DataElement is DimensionOption for the static DataElement dimension
     }
 
     public Set<? extends DimensionOptionElement> getDimensionOptionElements()
     {
-        return null; // DataElement is DimensionOption for the static
-        // DataElement dimension
+        return null; // DataElement is DimensionOption for the static DataElement dimension
     }
 
     public List<? extends DimensionOption> getDimensionOptions()
@@ -258,6 +256,15 @@
     }
 
     // -------------------------------------------------------------------------
+    // Logic
+    // -------------------------------------------------------------------------
+
+    public boolean isZeroIsSignificantNullSafe()
+    {
+        return zeroIsSignificant != null && zeroIsSignificant;
+    }
+    
+    // -------------------------------------------------------------------------
     // hashCode, equals and toString
     // -------------------------------------------------------------------------
 
@@ -539,14 +546,13 @@
         this.aggregationLevels = aggregationLevels;
     }
 
-    public boolean isZeroIsSignificant()
+    public Boolean isZeroIsSignificant()
     {
         return zeroIsSignificant;
     }
 
-    public void setZeroIsSignificant( boolean zeroIsSignificant )
+    public void setZeroIsSignificant( Boolean zeroIsSignificant )
     {
         this.zeroIsSignificant = zeroIsSignificant;
     }
-
 }