use of org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionCountDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromSubscriptionCountListToDTO.
/**
* Converts and SubscriptionInfoList to SubscriptionInfoListDTO.
*
* @param subscriptionCountList list of SubscriptionCount objects
* @return corresponding APIInfoListDTO object
*/
public static SubscriptionCountListDTO fromSubscriptionCountListToDTO(List<SubscriptionCount> subscriptionCountList, ZoneId zoneId) {
SubscriptionCountListDTO subscriptionCountListDTO = new SubscriptionCountListDTO();
List<SubscriptionCountDTO> subscriptionCountDTOList = new ArrayList<>();
subscriptionCountListDTO.setCount(subscriptionCountList.size());
for (SubscriptionCount subscriptionCount : subscriptionCountList) {
SubscriptionCountDTO subscriptionCountDTO = new SubscriptionCountDTO();
subscriptionCountDTO.setTime(epochToISO8601DateTime(subscriptionCount.getTimestamp(), zoneId));
subscriptionCountDTO.setCount(subscriptionCount.getCount());
subscriptionCountDTOList.add(subscriptionCountDTO);
}
subscriptionCountListDTO.setList(subscriptionCountDTOList);
return subscriptionCountListDTO;
}
Aggregations