use of org.wso2.carbon.apimgt.rest.api.analytics.dto.APISubscriptionCountDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromAPISubscriptionCountListToDTO.
/**
* Converts and APISubscriptionCountList to APISubscriptionCountListDTO.
*
* @param apiSubscriptionCountList list of APISubscriptionCount objects
* @return corresponding APISubscriptionCountListDTO object
*/
public static APISubscriptionCountListDTO fromAPISubscriptionCountListToDTO(List<APISubscriptionCount> apiSubscriptionCountList) {
APISubscriptionCountListDTO apiSubscriptionListDTO = new APISubscriptionCountListDTO();
List<APISubscriptionCountDTO> apiSubscriptionDTOList = new ArrayList<>();
apiSubscriptionListDTO.setCount(apiSubscriptionCountList.size());
for (APISubscriptionCount apiSubscriptionCount : apiSubscriptionCountList) {
APISubscriptionCountDTO apiSubscriptionDTO = new APISubscriptionCountDTO();
apiSubscriptionDTO.setId(apiSubscriptionCount.getId());
apiSubscriptionDTO.setName(apiSubscriptionCount.getName());
apiSubscriptionDTO.setVersion(apiSubscriptionCount.getVersion());
apiSubscriptionDTO.setProvider(apiSubscriptionCount.getProvider());
apiSubscriptionDTO.setCount(apiSubscriptionCount.getCount());
apiSubscriptionDTOList.add(apiSubscriptionDTO);
}
apiSubscriptionListDTO.setList(apiSubscriptionDTOList);
return apiSubscriptionListDTO;
}
Aggregations