use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromWSDLValidationResponseToDTO.
/**
* Converts a WSDL validation response model to DTO.
*
* @param validationResponse validation response model
* @return Converted WSDL validation response model to DTO
*/
public static WSDLValidationResponseDTO fromWSDLValidationResponseToDTO(WSDLValidationResponse validationResponse) {
WSDLValidationResponseDTO wsdlValidationResponseDTO = new WSDLValidationResponseDTO();
WSDLInfo wsdlInfo;
if (validationResponse.isValid()) {
wsdlValidationResponseDTO.setIsValid(true);
wsdlInfo = validationResponse.getWsdlInfo();
WSDLValidationResponseWsdlInfoDTO wsdlInfoDTO = new WSDLValidationResponseWsdlInfoDTO();
wsdlInfoDTO.setVersion(wsdlInfo.getVersion());
List<WSDLValidationResponseWsdlInfoEndpointsDTO> endpointsDTOList = fromEndpointsMapToWSDLValidationResponseEndpointsDTO(wsdlInfo.getEndpoints());
wsdlInfoDTO.setEndpoints(endpointsDTOList);
wsdlValidationResponseDTO.setWsdlInfo(wsdlInfoDTO);
} else {
wsdlValidationResponseDTO.setIsValid(false);
wsdlValidationResponseDTO.setErrors(getErrorListItemsDTOsFromErrorHandler(validationResponse.getError()));
}
return wsdlValidationResponseDTO;
}
Aggregations