use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.APIProductInfoDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromAPIProductListtoDTO.
public static APIProductListDTO fromAPIProductListtoDTO(List<APIProduct> productList) {
APIProductListDTO listDto = new APIProductListDTO();
List<APIProductInfoDTO> list = new ArrayList<APIProductInfoDTO>();
for (APIProduct apiProduct : productList) {
APIProductInfoDTO productDto = new APIProductInfoDTO();
productDto.setName(apiProduct.getId().getName());
productDto.setProvider(APIUtil.replaceEmailDomainBack(apiProduct.getId().getProviderName()));
productDto.setContext(apiProduct.getContext());
productDto.setDescription(apiProduct.getDescription());
productDto.setState(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.APIProductInfoDTO.StateEnum.valueOf(apiProduct.getState()));
productDto.setId(apiProduct.getUuid());
if (apiProduct.getApiSecurity() != null) {
productDto.setSecurityScheme(Arrays.asList(apiProduct.getApiSecurity().split(",")));
}
list.add(productDto);
}
listDto.setList(list);
listDto.setCount(list.size());
return listDto;
}
Aggregations