=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AbstractIdentifiableObject.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AbstractIdentifiableObject.java 2011-11-03 01:02:13 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AbstractIdentifiableObject.java 2011-11-03 16:01:58 +0000 @@ -194,6 +194,26 @@ } /** + * Get a map of uids to internal identifiers + * + * @param objects the IdentifiableObjects to put in the map + * @return the map + */ + public static Map getUIDMap( Collection objects ) + { + Map map = new HashMap(); + for ( IdentifiableObject object : objects ) + { + String uid = object.getUid(); + int internalId = object.getId(); + + map.put( uid, internalId ); + } + + return map; + } + + /** * Get a map of codes to internal identifiers * * @param objects the NameableObjects to put in the map @@ -221,6 +241,6 @@ } } return map; - } + } }