@Test public void simple() { Map<String, String> pairs = new LinkedHashMap<>(); pairs.put("a", "A"); pairs.put("b", "B"); pairs.put("c", "C"); ConfigurationResolver resolver = new BasicConfigurationResolver("${key}:${value}"); List<String> resolved = resolver.apply(pairs).stream() .map(CommandToken::getImage) .collect(Collectors.toList()); assertThat(resolved, contains("a:A", "b:B", "c:C")); }
@Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; }
BasicConfigurationResolver implements CommandTaskInfo.ConfigurationResolver { @Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; } }
BasicConfigurationResolver implements CommandTaskInfo.ConfigurationResolver { @Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; } BasicConfigurationResolver(List<String> tokens);  BasicConfigurationResolver(String... tokens); }
BasicConfigurationResolver implements CommandTaskInfo.ConfigurationResolver { @Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; } BasicConfigurationResolver(List<String> tokens);  BasicConfigurationResolver(String... tokens); List<String> getTokens(); @Override List<CommandToken> apply(Map<String, String> configurations); }
BasicConfigurationResolver implements CommandTaskInfo.ConfigurationResolver { @Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; } BasicConfigurationResolver(List<String> tokens);  BasicConfigurationResolver(String... tokens); List<String> getTokens(); @Override List<CommandToken> apply(Map<String, String> configurations);  }