use of org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionInfoDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromSubscriptionInfoListToDTO.
public static SubscriptionInfoListDTO fromSubscriptionInfoListToDTO(List<SubscriptionInfo> subscriptionInfoList, ZoneId zoneId) {
SubscriptionInfoListDTO subscriptionCountListDTO = new SubscriptionInfoListDTO();
List<SubscriptionInfoDTO> subscriptionInfoDTOList = new ArrayList<>();
subscriptionCountListDTO.setCount(subscriptionInfoList.size());
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) {
SubscriptionInfoDTO subscriptionInfoDTO = new SubscriptionInfoDTO();
subscriptionInfoDTO.setId(subscriptionInfo.getId());
subscriptionInfoDTO.setName(subscriptionInfo.getName());
subscriptionInfoDTO.setVersion(subscriptionInfo.getVersion());
subscriptionInfoDTO.setAppName(subscriptionInfo.getAppName());
subscriptionInfoDTO.setDescription(subscriptionInfo.getDescription());
subscriptionInfoDTO.setCreatedTime(epochToISO8601DateTime(subscriptionInfo.getCreatedTime(), zoneId));
subscriptionInfoDTO.setSubscriptionStatus(subscriptionInfo.getSubscriptionStatus());
subscriptionInfoDTO.setSubscriptionTier(subscriptionInfo.getSubscriptionTier());
subscriptionInfoDTOList.add(subscriptionInfoDTO);
}
subscriptionCountListDTO.setList(subscriptionInfoDTOList);
return subscriptionCountListDTO;
}
Aggregations