Using collection in place of list

This commit is contained in:
Luca Frosini 2021-11-22 13:37:18 +01:00
parent a95b3ddda7
commit 3bd6b02fdc
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@
package org.gcube.accounting.analytics.persistence; package org.gcube.accounting.analytics.persistence;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
@ -71,7 +72,7 @@ public interface AccountingPersistenceBackendQuery {
* If the list contains more than one filter with the same key an Exception is thrown * If the list contains more than one filter with the same key an Exception is thrown
* when trying to query. * when trying to query.
*/ */
public void setFilters(List<Filter> filters); public void setFilters(Collection<Filter> filters);
/** /**
* Query the persistence obtaining a Map where the date is the key and the * Query the persistence obtaining a Map where the date is the key and the

View File

@ -5,6 +5,7 @@ package org.gcube.accounting.analytics.persistence;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -60,7 +61,7 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
protected TemporalConstraint temporalConstraint; protected TemporalConstraint temporalConstraint;
protected Set<String> contexts; protected Set<String> contexts;
protected List<Filter> filters; protected Collection<Filter> filters;
protected ObjectMapper objectMapper; protected ObjectMapper objectMapper;
@ -90,7 +91,7 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
} }
@Override @Override
public void setFilters(List<Filter> filters) { public void setFilters(Collection<Filter> filters) {
this.filters = filters; this.filters = filters;
accountingPersistenceBackendQuery.setFilters(filters); accountingPersistenceBackendQuery.setFilters(filters);
} }