Search in sources :

Example 1 with ApplicationKeyMappingListDTO

use of org.wso2.carbon.apimgt.internal.service.dto.ApplicationKeyMappingListDTO in project carbon-apimgt by wso2.

the class SubscriptionValidationDataUtil method fromApplicationKeyMappingToApplicationKeyMappingListDTO.

public static ApplicationKeyMappingListDTO fromApplicationKeyMappingToApplicationKeyMappingListDTO(List<ApplicationKeyMapping> model) {
    ApplicationKeyMappingListDTO applicationKeyMappingListDTO = new ApplicationKeyMappingListDTO();
    if (model != null) {
        for (ApplicationKeyMapping applicationKeyMapping : model) {
            ApplicationKeyMappingDTO applicationKeyMappingDTO = new ApplicationKeyMappingDTO();
            applicationKeyMappingDTO.setApplicationId(applicationKeyMapping.getApplicationId());
            applicationKeyMappingDTO.setConsumerKey(applicationKeyMapping.getConsumerKey());
            applicationKeyMappingDTO.setKeyType(applicationKeyMapping.getKeyType());
            applicationKeyMappingDTO.setKeyManager(applicationKeyMapping.getKeyManager());
            applicationKeyMappingDTO.setApplicationUUID(applicationKeyMapping.getApplicationUUID());
            applicationKeyMappingListDTO.getList().add(applicationKeyMappingDTO);
        }
        applicationKeyMappingListDTO.setCount(model.size());
    } else {
        applicationKeyMappingListDTO.setCount(0);
    }
    return applicationKeyMappingListDTO;
}
Also used : ApplicationKeyMappingListDTO(org.wso2.carbon.apimgt.internal.service.dto.ApplicationKeyMappingListDTO) ApplicationKeyMappingDTO(org.wso2.carbon.apimgt.internal.service.dto.ApplicationKeyMappingDTO) ApplicationKeyMapping(org.wso2.carbon.apimgt.api.model.subscription.ApplicationKeyMapping)

Aggregations

ApplicationKeyMapping (org.wso2.carbon.apimgt.api.model.subscription.ApplicationKeyMapping)1 ApplicationKeyMappingDTO (org.wso2.carbon.apimgt.internal.service.dto.ApplicationKeyMappingDTO)1 ApplicationKeyMappingListDTO (org.wso2.carbon.apimgt.internal.service.dto.ApplicationKeyMappingListDTO)1