private ResponseWrapper constructResponseWrapperFromResponse(Services xmlServices) { ResponseWrapper response = new ResponseWrapper(xmlServices.getProbeID()); response.setResponseID(xmlServices.getResponseID()); for (Service xmlService : xmlServices.getService()) { ServiceWrapper service = constructServiceWrapperFromService(xmlService); response.addResponse(service); } return response; }
private Services composeResponseFromResponseWrapper(ResponseWrapper response) { ObjectFactory of = new ObjectFactory(); Services xmlServices = of.createServices(); xmlServices.setProbeID(response.getProbeID()); xmlServices.setResponseID(response.getResponseID()); List<Service> serviceList = xmlServices.getService(); for (ServiceWrapper service : response.getServices()) { Service xmlService = this.composeServiceFromServiceWrapper(service); serviceList.add(xmlService); } return xmlServices; }