@Test public void of_map() throws IOException { Map<String, String> vars = new LinkedHashMap<>(); vars.put("A", "1"); vars.put("B", "2"); vars.put("C", "3"); BasicProject project = project() .with(PropertyConfigurator.of(vars)); assertThat(project.property("A"), is("1")); assertThat(project.property("B"), is("2")); assertThat(project.property("C"), is("3")); assertThat(project.property("D"), is(nullValue())); Map<String, String> patch = new LinkedHashMap<>(); patch.put("B", "4"); patch.put("C", null); patch.put("D", "5"); project.with(PropertyConfigurator.of(patch)); assertThat(project.property("A"), is("1")); assertThat(project.property("B"), is("4")); assertThat(project.property("C"), is(nullValue())); assertThat(project.property("D"), is("5")); }
public static PropertyConfigurator of(String key, String value) { return of(Collections.singletonMap(key, value)); }
PropertyConfigurator implements Consumer<BaseProject<?>> { public static PropertyConfigurator of(String key, String value) { return of(Collections.singletonMap(key, value)); } }
PropertyConfigurator implements Consumer<BaseProject<?>> { public static PropertyConfigurator of(String key, String value) { return of(Collections.singletonMap(key, value)); } PropertyConfigurator(Map<String, String> edit); }
PropertyConfigurator implements Consumer<BaseProject<?>> { public static PropertyConfigurator of(String key, String value) { return of(Collections.singletonMap(key, value)); } PropertyConfigurator(Map<String, String> edit); static PropertyConfigurator nothing(); static PropertyConfigurator system(); static PropertyConfigurator of(String key, String value); static PropertyConfigurator of(String key, Path path); static PropertyConfigurator of(Map<String, String> properties); static PropertyConfigurator of(Properties properties); static PropertyConfigurator of(URL resource); static PropertyConfigurator of(Optional<? extends URL> resource); static PropertyConfigurator of(Enumeration<? extends URL> resources); @Override void accept(BaseProject<?> project); }
PropertyConfigurator implements Consumer<BaseProject<?>> { public static PropertyConfigurator of(String key, String value) { return of(Collections.singletonMap(key, value)); } PropertyConfigurator(Map<String, String> edit); static PropertyConfigurator nothing(); static PropertyConfigurator system(); static PropertyConfigurator of(String key, String value); static PropertyConfigurator of(String key, Path path); static PropertyConfigurator of(Map<String, String> properties); static PropertyConfigurator of(Properties properties); static PropertyConfigurator of(URL resource); static PropertyConfigurator of(Optional<? extends URL> resource); static PropertyConfigurator of(Enumeration<? extends URL> resources); @Override void accept(BaseProject<?> project);  }