60 lines
1.4 KiB
Java
60 lines
1.4 KiB
Java
package org.gcube.portlets.admin.accountingmanager.server.amservice;
|
|
|
|
import org.gcube.accounting.analytics.TemporalConstraint.AggregationMode;
|
|
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingPeriodMode;
|
|
|
|
/**
|
|
*
|
|
* @author giancarlo
|
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class PeriodModeMap {
|
|
|
|
public static AggregationMode getMode(AccountingPeriodMode mode){
|
|
switch(mode){
|
|
case DAILY:
|
|
return AggregationMode.DAILY;
|
|
case HOURLY:
|
|
return AggregationMode.HOURLY;
|
|
case MILLISECONDLY:
|
|
return AggregationMode.MILLISECONDLY;
|
|
case MINUTELY:
|
|
return AggregationMode.MINUTELY;
|
|
case MONTHLY:
|
|
return AggregationMode.MONTHLY;
|
|
case SECONDLY:
|
|
return AggregationMode.SECONDLY;
|
|
case YEARLY:
|
|
return AggregationMode.YEARLY;
|
|
default:
|
|
return AggregationMode.YEARLY;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public static AccountingPeriodMode getMode(AggregationMode mode){
|
|
switch(mode){
|
|
case DAILY:
|
|
return AccountingPeriodMode.DAILY;
|
|
case HOURLY:
|
|
return AccountingPeriodMode.HOURLY;
|
|
case MILLISECONDLY:
|
|
return AccountingPeriodMode.MILLISECONDLY;
|
|
case MINUTELY:
|
|
return AccountingPeriodMode.MINUTELY;
|
|
case MONTHLY:
|
|
return AccountingPeriodMode.MONTHLY;
|
|
case SECONDLY:
|
|
return AccountingPeriodMode.SECONDLY;
|
|
case YEARLY:
|
|
return AccountingPeriodMode.YEARLY;
|
|
default:
|
|
return AccountingPeriodMode.YEARLY;
|
|
|
|
}
|
|
}
|
|
|
|
}
|