use of org.wso2.carbon.apimgt.rest.api.analytics.dto.APICountDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromAPICountToListDTO.
/**
* Converts and APICountList to APICountDTO.
*
* @param apiCountList list of APICount objects
* @return corresponding APICountListDTO object
*/
public static APICountListDTO fromAPICountToListDTO(List<APICount> apiCountList, ZoneId zoneId) {
APICountListDTO apiCountListDTO = new APICountListDTO();
List<APICountDTO> apiCountDTOList = new ArrayList<>();
apiCountListDTO.setCount(apiCountList.size());
for (APICount apiInfo : apiCountList) {
apiCountDTOList.add(fromAPICountToDTO(apiInfo, zoneId));
}
apiCountListDTO.setList(apiCountDTOList);
return apiCountListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.analytics.dto.APICountDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromAPICountToDTO.
private static APICountDTO fromAPICountToDTO(APICount apiCount, ZoneId zoneId) {
APICountDTO apiCountDTO = new APICountDTO();
apiCountDTO.setTime(epochToISO8601DateTime(apiCount.getTimestamp(), zoneId));
apiCountDTO.setCount(apiCount.getCount());
return apiCountDTO;
}
Aggregations