Search in sources :

Example 1 with OrganisationUnitParentCountComparator

use of org.hisp.dhis.organisationunit.comparator.OrganisationUnitParentCountComparator in project dhis2-core by dhis2.

the class OrganisationUnitObjectBundleHook method sortOrganisationUnits.

private void sortOrganisationUnits(ObjectBundle bundle) {
    List<IdentifiableObject> nonPersistedObjects = bundle.getObjects(OrganisationUnit.class, false);
    List<IdentifiableObject> persistedObjects = bundle.getObjects(OrganisationUnit.class, true);
    nonPersistedObjects.sort(new OrganisationUnitParentCountComparator());
    persistedObjects.sort(new OrganisationUnitParentCountComparator());
}
Also used : OrganisationUnitParentCountComparator(org.hisp.dhis.organisationunit.comparator.OrganisationUnitParentCountComparator) IdentifiableObject(org.hisp.dhis.common.IdentifiableObject)

Aggregations

IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)1 OrganisationUnitParentCountComparator (org.hisp.dhis.organisationunit.comparator.OrganisationUnitParentCountComparator)1