@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(EnvironmentConfigurator.of(vars)); assertThat(project.environment("A"), is("1")); assertThat(project.environment("B"), is("2")); assertThat(project.environment("C"), is("3")); assertThat(project.environment("D"), is(nullValue())); Map<String, String> patch = new LinkedHashMap<>(); patch.put("B", "4"); patch.put("C", null); patch.put("D", "5"); project.with(EnvironmentConfigurator.of(patch)); assertThat(project.environment("A"), is("1")); assertThat(project.environment("B"), is("4")); assertThat(project.environment("C"), is(nullValue())); assertThat(project.environment("D"), is("5")); }
public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); }
EnvironmentConfigurator implements Consumer<BaseProject<?>> { public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); } }
EnvironmentConfigurator implements Consumer<BaseProject<?>> { public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); } EnvironmentConfigurator(Map<String, String> edit); }
EnvironmentConfigurator implements Consumer<BaseProject<?>> { public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); } EnvironmentConfigurator(Map<String, String> edit); static EnvironmentConfigurator nothing(); static EnvironmentConfigurator system(); static EnvironmentConfigurator of(String name, String value); static EnvironmentConfigurator of(String name, Path path); static EnvironmentConfigurator of(Map<String, String> variables); @Override void accept(BaseProject<?> project); }
EnvironmentConfigurator implements Consumer<BaseProject<?>> { public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); } EnvironmentConfigurator(Map<String, String> edit); static EnvironmentConfigurator nothing(); static EnvironmentConfigurator system(); static EnvironmentConfigurator of(String name, String value); static EnvironmentConfigurator of(String name, Path path); static EnvironmentConfigurator of(Map<String, String> variables); @Override void accept(BaseProject<?> project);  }