← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1466: Added utility method

 

------------------------------------------------------------
revno: 1466
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-02-22 15:46:42 +0100
message:
  Added utility method
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java	2010-02-18 15:41:11 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java	2010-02-22 14:46:42 +0000
@@ -190,6 +190,24 @@
     }
     
     /**
+     * Creates a List out of an array of objects.
+     * 
+     * @param objects the array of objects.
+     * @return a List of objects.
+     */
+    public static <T> List<T> getList( T... objects )
+    {
+        List<T> list = new ArrayList<T>();
+        
+        for ( T object: objects )
+        {
+            list.add( object );
+        }
+        
+        return list;
+    }
+    
+    /**
      * Returns a Map based on an argument Collection of objects where the key is
      * the object identifier and the value if the object itself.
      *