Search in sources :

Example 1 with SubscriptionInfoDTO

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;
}
Also used : SubscriptionInfoDTO(org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionInfoDTO) SubscriptionInfoListDTO(org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionInfoListDTO) ArrayList(java.util.ArrayList) SubscriptionInfo(org.wso2.carbon.apimgt.core.models.analytics.SubscriptionInfo)

Aggregations

ArrayList (java.util.ArrayList)1 SubscriptionInfo (org.wso2.carbon.apimgt.core.models.analytics.SubscriptionInfo)1 SubscriptionInfoDTO (org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionInfoDTO)1 SubscriptionInfoListDTO (org.wso2.carbon.apimgt.rest.api.analytics.dto.SubscriptionInfoListDTO)1