QueryPlannerUtils { public static boolean isDisaggregation( AnalyticsAggregationType aggregationType, PeriodType aggregationPeriodType, PeriodType dataPeriodType ) { if ( dataPeriodType == null || aggregationPeriodType == null ) { return false; } if ( aggregationType == null || AggregationType.AVERAGE != aggregationType.getPeriodAggregationType() ) { return false; } if ( aggregationPeriodType.getFrequencyOrder() < dataPeriodType.getFrequencyOrder() ) { return true; } if ( aggregationPeriodType.getFrequencyOrder() == dataPeriodType.getFrequencyOrder() && !aggregationPeriodType.equals( dataPeriodType ) ) { return true; } return false; }  static ListMap<Integer, DimensionalItemObject> getLevelOrgUnitMap( List<DimensionalItemObject> orgUnits ); static ListMap<Integer, OrganisationUnit> getLevelOrgUnitTypedMap( List<OrganisationUnit> orgUnits ); static ListMap<DataType, DimensionalItemObject> getDataTypeDataElementMap( List<DimensionalItemObject> dataElements ); static ListMap<AnalyticsAggregationType, DimensionalItemObject> getAggregationTypeDataElementMap(
        List<DimensionalItemObject> dataElements, AnalyticsAggregationType aggregationType, String periodType ); static ListMap<Integer, DimensionalItemObject> getDaysPeriodMap( List<DimensionalItemObject> periods ); static AnalyticsAggregationType getAggregationType( AnalyticsAggregationType aggregationType, ValueType valueType,
        PeriodType aggregationPeriodType, PeriodType dataPeriodType ); static boolean isDisaggregation( AnalyticsAggregationType aggregationType, PeriodType aggregationPeriodType, PeriodType dataPeriodType ); static ListMap<PeriodType, DimensionalItemObject> getPeriodTypeDataElementMap(
        Collection<DimensionalItemObject> dataElements ); static List<EventQueryParams> convert( List<DataQueryParams> params );  }
@Test public void testIsDisaggregation() { assertTrue( QueryPlannerUtils.isDisaggregation( SUM_AVG, new QuarterlyPeriodType(), new YearlyPeriodType() ) ); assertTrue( QueryPlannerUtils.isDisaggregation( SUM_AVG, new MonthlyPeriodType(), new YearlyPeriodType() ) ); assertTrue( QueryPlannerUtils.isDisaggregation( SUM_AVG, new FinancialAprilPeriodType(), new YearlyPeriodType() ) ); assertTrue( QueryPlannerUtils.isDisaggregation( SUM_AVG, new FinancialOctoberPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_SUM, new QuarterlyPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_SUM, new MonthlyPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_SUM, new FinancialAprilPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_SUM, new FinancialOctoberPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_AVG, new YearlyPeriodType(), new QuarterlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_AVG, new YearlyPeriodType(), new YearlyPeriodType() ) ); assertFalse( QueryPlannerUtils.isDisaggregation( SUM_SUM, new YearlyPeriodType(), new YearlyPeriodType() ) ); }