use of org.hisp.dhis.common.DataDimensionItemType in project dhis2-core by dhis2.
the class DataQueryParams method retainDataDimensions.
/**
* Retains only dimensions of the given data dimension item types.
*
* @param itemTypes the array of data dimension item types.
*/
private DataQueryParams retainDataDimensions(DataDimensionItemType... itemTypes) {
DimensionalObject dimension = getDimensionOrFilter(DATA_X_DIM_ID);
List<DimensionalItemObject> items = new ArrayList<>();
for (DataDimensionItemType itemType : itemTypes) {
items.addAll(AnalyticsUtils.getByDataDimensionItemType(itemType, dimension.getItems()));
}
dimension.getItems().clear();
dimension.getItems().addAll(items);
return this;
}
Aggregations