@Test public void override() throws Exception { underTest.set("foo", "bar"); Map<String, String> overrides = Maps.newHashMap(); overrides.put("a", "b"); overrides.put("foo", "baz"); underTest.override(overrides); Map<String, String> config = underTest.build(); assertThat(config.entrySet(), hasSize(1)); assertThat(config.get("foo"), is("baz")); }
public ConfigurationBuilder override(final Map<String,String> overrides) { if (overrides == null) { throw new NullPointerException(); } for (Entry<String,String> entry : overrides.entrySet()) { String name = entry.getKey(); if (properties.containsKey(name)) { String value = entry.getValue(); log.debug("Override: {}={}", name, value); properties.put(name, value); } } return this; }
ConfigurationBuilder { public ConfigurationBuilder override(final Map<String,String> overrides) { if (overrides == null) { throw new NullPointerException(); } for (Entry<String,String> entry : overrides.entrySet()) { String name = entry.getKey(); if (properties.containsKey(name)) { String value = entry.getValue(); log.debug("Override: {}={}", name, value); properties.put(name, value); } } return this; } }
ConfigurationBuilder { public ConfigurationBuilder override(final Map<String,String> overrides) { if (overrides == null) { throw new NullPointerException(); } for (Entry<String,String> entry : overrides.entrySet()) { String name = entry.getKey(); if (properties.containsKey(name)) { String value = entry.getValue(); log.debug("Override: {}={}", name, value); properties.put(name, value); } } return this; }  }
ConfigurationBuilder { public ConfigurationBuilder override(final Map<String,String> overrides) { if (overrides == null) { throw new NullPointerException(); } for (Entry<String,String> entry : overrides.entrySet()) { String name = entry.getKey(); if (properties.containsKey(name)) { String value = entry.getValue(); log.debug("Override: {}={}", name, value); properties.put(name, value); } } return this; }  ConfigurationBuilder properties(final Map<String, String> props); ConfigurationBuilder properties(final URL url); ConfigurationBuilder properties(final String resource, final boolean required); ConfigurationBuilder properties(final Class<?> clazz, final String resource, final boolean required); ConfigurationBuilder properties(final File resource, final boolean required); ConfigurationBuilder properties(final File resource, final String onlyConcern, final boolean required); ConfigurationBuilder defaults(); ConfigurationBuilder set(final String name, final String value); ConfigurationBuilder custom(final Customizer customizer); ConfigurationBuilder override(final Map<String,String> overrides); ConfigurationBuilder override(final Properties overrides); Map<String, String> build(); }
ConfigurationBuilder { public ConfigurationBuilder override(final Map<String,String> overrides) { if (overrides == null) { throw new NullPointerException(); } for (Entry<String,String> entry : overrides.entrySet()) { String name = entry.getKey(); if (properties.containsKey(name)) { String value = entry.getValue(); log.debug("Override: {}={}", name, value); properties.put(name, value); } } return this; }  ConfigurationBuilder properties(final Map<String, String> props); ConfigurationBuilder properties(final URL url); ConfigurationBuilder properties(final String resource, final boolean required); ConfigurationBuilder properties(final Class<?> clazz, final String resource, final boolean required); ConfigurationBuilder properties(final File resource, final boolean required); ConfigurationBuilder properties(final File resource, final String onlyConcern, final boolean required); ConfigurationBuilder defaults(); ConfigurationBuilder set(final String name, final String value); ConfigurationBuilder custom(final Customizer customizer); ConfigurationBuilder override(final Map<String,String> overrides); ConfigurationBuilder override(final Properties overrides); Map<String, String> build();  }