@Test void getValue() { KeyMap<String> map = new KeyMap<>(); map.findOrAdd("root.foo").putRootValue("bar"); map.findOrAdd("root.foo.bar").putRootValue("baz"); map.findOrAdd("root.foo.bar.*").putRootValue("baz"); map.findOrAdd("root.foo.bar.*.baz").putRootValue("anything"); ConfigSource source = getSource(map); assertEquals("bar", source.getValue("root.foo")); assertEquals("baz", source.getValue("root.foo.bar")); assertEquals("baz", source.getValue("root.foo.bar.x")); assertEquals("baz", source.getValue("root.foo.bar.y")); assertEquals("anything", source.getValue("root.foo.bar.x.baz")); assertEquals("anything", source.getValue("root.foo.bar.y.baz")); assertNull(source.getValue("root.bar")); assertNull(source.getValue("root.foo.bar.y.baz.z")); }
@Override public String getValue(final String propertyName) { return properties.findRootValue(propertyName); }
KeyMapBackedConfigSource extends AbstractConfigSource { @Override public String getValue(final String propertyName) { return properties.findRootValue(propertyName); } }
KeyMapBackedConfigSource extends AbstractConfigSource { @Override public String getValue(final String propertyName) { return properties.findRootValue(propertyName); } KeyMapBackedConfigSource(final String name, final KeyMap<String> properties);  KeyMapBackedConfigSource(final String name, final int ordinal, final KeyMap<String> properties); }
KeyMapBackedConfigSource extends AbstractConfigSource { @Override public String getValue(final String propertyName) { return properties.findRootValue(propertyName); } KeyMapBackedConfigSource(final String name, final KeyMap<String> properties);  KeyMapBackedConfigSource(final String name, final int ordinal, final KeyMap<String> properties); @Override Map<String, String> getProperties(); @Override String getValue(final String propertyName); }
KeyMapBackedConfigSource extends AbstractConfigSource { @Override public String getValue(final String propertyName) { return properties.findRootValue(propertyName); } KeyMapBackedConfigSource(final String name, final KeyMap<String> properties);  KeyMapBackedConfigSource(final String name, final int ordinal, final KeyMap<String> properties); @Override Map<String, String> getProperties(); @Override String getValue(final String propertyName);  }