class AnalyticsAggregationType {

    public static AnalyticsAggregationType fromAggregationType( AggregationType aggregationType )
    {
        AnalyticsAggregationType analyticsAggregationType;
        switch ( aggregationType )
        {

        case AVERAGE_SUM_ORG_UNIT:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.SUM, AggregationType.AVERAGE );
            break;
        case LAST:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.SUM, AggregationType.LAST );
            break;
        case LAST_AVERAGE_ORG_UNIT:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.AVERAGE, AggregationType.LAST );
            break;
        case LAST_IN_PERIOD:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.SUM, AggregationType.LAST_IN_PERIOD );
            break;
        case LAST_IN_PERIOD_AVERAGE_ORG_UNIT:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.AVERAGE, AggregationType.LAST_IN_PERIOD );
            break;
        case FIRST:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.SUM, AggregationType.FIRST );
            break;
        case FIRST_AVERAGE_ORG_UNIT:
            analyticsAggregationType = new AnalyticsAggregationType( AggregationType.AVERAGE, AggregationType.FIRST );
            break;
        default:
            analyticsAggregationType = new AnalyticsAggregationType( aggregationType, aggregationType );
        }

        return analyticsAggregationType;
    }

    public  AnalyticsAggregationType( AggregationType aggregationType, AggregationType periodAggregationType );
    public  AnalyticsAggregationType( AggregationType aggregationType, AggregationType periodAggregationType, DataType dataType, boolean disaggregation );

}