class BBInputSetupMapperLayer {

    public ServiceInstance mapAAIServiceInstanceIntoServiceInstance(
            org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance) {
        ServiceInstance serviceInstance = modelMapper.map(aaiServiceInstance, ServiceInstance.class);
        if (aaiServiceInstance.getAllottedResources() != null) {
            for (org.onap.aai.domain.yang.AllottedResource allottedResource : aaiServiceInstance.getAllottedResources()
                    .getAllottedResource()) {
                serviceInstance.getAllottedResources().add(mapAAIAllottedResource(allottedResource));
            }
        }
        serviceInstance.setOrchestrationStatus(
                this.mapOrchestrationStatusFromAAI(aaiServiceInstance.getOrchestrationStatus()));
        return serviceInstance;
    }

}