class AAIObjectMapper {

    public org.onap.aai.domain.yang.ServiceInstance mapServiceInstance(ServiceInstance serviceInstance) {
        if (modelMapper.getTypeMap(ServiceInstance.class, org.onap.aai.domain.yang.ServiceInstance.class) == null) {
            modelMapper.addMappings(new PropertyMap<ServiceInstance, org.onap.aai.domain.yang.ServiceInstance>() {
                @Override
                protected void configure() {
                    map().setServiceType(source.getModelInfoServiceInstance().getServiceType());
                    map().setServiceRole(source.getModelInfoServiceInstance().getServiceRole());
                    map().setServiceFunction(source.getModelInfoServiceInstance().getServiceFunction());
                    map().setModelInvariantId(source.getModelInfoServiceInstance().getModelInvariantUuid());
                    map().setModelVersionId(source.getModelInfoServiceInstance().getModelUuid());
                    map().setEnvironmentContext(source.getModelInfoServiceInstance().getEnvironmentContext());
                    map().setWorkloadContext(source.getModelInfoServiceInstance().getWorkloadContext());
                }
            });
        }

        return modelMapper.map(serviceInstance, org.onap.aai.domain.yang.ServiceInstance.class);
    }

}