Search in sources :

Example 21 with BaseDimensionalItemObject

use of org.hisp.dhis.common.BaseDimensionalItemObject in project dhis2-core by dhis2.

the class BaseDimensionalItemObjectMapper method map.

@Override
public DimensionResponse map(BaseIdentifiableObject dimension, String prefix) {
    BaseDimensionalItemObject baseDimensionalItemObject = (BaseDimensionalItemObject) dimension;
    DimensionResponse responseWithDimensionType = super.map(dimension, prefix).withDimensionType(baseDimensionalItemObject.getDimensionItemType().name());
    if (dimension instanceof ValueTypedDimensionalItemObject) {
        ValueTypedDimensionalItemObject valueTypedDimensionalItemObject = (ValueTypedDimensionalItemObject) dimension;
        return responseWithDimensionType.withValueType(valueTypedDimensionalItemObject.getValueType().name());
    }
    return responseWithDimensionType;
}
Also used : ValueTypedDimensionalItemObject(org.hisp.dhis.common.ValueTypedDimensionalItemObject) BaseDimensionalItemObject(org.hisp.dhis.common.BaseDimensionalItemObject) DimensionResponse(org.hisp.dhis.analytics.dimension.DimensionResponse)

Aggregations

BaseDimensionalItemObject (org.hisp.dhis.common.BaseDimensionalItemObject)21 DimensionalItemObject (org.hisp.dhis.common.DimensionalItemObject)17 Test (org.junit.jupiter.api.Test)14 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)13 QueryItem (org.hisp.dhis.common.QueryItem)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)7 EventQueryParams (org.hisp.dhis.analytics.event.EventQueryParams)3 QueryFilter (org.hisp.dhis.common.QueryFilter)3 DimensionalItemId (org.hisp.dhis.common.DimensionalItemId)2 RepeatableStageParams (org.hisp.dhis.common.RepeatableStageParams)2 ReportingRate (org.hisp.dhis.common.ReportingRate)2 DataElementOperand (org.hisp.dhis.dataelement.DataElementOperand)2 ProgramDataElementDimensionItem (org.hisp.dhis.program.ProgramDataElementDimensionItem)2 ProgramTrackedEntityAttributeDimensionItem (org.hisp.dhis.program.ProgramTrackedEntityAttributeDimensionItem)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 DimensionResponse (org.hisp.dhis.analytics.dimension.DimensionResponse)1 CategoryOptionCombo (org.hisp.dhis.category.CategoryOptionCombo)1 ValueTypedDimensionalItemObject (org.hisp.dhis.common.ValueTypedDimensionalItemObject)1 DataElement (org.hisp.dhis.dataelement.DataElement)1