=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2015-03-13 15:48:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2015-06-11 11:38:56 +0000 @@ -116,7 +116,7 @@ * @return List of DataElements with a given key, or all dataelements if no * match. */ - Collection searchDataElementsByName( String key ); + List searchDataElementsByName( String key ); /** * Returns a DataElement with a given short name. @@ -129,26 +129,26 @@ /** * Returns all DataElements. * - * @return a collection of all DataElements, or an empty collection if there + * @return a list of all DataElements, or an empty collection if there * are no DataElements. */ - Collection getAllDataElements(); + List getAllDataElements(); /** * Returns all DataElements with corresponding identifiers. Returns all * DataElements if the given argument is null. * * @param identifiers the collection of identifiers. - * @return a collection of DataElements. + * @return a list of DataElements. */ - Collection getDataElements( Collection identifiers ); + List getDataElements( Collection identifiers ); /** * Returns all DataElements with corresponding identifiers. Returns all * DataElements if the given argument is null. * * @param uids the collection of uids. - * @return a collection of DataElements. + * @return a list of DataElements. */ List getDataElementsByUid( Collection uids ); @@ -158,34 +158,34 @@ * * @return all DataElements with types that are possible to aggregate. */ - Collection getAggregateableDataElements(); + List getAggregateableDataElements(); /** * Returns all DataElements with a given aggregation operator. * * @param aggregationOperator the aggregation operator of the DataElements * to return. - * @return a collection of all DataElements with the given aggregation + * @return a list of all DataElements with the given aggregation * operator, or an empty collection if no DataElements have the * aggregation operator. */ - Collection getDataElementsByAggregationOperator( String aggregationOperator ); - - /** - * Returns all DataElements with the given domain type. - * - * @param domainType the DataElementDomainType. - * @return all DataElements with the given domainType. - */ - Collection getDataElementsByDomainType( DataElementDomain domainType ); - - /** - * Returns all DataElements with the given domain type. - * - * @param domainType the DataElementDomainType. - * @return all DataElements with the given domainType. - */ - Collection getDataElementsByDomainType( DataElementDomain domainType, int first, int max ); + List getDataElementsByAggregationOperator( String aggregationOperator ); + + /** + * Returns all DataElements with the given domain type. + * + * @param domainType the DataElementDomainType. + * @return all DataElements with the given domainType. + */ + List getDataElementsByDomainType( DataElementDomain domainType ); + + /** + * Returns all DataElements with the given domain type. + * + * @param domainType the DataElementDomainType. + * @return all DataElements with the given domainType. + */ + List getDataElementsByDomainType( DataElementDomain domainType, int first, int max ); /** * Returns all DataElements with the given type. @@ -194,15 +194,15 @@ * @return all DataElements with the given type. */ - Collection getDataElementsByType( String type ); + List getDataElementsByType( String type ); /** * Returns the DataElements with the given PeriodType. * * @param periodType the PeriodType. - * @return a Collection of DataElements. + * @return a list of DataElements. */ - Collection getDataElementsByPeriodType( PeriodType periodType ); + List getDataElementsByPeriodType( PeriodType periodType ); /** * Returns all DataElements with the given category combo. @@ -210,7 +210,7 @@ * @param categoryCombo the DataElementCategoryCombo. * @return all DataElements with the given category combo. */ - Collection getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ); + List getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ); /** * Returns a Map with DataElementCategoryCombo as key and a Collection of @@ -239,28 +239,28 @@ * @return all DataElements which are associated with one or more * DataElementGroupSets. */ - Collection getDataElementsWithGroupSets(); + List getDataElementsWithGroupSets(); /** * Returns all DataElements which are not member of any DataElementGroups. * * @return all DataElements which are not member of any DataElementGroups. */ - Collection getDataElementsWithoutGroups(); + List getDataElementsWithoutGroups(); /** * Returns all DataElements which are not assigned to any DataSets. * * @return all DataElements which are not assigned to any DataSets. */ - Collection getDataElementsWithoutDataSets(); + List getDataElementsWithoutDataSets(); /** * Returns all DataElements which are assigned to at least one DataSet. * * @return all DataElements which are assigned to at least one DataSet. */ - Collection getDataElementsWithDataSets(); + List getDataElementsWithDataSets(); /** * Returns all DataElements which are assigned to any of the given DataSets. @@ -268,7 +268,7 @@ * @param dataSets the collection of DataSets. * @return all DataElements which are assigned to any of the given DataSets. */ - Collection getDataElementsByDataSets( Collection dataSets ); + List getDataElementsByDataSets( Collection dataSets ); /** * Returns all DataElements which have the given aggregation level assigned. @@ -276,13 +276,13 @@ * @param aggregationLevel the aggregation level. * @return all DataElements which have the given aggregation level assigned. */ - Collection getDataElementsByAggregationLevel( int aggregationLevel ); - - Collection getDataElementsLikeName( String name ); - - Collection getDataElementsBetween( int first, int max ); - - Collection getDataElementsBetweenByName( String name, int first, int max ); + List getDataElementsByAggregationLevel( int aggregationLevel ); + + List getDataElementsLikeName( String name ); + + List getDataElementsBetween( int first, int max ); + + List getDataElementsBetweenByName( String name, int first, int max ); int getDataElementCount(); @@ -350,7 +350,7 @@ * @param identifiers the id collection. * @return data elements with identifiers in the given collection. */ - Collection getDataElementGroups( Collection identifiers ); + List getDataElementGroups( Collection identifiers ); /** * Returns the data element groups with the given uids. @@ -382,7 +382,7 @@ * @return a collection of all DataElementGroups, or an empty collection if * no DataElementGroups exist. */ - Collection getAllDataElementGroups(); + List getAllDataElementGroups(); /** @@ -410,7 +410,7 @@ * @return a collection of all DataElementGroups that contain the given * DataElement. */ - Collection getGroupsContainingDataElement( DataElement dataElement ); + List getGroupsContainingDataElement( DataElement dataElement ); /** * Returns data elements with identifier in the given id. @@ -418,7 +418,7 @@ * @param groupId is the id of data element group. * @return data elements with identifier in the given id. */ - Collection getDataElementsByGroupId( int groupId ); + Set getDataElementsByGroupId( int groupId ); /** * Defines the given data elements as zero is significant. All other data @@ -432,30 +432,30 @@ /** * Returns all DataElement which zeroIsSignificant property is true or false * - * @param zeroIsSignificant is zeroIsSignificant property + * @param list is zeroIsSignificant property * @return a collection of all DataElement */ - Collection getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ); + List getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ); /** * Returns all DataElement which zeroIsSignificant property is true or false * * @param zeroIsSignificant is zeroIsSignificant property * @param dataElementGroup is group contain data elements - * @return a collection of all DataElement + * @return a set of data elements. */ - Collection getDataElementsByZeroIsSignificantAndGroup( boolean zeroIsSignificant, + Set getDataElementsByZeroIsSignificantAndGroup( boolean zeroIsSignificant, DataElementGroup dataElementGroup ); - Collection getDataElementGroupsBetween( int first, int max ); + List getDataElementGroupsBetween( int first, int max ); - Collection getDataElementGroupsBetweenByName( String name, int first, int max ); + List getDataElementGroupsBetweenByName( String name, int first, int max ); int getDataElementGroupCount(); int getDataElementGroupCountByName( String name ); - Collection getDataElements( DataSet dataSet, String key, Integer max ); + List getDataElements( DataSet dataSet, String key, Integer max ); // ------------------------------------------------------------------------- // DataElementGroupSet @@ -475,21 +475,21 @@ DataElementGroupSet getDataElementGroupSetByName( String name ); - Collection getCompulsoryDataElementGroupSets(); - - Collection getCompulsoryDataElementGroupSetsWithMembers(); - - Collection getCompulsoryDataElementGroupSetsNotAssignedTo( DataElement dataElement ); - - Collection getAllDataElementGroupSets(); - - Collection getDataElementGroupSets( Collection identifiers ); + List getCompulsoryDataElementGroupSets(); + + List getCompulsoryDataElementGroupSetsWithMembers(); + + List getCompulsoryDataElementGroupSetsNotAssignedTo( DataElement dataElement ); + + List getAllDataElementGroupSets(); + + List getDataElementGroupSets( Collection identifiers ); List getDataElementGroupSetsByUid( Collection uids ); - Collection getDataElementGroupSetsBetween( int first, int max ); + List getDataElementGroupSetsBetween( int first, int max ); - Collection getDataElementGroupSetsBetweenByName( String name, int first, int max ); + List getDataElementGroupSetsBetweenByName( String name, int first, int max ); int getDataElementGroupSetCount(); === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2015-03-08 14:00:13 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2015-06-11 11:38:56 +0000 @@ -29,6 +29,7 @@ */ import java.util.Collection; +import java.util.List; import java.util.Set; import org.hisp.dhis.common.GenericDimensionalObjectStore; @@ -55,7 +56,7 @@ * @param key the name of the DataElement to return. * @return List of DataElements with a given key, or all dataelements if no match. */ - Collection searchDataElementsByName( String key ); + List searchDataElementsByName( String key ); /** * Returns all DataElements with types that are possible to aggregate. The @@ -63,7 +64,7 @@ * * @return all DataElements with types that are possible to aggregate. */ - Collection getAggregateableDataElements(); + List getAggregateableDataElements(); /** * Returns all DataElements with a given aggregation operator. @@ -74,7 +75,7 @@ * operator, or an empty collection if no DataElements have the * aggregation operator. */ - Collection getDataElementsByAggregationOperator( String aggregationOperator ); + List getDataElementsByAggregationOperator( String aggregationOperator ); /** * Returns all DataElements with the given domain type. @@ -82,7 +83,7 @@ * @param domainType the domainType. * @return all DataElements with the given domainType. */ - Collection getDataElementsByDomainType( DataElementDomain domainType ); + List getDataElementsByDomainType( DataElementDomain domainType ); /** * Returns all DataElements with the given domain type. @@ -90,7 +91,7 @@ * @param domainType the domainType. * @return all DataElements with the given domainType. */ - Collection getDataElementsByDomainType( DataElementDomain domainType, int first, int max ); + List getDataElementsByDomainType( DataElementDomain domainType, int first, int max ); /** * Returns all DataElements with the given type. @@ -99,7 +100,7 @@ * @return all DataElements with the given type. */ - Collection getDataElementsByType( String type ); + List getDataElementsByType( String type ); /** * Returns all DataElements with the given category combo. @@ -107,7 +108,7 @@ * @param categoryCombo the DataElementCategoryCombo. * @return all DataElements with the given category combo. */ - Collection getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ); + List getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ); /** * Returns all DataElements which are associated with one or more @@ -116,7 +117,7 @@ * @return all DataElements which are associated with one or more * DataElementGroupSets. */ - Collection getDataElementsWithGroupSets(); + List getDataElementsWithGroupSets(); /** * Defines the given data elements as zero is significant. @@ -130,28 +131,28 @@ * @param zeroIsSignificant is zeroIsSignificant property * @return a collection of all DataElement */ - Collection getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ); + List getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ); /** * Returns all DataElements which are not member of any DataElementGroups. * * @return all DataElements which are not member of any DataElementGroups. */ - Collection getDataElementsWithoutGroups(); + List getDataElementsWithoutGroups(); /** * Returns all DataElements which are not assigned to any DataSets. * * @return all DataElements which are not assigned to any DataSets. */ - Collection getDataElementsWithoutDataSets(); + List getDataElementsWithoutDataSets(); /** * Returns all DataElements which are assigned to at least one DataSet. * * @return all DataElements which are assigned to at least one DataSet. */ - Collection getDataElementsWithDataSets(); + List getDataElementsWithDataSets(); /** * Returns all DataElements which are assigned to any of the given DataSets. @@ -159,7 +160,7 @@ * @param dataSets the collection of DataSets. * @return all DataElements which are assigned to any of the given DataSets. */ - Collection getDataElementsByDataSets( Collection dataSets ); + List getDataElementsByDataSets( Collection dataSets ); /** * Returns all DataElements which have the given aggregation level assigned. @@ -167,7 +168,7 @@ * @param aggregationLevel the aggregation level. * @return all DataElements which have the given aggregation level assigned. */ - Collection getDataElementsByAggregationLevel( int aggregationLevel ); + List getDataElementsByAggregationLevel( int aggregationLevel ); /** * Returns a mapping of data element uid and associated category option combo @@ -178,7 +179,7 @@ */ ListMap getDataElementCategoryOptionComboMap( Set dataElementUids ); - Collection get( DataSet dataSet, String key, Integer max ); + List get( DataSet dataSet, String key, Integer max ); int getCountByDomainType( DataElementDomain domainType ); } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2015-05-28 18:21:56 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2015-06-11 11:38:56 +0000 @@ -131,15 +131,15 @@ } @Override - public Collection getAllDataElements() + public List getAllDataElements() { return i18n( i18nService, dataElementStore.getAll() ); } @Override - public Collection getDataElements( final Collection identifiers ) + public List getDataElements( final Collection identifiers ) { - Collection dataElements = getAllDataElements(); + List dataElements = getAllDataElements(); return identifiers == null ? dataElements : FilterUtils.filter( dataElements, new Filter() { @@ -167,16 +167,16 @@ } @Override - public Collection getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ) + public List getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ) { return dataElementStore.getDataElementsByZeroIsSignificant( zeroIsSignificant ); } @Override - public Collection getDataElementsByZeroIsSignificantAndGroup( boolean zeroIsSignificant, + public Set getDataElementsByZeroIsSignificantAndGroup( boolean zeroIsSignificant, DataElementGroup dataElementGroup ) { - Collection dataElements = new HashSet<>(); + Set dataElements = new HashSet<>(); for ( DataElement element : dataElementGroup.getMembers() ) { @@ -190,7 +190,7 @@ } @Override - public Collection getAggregateableDataElements() + public List getAggregateableDataElements() { return i18n( i18nService, dataElementStore.getAggregateableDataElements() ); } @@ -209,7 +209,7 @@ } @Override - public Collection searchDataElementsByName( String key ) + public List searchDataElementsByName( String key ) { return i18n( i18nService, dataElementStore.searchDataElementsByName( key ) ); } @@ -228,21 +228,21 @@ } @Override - public Collection getDataElementsByAggregationOperator( String aggregationOperator ) + public List getDataElementsByAggregationOperator( String aggregationOperator ) { return i18n( i18nService, dataElementStore.getDataElementsByAggregationOperator( aggregationOperator ) ); } @Override - public Collection getDataElementsByType( String type ) + public List getDataElementsByType( String type ) { return i18n( i18nService, dataElementStore.getDataElementsByType( type ) ); } @Override - public Collection getDataElementsByPeriodType( final PeriodType periodType ) + public List getDataElementsByPeriodType( final PeriodType periodType ) { - Collection dataElements = getAllDataElements(); + List dataElements = getAllDataElements(); return FilterUtils.filter( dataElements, new Filter() { @@ -255,19 +255,19 @@ } @Override - public Collection getDataElementsByDomainType( DataElementDomain domainType ) + public List getDataElementsByDomainType( DataElementDomain domainType ) { return i18n( i18nService, dataElementStore.getDataElementsByDomainType( domainType ) ); } @Override - public Collection getDataElementsByDomainType( DataElementDomain domainType, int first, int max ) + public List getDataElementsByDomainType( DataElementDomain domainType, int first, int max ) { return i18n( i18nService, dataElementStore.getDataElementsByDomainType( domainType, first, max ) ); } @Override - public Collection getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ) + public List getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ) { return i18n( i18nService, dataElementStore.getDataElementByCategoryCombo( categoryCombo ) ); } @@ -314,31 +314,31 @@ } @Override - public Collection getDataElementsWithGroupSets() + public List getDataElementsWithGroupSets() { return i18n( i18nService, dataElementStore.getDataElementsWithGroupSets() ); } @Override - public Collection getDataElementsWithoutGroups() + public List getDataElementsWithoutGroups() { return i18n( i18nService, dataElementStore.getDataElementsWithoutGroups() ); } @Override - public Collection getDataElementsWithoutDataSets() + public List getDataElementsWithoutDataSets() { return i18n( i18nService, dataElementStore.getDataElementsWithoutDataSets() ); } @Override - public Collection getDataElementsWithDataSets() + public List getDataElementsWithDataSets() { return i18n( i18nService, dataElementStore.getDataElementsWithDataSets() ); } @Override - public Collection getDataElementsLikeName( String name ) + public List getDataElementsLikeName( String name ) { return getObjectsByName( i18nService, dataElementStore, name ); } @@ -362,25 +362,25 @@ } @Override - public Collection getDataElementsBetween( int first, int max ) + public List getDataElementsBetween( int first, int max ) { return getObjectsBetween( i18nService, dataElementStore, first, max ); } @Override - public Collection getDataElementsBetweenByName( String name, int first, int max ) + public List getDataElementsBetweenByName( String name, int first, int max ) { return getObjectsBetweenByName( i18nService, dataElementStore, name, first, max ); } @Override - public Collection getDataElementsByDataSets( Collection dataSets ) + public List getDataElementsByDataSets( Collection dataSets ) { return i18n( i18nService, dataElementStore.getDataElementsByDataSets( dataSets ) ); } @Override - public Collection getDataElementsByAggregationLevel( int aggregationLevel ) + public List getDataElementsByAggregationLevel( int aggregationLevel ) { return i18n( i18nService, dataElementStore.getDataElementsByAggregationLevel( aggregationLevel ) ); } @@ -405,7 +405,7 @@ } @Override - public Collection getDataElements( DataSet dataSet, String key, Integer max ) + public List getDataElements( DataSet dataSet, String key, Integer max ) { return i18n( i18nService, dataElementStore.get( dataSet, key, max ) ); } @@ -454,9 +454,9 @@ } @Override - public Collection getDataElementGroups( final Collection identifiers ) + public List getDataElementGroups( final Collection identifiers ) { - Collection groups = getAllDataElementGroups(); + List groups = getAllDataElementGroups(); return identifiers == null ? groups : FilterUtils.filter( groups, new Filter() { @@ -481,7 +481,7 @@ } @Override - public Collection getAllDataElementGroups() + public List getAllDataElementGroups() { return i18n( i18nService, dataElementGroupStore.getAll() ); } @@ -520,9 +520,9 @@ } @Override - public Collection getGroupsContainingDataElement( DataElement dataElement ) + public List getGroupsContainingDataElement( DataElement dataElement ) { - Collection groups = getAllDataElementGroups(); + List groups = getAllDataElementGroups(); Iterator iterator = groups.iterator(); @@ -538,7 +538,7 @@ } @Override - public Collection getDataElementsByGroupId( int groupId ) + public Set getDataElementsByGroupId( int groupId ) { return i18n( i18nService, dataElementGroupStore.get( groupId ).getMembers() ); } @@ -556,13 +556,13 @@ } @Override - public Collection getDataElementGroupsBetween( int first, int max ) + public List getDataElementGroupsBetween( int first, int max ) { return getObjectsBetween( i18nService, dataElementGroupStore, first, max ); } @Override - public Collection getDataElementGroupsBetweenByName( String name, int first, int max ) + public List getDataElementGroupsBetweenByName( String name, int first, int max ) { return getObjectsBetweenByName( i18nService, dataElementGroupStore, name, first, max ); } @@ -629,9 +629,9 @@ } @Override - public Collection getCompulsoryDataElementGroupSets() + public List getCompulsoryDataElementGroupSets() { - Collection groupSets = new ArrayList<>(); + List groupSets = new ArrayList<>(); for ( DataElementGroupSet groupSet : getAllDataElementGroupSets() ) { @@ -645,7 +645,7 @@ } @Override - public Collection getCompulsoryDataElementGroupSetsWithMembers() + public List getCompulsoryDataElementGroupSetsWithMembers() { return FilterUtils.filter( getAllDataElementGroupSets(), new Filter() { @@ -658,9 +658,9 @@ } @Override - public Collection getCompulsoryDataElementGroupSetsNotAssignedTo( DataElement dataElement ) + public List getCompulsoryDataElementGroupSetsNotAssignedTo( DataElement dataElement ) { - Collection groupSets = new ArrayList<>(); + List groupSets = new ArrayList<>(); for ( DataElementGroupSet groupSet : getCompulsoryDataElementGroupSets() ) { @@ -674,15 +674,15 @@ } @Override - public Collection getAllDataElementGroupSets() + public List getAllDataElementGroupSets() { return i18n( i18nService, dataElementGroupSetStore.getAll() ); } @Override - public Collection getDataElementGroupSets( final Collection identifiers ) + public List getDataElementGroupSets( final Collection identifiers ) { - Collection groupSets = getAllDataElementGroupSets(); + List groupSets = getAllDataElementGroupSets(); return identifiers == null ? groupSets : FilterUtils.filter( groupSets, new Filter() { @@ -713,13 +713,13 @@ } @Override - public Collection getDataElementGroupSetsBetween( int first, int max ) + public List getDataElementGroupSetsBetween( int first, int max ) { return getObjectsBetween( i18nService, dataElementGroupSetStore, first, max ); } @Override - public Collection getDataElementGroupSetsBetweenByName( String name, int first, int max ) + public List getDataElementGroupSetsBetweenByName( String name, int first, int max ) { return getObjectsBetweenByName( i18nService, dataElementGroupSetStore, name, first, max ); } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2015-05-28 14:33:21 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2015-06-11 11:38:56 +0000 @@ -34,6 +34,7 @@ import java.sql.SQLException; import java.util.Collection; import java.util.HashSet; +import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; @@ -68,14 +69,14 @@ @Override @SuppressWarnings("unchecked") - public Collection searchDataElementsByName( String key ) + public List searchDataElementsByName( String key ) { return getCriteria( Restrictions.ilike( "name", "%" + key + "%" ) ).list(); } @Override @SuppressWarnings("unchecked") - public Collection getAggregateableDataElements() + public List getAggregateableDataElements() { Set types = new HashSet<>(); @@ -87,28 +88,28 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByAggregationOperator( String aggregationOperator ) + public List getDataElementsByAggregationOperator( String aggregationOperator ) { return getCriteria( Restrictions.eq( "aggregationOperator", aggregationOperator ) ).list(); } @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByType( String type ) + public List getDataElementsByType( String type ) { return getCriteria( Restrictions.eq( "type", type ) ).list(); } @Override @SuppressWarnings( "unchecked" ) - public Collection getDataElementsByDomainType( DataElementDomain domainType ) + public List getDataElementsByDomainType( DataElementDomain domainType ) { return getCriteria( Restrictions.eq( "domainType", domainType ) ).list(); } @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByDomainType( DataElementDomain domainType, int first, int max ) + public List getDataElementsByDomainType( DataElementDomain domainType, int first, int max ) { Criteria criteria = getCriteria(); criteria.add( Restrictions.eq( "domainType", domainType ) ); @@ -122,14 +123,14 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ) + public List getDataElementByCategoryCombo( DataElementCategoryCombo categoryCombo ) { return getCriteria( Restrictions.eq( "categoryCombo", categoryCombo ) ).list(); } @Override @SuppressWarnings("unchecked") - public Collection getDataElementsWithGroupSets() + public List getDataElementsWithGroupSets() { String hql = "from DataElement d where d.groupSets.size > 0"; @@ -160,7 +161,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ) + public List getDataElementsByZeroIsSignificant( boolean zeroIsSignificant ) { Criteria criteria = getCriteria(); criteria.add( Restrictions.eq( "zeroIsSignificant", zeroIsSignificant ) ); @@ -171,7 +172,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsWithoutGroups() + public List getDataElementsWithoutGroups() { String hql = "from DataElement d where d.groups.size = 0"; @@ -180,7 +181,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsWithoutDataSets() + public List getDataElementsWithoutDataSets() { String hql = "from DataElement d where d.dataSets.size = 0 and d.domainType =:domainType"; @@ -189,7 +190,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsWithDataSets() + public List getDataElementsWithDataSets() { String hql = "from DataElement d where d.dataSets.size > 0"; @@ -198,7 +199,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByDataSets( Collection dataSets ) + public List getDataElementsByDataSets( Collection dataSets ) { String hql = "select distinct de from DataElement de join de.dataSets ds where ds.id in (:ids)"; @@ -207,7 +208,7 @@ @Override @SuppressWarnings("unchecked") - public Collection getDataElementsByAggregationLevel( int aggregationLevel ) + public List getDataElementsByAggregationLevel( int aggregationLevel ) { String hql = "from DataElement de join de.aggregationLevels al where al = :aggregationLevel"; @@ -250,7 +251,7 @@ @Override @SuppressWarnings("unchecked") - public Collection get( DataSet dataSet, String key, Integer max ) + public List get( DataSet dataSet, String key, Integer max ) { String hql = "select dataElement from DataSet dataSet inner join dataSet.dataElements as dataElement where dataSet.id = :dataSetId "; === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/I18nUtils.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/I18nUtils.java 2015-05-28 03:33:28 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/i18n/I18nUtils.java 2015-06-11 11:38:56 +0000 @@ -28,7 +28,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.Collection; import java.util.List; import java.util.Locale; @@ -73,7 +72,7 @@ Paging.getCountByName( i18n( i18nService, store.getAll() ), name ); } - public static Collection getObjectsBetween( + public static List getObjectsBetween( I18nService i18nService, GenericIdentifiableObjectStore store, int first, int max ) { return i18nService.currentLocaleIsBase() ? @@ -81,7 +80,7 @@ Paging.getObjectsBetween( i18n( i18nService, store.getAll() ), first, max ); } - public static Collection getObjectsBetweenByName( + public static List getObjectsBetweenByName( I18nService i18nService, GenericIdentifiableObjectStore store, String name, int first, int max ) { return i18nService.currentLocaleIsBase() ? @@ -89,7 +88,7 @@ Paging.getObjectsBetweenByName( i18n( i18nService, store.getAll() ), name, first, max ); } - public static Collection getObjectsByName( + public static List getObjectsByName( I18nService i18nService, GenericIdentifiableObjectStore store, String name ) { return i18nService.currentLocaleIsBase() ? === modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/util/FilterUtils.java' --- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/util/FilterUtils.java 2015-05-28 18:21:56 +0000 +++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/util/FilterUtils.java 2015-06-11 11:38:56 +0000 @@ -43,17 +43,17 @@ * * @param collection the Collection. * @param filter the Filter. - * @param the type of the Collection members. + * @param the type of the Collection members. * @return the filtered Collection. */ - public static Collection filter( Collection collection, Filter filter ) + public static , V> T filter( T collection, Filter filter ) { if ( collection == null || filter == null ) { return collection; } - final Iterator iterator = collection.iterator(); + final Iterator iterator = collection.iterator(); while ( iterator.hasNext() ) { === modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/paging/Paging.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/paging/Paging.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/paging/Paging.java 2015-06-11 11:38:56 +0000 @@ -224,7 +224,7 @@ return list.subList( first, last ); } - public static Collection getObjectsByName( Collection objects, String name ) + public static List getObjectsByName( Collection objects, String name ) { final List list = new ArrayList<>();