class QueryPlannerUtils {

    public static AnalyticsAggregationType getAggregationType( AnalyticsAggregationType aggregationType, ValueType valueType,
        PeriodType aggregationPeriodType, PeriodType dataPeriodType )
    {
        DataType dataType = DataType.fromValueType( valueType );
        boolean disaggregation = isDisaggregation( aggregationType, aggregationPeriodType, dataPeriodType );

        return new AnalyticsAggregationType( aggregationType.getAggregationType(),
            aggregationType.getPeriodAggregationType(), dataType, disaggregation );
    }

}