@Test public void testGetAttributeValue() { Configuration configuration = createConfigurationWithParents_AttributesOnly(); assertEquals("val1.3", configuration.getAttributeValue("type1", "prop1", "attribute1")); assertEquals("val2.2", configuration.getAttributeValue("type1", "prop2", "attribute1")); assertEquals("val3.1", configuration.getAttributeValue("type1", "prop3", "attribute1")); assertEquals("val4.3", configuration.getAttributeValue("type1", "prop4", "attribute2")); assertEquals("val5.1", configuration.getAttributeValue("type1", "prop5", "attribute2")); assertEquals("val6.2", configuration.getAttributeValue("type1", "prop6", "attribute1")); assertEquals("val7.3", configuration.getAttributeValue("type1", "prop7", "attribute3")); assertEquals("val8.2", configuration.getAttributeValue("type1", "prop8", "attribute3")); assertEquals("val100.3", configuration.getAttributeValue("type2", "prop100", "attribute100")); assertEquals("val101.1", configuration.getAttributeValue("type2", "prop101", "attribute100")); assertEquals("val102.3", configuration.getAttributeValue("type2", "prop102", "attribute100")); assertEquals("val100.2", configuration.getAttributeValue("type2", "prop100", "attribute101")); assertEquals("val101.1", configuration.getAttributeValue("type2", "prop101", "attribute101")); }
public String getAttributeValue(String configType, String propertyName, String attributeName) { String value = null; if (attributes.containsKey(configType) && attributes.get(configType).containsKey(attributeName) && attributes.get(configType).get(attributeName).containsKey(propertyName)) { value = attributes.get(configType).get(attributeName).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getAttributeValue(configType, propertyName, attributeName); } return value; }
Configuration { public String getAttributeValue(String configType, String propertyName, String attributeName) { String value = null; if (attributes.containsKey(configType) && attributes.get(configType).containsKey(attributeName) && attributes.get(configType).get(attributeName).containsKey(propertyName)) { value = attributes.get(configType).get(attributeName).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getAttributeValue(configType, propertyName, attributeName); } return value; } }
Configuration { public String getAttributeValue(String configType, String propertyName, String attributeName) { String value = null; if (attributes.containsKey(configType) && attributes.get(configType).containsKey(attributeName) && attributes.get(configType).get(attributeName).containsKey(propertyName)) { value = attributes.get(configType).get(attributeName).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getAttributeValue(configType, propertyName, attributeName); } 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 getAttributeValue(String configType, String propertyName, String attributeName) { String value = null; if (attributes.containsKey(configType) && attributes.get(configType).containsKey(attributeName) && attributes.get(configType).get(attributeName).containsKey(propertyName)) { value = attributes.get(configType).get(attributeName).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getAttributeValue(configType, propertyName, attributeName); } 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 getAttributeValue(String configType, String propertyName, String attributeName) { String value = null; if (attributes.containsKey(configType) && attributes.get(configType).containsKey(attributeName) && attributes.get(configType).get(attributeName).containsKey(propertyName)) { value = attributes.get(configType).get(attributeName).get(propertyName); } else if (parentConfiguration != null) { value = parentConfiguration.getAttributeValue(configType, propertyName, attributeName); } 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);  }