@Test public void testGetPropertyValue() { Configuration configuration = createConfigurationWithParents_PropsOnly(); assertEquals("val1.3", configuration.getPropertyValue("type1", "prop1")); assertEquals("val2.2", configuration.getPropertyValue("type1", "prop2")); assertEquals("val3.1", configuration.getPropertyValue("type1", "prop3")); assertEquals("val4.3", configuration.getPropertyValue("type2", "prop4")); assertEquals("val5.1", configuration.getPropertyValue("type2", "prop5")); assertEquals("val6.2", configuration.getPropertyValue("type1", "prop6")); assertEquals("val7.3", configuration.getPropertyValue("type3", "prop7")); assertEquals("val8.2", configuration.getPropertyValue("type3", "prop8")); assertEquals("val9.3", configuration.getPropertyValue("type1", "prop9")); assertEquals("val10.3", configuration.getPropertyValue("type4", "prop10")); assertEquals("val11.3", configuration.getPropertyValue("type4", "prop11")); }
public String getPropertyValue(String configType, String propertyName) { String value = null; if (properties.containsKey(configType) && properties.get(configType).containsKey(propertyName)) { value = properties.get(configType).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getPropertyValue(configType, propertyName); } return value; }
Configuration { public String getPropertyValue(String configType, String propertyName) { String value = null; if (properties.containsKey(configType) && properties.get(configType).containsKey(propertyName)) { value = properties.get(configType).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getPropertyValue(configType, propertyName); } return value; } }
Configuration { public String getPropertyValue(String configType, String propertyName) { String value = null; if (properties.containsKey(configType) && properties.get(configType).containsKey(propertyName)) { value = properties.get(configType).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getPropertyValue(configType, propertyName); } return value; } Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes,
                       Configuration parentConfiguration);  Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes); }
Configuration { public String getPropertyValue(String configType, String propertyName) { String value = null; if (properties.containsKey(configType) && properties.get(configType).containsKey(propertyName)) { value = properties.get(configType).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getPropertyValue(configType, propertyName); } return value; } Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes,
                       Configuration parentConfiguration);  Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes); Map<String, Map<String, String>> getProperties(); Map<String, Map<String, String>> getFullProperties(); Map<String, Map<String, String>> getFullProperties(int depthLimit); Map<String, Map<String, Map<String, String>>> getAttributes(); Map<String, Map<String, Map<String, String>>> getFullAttributes(); String getPropertyValue(String configType, String propertyName); String getAttributeValue(String configType, String propertyName, String attributeName); String setProperty(String configType, String propertyName, String value); String removeProperty(String configType, String propertyName); String setAttribute(String configType, String propertyName, String attributeName, String attributeValue); Collection<String> getAllConfigTypes(); Configuration getParentConfiguration(); void setParentConfiguration(Configuration parent); void removeConfigType(String configType); }
Configuration { public String getPropertyValue(String configType, String propertyName) { String value = null; if (properties.containsKey(configType) && properties.get(configType).containsKey(propertyName)) { value = properties.get(configType).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getPropertyValue(configType, propertyName); } return value; } Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes,
                       Configuration parentConfiguration);  Configuration(Map<String, Map<String, String>> properties,
                       Map<String, Map<String, Map<String, String>>> attributes); Map<String, Map<String, String>> getProperties(); Map<String, Map<String, String>> getFullProperties(); Map<String, Map<String, String>> getFullProperties(int depthLimit); Map<String, Map<String, Map<String, String>>> getAttributes(); Map<String, Map<String, Map<String, String>>> getFullAttributes(); String getPropertyValue(String configType, String propertyName); String getAttributeValue(String configType, String propertyName, String attributeName); String setProperty(String configType, String propertyName, String value); String removeProperty(String configType, String propertyName); String setAttribute(String configType, String propertyName, String attributeName, String attributeValue); Collection<String> getAllConfigTypes(); Configuration getParentConfiguration(); void setParentConfiguration(Configuration parent); void removeConfigType(String configType);  }