Returning keys as sorted list

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@118934 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-09-09 13:22:39 +00:00
parent 1821a1613e
commit 096d4e503f
1 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ package org.gcube.accounting.analytics;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -165,8 +166,11 @@ public class ResourceRecordQuery {
* @return a set containing the list of key
* @throws Exception if fails
*/
public Set<String> getKeys(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType) throws Exception{
return accountingPersistenceQuery.getKeys(usageRecordType);
public List<String> getKeys(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType) throws Exception{
Set<String> keys = accountingPersistenceQuery.getKeys(usageRecordType);
List<String> toSort = new ArrayList<String>(keys);
Collections.sort(toSort);
return toSort;
}
}