@Test public void getInstanceMap() { SortedMap<String, FactModelTree> sourceMap = getSourceMap(); SortedMap<String, FactModelTree> retrieved = abstractDataManagementStrategySpy.getInstanceMap(sourceMap); assertNotNull(retrieved); assertTrue(retrieved.isEmpty()); abstractDataManagementStrategySpy.setModel(modelLocal); retrieved = abstractDataManagementStrategySpy.getInstanceMap(sourceMap); assertNotNull(retrieved); assertEquals(2, retrieved.size()); }
public SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap) { SortedMap<String, FactModelTree> toReturn = new TreeMap<>(); if (model != null) { final ScesimModelDescriptor simulationDescriptor = model.getSimulation().getScesimModelDescriptor(); simulationDescriptor.getUnmodifiableFactMappings() .stream() .filter(factMapping -> !Objects.equals(FactMappingType.OTHER, factMapping.getExpressionIdentifier().getType())) .forEach(factMapping -> { String dataObjectName = factMapping.getFactIdentifier().getClassNameWithoutPackage(); final String instanceName = factMapping.getFactAlias(); if (!instanceName.equals(dataObjectName)) { final FactModelTree factModelTree = sourceMap.get(dataObjectName); if (factModelTree != null) { toReturn.put(instanceName, factModelTree); } } }); } return toReturn; }
AbstractDataManagementStrategy implements DataManagementStrategy { public SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap) { SortedMap<String, FactModelTree> toReturn = new TreeMap<>(); if (model != null) { final ScesimModelDescriptor simulationDescriptor = model.getSimulation().getScesimModelDescriptor(); simulationDescriptor.getUnmodifiableFactMappings() .stream() .filter(factMapping -> !Objects.equals(FactMappingType.OTHER, factMapping.getExpressionIdentifier().getType())) .forEach(factMapping -> { String dataObjectName = factMapping.getFactIdentifier().getClassNameWithoutPackage(); final String instanceName = factMapping.getFactAlias(); if (!instanceName.equals(dataObjectName)) { final FactModelTree factModelTree = sourceMap.get(dataObjectName); if (factModelTree != null) { toReturn.put(instanceName, factModelTree); } } }); } return toReturn; } }
AbstractDataManagementStrategy implements DataManagementStrategy { public SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap) { SortedMap<String, FactModelTree> toReturn = new TreeMap<>(); if (model != null) { final ScesimModelDescriptor simulationDescriptor = model.getSimulation().getScesimModelDescriptor(); simulationDescriptor.getUnmodifiableFactMappings() .stream() .filter(factMapping -> !Objects.equals(FactMappingType.OTHER, factMapping.getExpressionIdentifier().getType())) .forEach(factMapping -> { String dataObjectName = factMapping.getFactIdentifier().getClassNameWithoutPackage(); final String instanceName = factMapping.getFactAlias(); if (!instanceName.equals(dataObjectName)) { final FactModelTree factModelTree = sourceMap.get(dataObjectName); if (factModelTree != null) { toReturn.put(instanceName, factModelTree); } } }); } return toReturn; }  }
AbstractDataManagementStrategy implements DataManagementStrategy { public SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap) { SortedMap<String, FactModelTree> toReturn = new TreeMap<>(); if (model != null) { final ScesimModelDescriptor simulationDescriptor = model.getSimulation().getScesimModelDescriptor(); simulationDescriptor.getUnmodifiableFactMappings() .stream() .filter(factMapping -> !Objects.equals(FactMappingType.OTHER, factMapping.getExpressionIdentifier().getType())) .forEach(factMapping -> { String dataObjectName = factMapping.getFactIdentifier().getClassNameWithoutPackage(); final String instanceName = factMapping.getFactAlias(); if (!instanceName.equals(dataObjectName)) { final FactModelTree factModelTree = sourceMap.get(dataObjectName); if (factModelTree != null) { toReturn.put(instanceName, factModelTree); } } }); } return toReturn; }  @Override void setModel(ScenarioSimulationModel model); static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName); Map<String, List<List<String>>> getPropertiesToHide(AbstractScesimGridModel<T, E> abstractScesimGridModel); void storeData(final FactModelTuple factModelTuple,
                          final TestToolsView.Presenter testToolsPresenter,
                          final ScenarioSimulationContext context,
                          final GridWidget gridWidget); SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap); }
AbstractDataManagementStrategy implements DataManagementStrategy { public SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap) { SortedMap<String, FactModelTree> toReturn = new TreeMap<>(); if (model != null) { final ScesimModelDescriptor simulationDescriptor = model.getSimulation().getScesimModelDescriptor(); simulationDescriptor.getUnmodifiableFactMappings() .stream() .filter(factMapping -> !Objects.equals(FactMappingType.OTHER, factMapping.getExpressionIdentifier().getType())) .forEach(factMapping -> { String dataObjectName = factMapping.getFactIdentifier().getClassNameWithoutPackage(); final String instanceName = factMapping.getFactAlias(); if (!instanceName.equals(dataObjectName)) { final FactModelTree factModelTree = sourceMap.get(dataObjectName); if (factModelTree != null) { toReturn.put(instanceName, factModelTree); } } }); } return toReturn; }  @Override void setModel(ScenarioSimulationModel model); static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName); Map<String, List<List<String>>> getPropertiesToHide(AbstractScesimGridModel<T, E> abstractScesimGridModel); void storeData(final FactModelTuple factModelTuple,
                          final TestToolsView.Presenter testToolsPresenter,
                          final ScenarioSimulationContext context,
                          final GridWidget gridWidget); SortedMap<String, FactModelTree> getInstanceMap(SortedMap<String, FactModelTree> sourceMap);  }