← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14329: ProgramTrackedEntityAttribute method

 

------------------------------------------------------------
revno: 14329
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-03-21 08:19:49 +0100
message:
  ProgramTrackedEntityAttribute method
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.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/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-03-18 14:54:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-03-21 07:19:49 +0000
@@ -161,6 +161,23 @@
     // -------------------------------------------------------------------------
 
     /**
+     * Returns the ProgramTrackedEntityAttribute of this Program which contains
+     * the given TrackedEntityAttribute.
+     */
+    public ProgramTrackedEntityAttribute getAttribute( TrackedEntityAttribute attribute )
+    {
+        for ( ProgramTrackedEntityAttribute programAttribute : attributes )
+        {
+            if ( programAttribute != null && programAttribute.getAttribute().equals( attribute ) )
+            {
+                return programAttribute;
+            }
+        }
+        
+        return null;
+    }
+    
+    /**
      * Returns all data elements which are part of the stages of this program.
      */
     public Set<DataElement> getAllDataElements()