@Test public void getSimpleClassFactModelTree() { Class[] expectedClazzes = {String.class, Boolean.class, Integer.class, Double.class, Number.class}; for (Class expectedClazz : expectedClazzes) { final FactModelTree retrieved = AbstractDataManagementStrategy.getSimpleClassFactModelTree( expectedClazz.getSimpleName(), expectedClazz.getCanonicalName()); assertNotNull(retrieved); String key = expectedClazz.getSimpleName(); assertEquals(key, retrieved.getFactName()); String fullName = expectedClazz.getCanonicalName(); String packageName = fullName.substring(0, fullName.lastIndexOf(".")); assertEquals(packageName, retrieved.getFullPackage()); Map<String, FactModelTree.PropertyTypeName> simpleProperties = retrieved.getSimpleProperties(); assertNotNull(simpleProperties); assertEquals(1, simpleProperties.size()); assertTrue(simpleProperties.containsKey(TestProperties.LOWER_CASE_VALUE)); FactModelTree.PropertyTypeName simplePropertyValue = simpleProperties.get(TestProperties.LOWER_CASE_VALUE); assertNotNull(simplePropertyValue); assertEquals(fullName, simplePropertyValue.getTypeName()); assertEquals(fullName, simplePropertyValue.getPropertyTypeNameToVisualize()); assertFalse(simplePropertyValue.getBaseTypeName().isPresent()); } }
public static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName) { String key = simpleClass; Map<String, FactModelTree.PropertyTypeName> simpleProperties = new HashMap<>(); simpleProperties.put(VALUE, new FactModelTree.PropertyTypeName(canonicalName)); String packageName = canonicalName.substring(0, canonicalName.lastIndexOf('.')); FactModelTree toReturn = new FactModelTree(key, packageName, simpleProperties, new HashMap<>()); toReturn.setSimple(true); return toReturn; }
AbstractDataManagementStrategy implements DataManagementStrategy { public static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName) { String key = simpleClass; Map<String, FactModelTree.PropertyTypeName> simpleProperties = new HashMap<>(); simpleProperties.put(VALUE, new FactModelTree.PropertyTypeName(canonicalName)); String packageName = canonicalName.substring(0, canonicalName.lastIndexOf('.')); FactModelTree toReturn = new FactModelTree(key, packageName, simpleProperties, new HashMap<>()); toReturn.setSimple(true); return toReturn; } }
AbstractDataManagementStrategy implements DataManagementStrategy { public static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName) { String key = simpleClass; Map<String, FactModelTree.PropertyTypeName> simpleProperties = new HashMap<>(); simpleProperties.put(VALUE, new FactModelTree.PropertyTypeName(canonicalName)); String packageName = canonicalName.substring(0, canonicalName.lastIndexOf('.')); FactModelTree toReturn = new FactModelTree(key, packageName, simpleProperties, new HashMap<>()); toReturn.setSimple(true); return toReturn; }  }
AbstractDataManagementStrategy implements DataManagementStrategy { public static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName) { String key = simpleClass; Map<String, FactModelTree.PropertyTypeName> simpleProperties = new HashMap<>(); simpleProperties.put(VALUE, new FactModelTree.PropertyTypeName(canonicalName)); String packageName = canonicalName.substring(0, canonicalName.lastIndexOf('.')); FactModelTree toReturn = new FactModelTree(key, packageName, simpleProperties, new HashMap<>()); toReturn.setSimple(true); 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 static FactModelTree getSimpleClassFactModelTree(String simpleClass, String canonicalName) { String key = simpleClass; Map<String, FactModelTree.PropertyTypeName> simpleProperties = new HashMap<>(); simpleProperties.put(VALUE, new FactModelTree.PropertyTypeName(canonicalName)); String packageName = canonicalName.substring(0, canonicalName.lastIndexOf('.')); FactModelTree toReturn = new FactModelTree(key, packageName, simpleProperties, new HashMap<>()); toReturn.setSimple(true); 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);  }