@Test public void testConfigMapValueConfig() { Map<String, String> properties = new TreeMap<>(); properties.put("map-a.k1.string-value", "this is a"); properties.put("map-a.k1.string-b", "this is b"); properties.put("map-a.k2.string-value", "this is k2 a"); properties.put("map-a.k2.string-b", "this is k2 b"); inspect(properties, null, null, null, binder -> bindConfig(binder).bind(LegacyMapValueConfigPresent.class)) .component("ConfigurationFactoryTest$LegacyMapValueConfigPresent") .value("MapA[k1]StringA", "map-a.k1.string-a", "defaultA", "this is a", "") .value("MapA[k1]StringB", "map-a.k1.string-b", "defaultB", "this is b", "") .value("MapA[k2]StringA", "map-a.k2.string-a", "defaultA", "this is k2 a", "") .value("MapA[k2]StringB", "map-a.k2.string-b", "defaultB", "this is k2 b", "") .end(); }
public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); } }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory); }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory);  }