@Test public void argsToOptsShouldConvertArgsToOpts() { final Map<String, String> result = CoffeeHouseApp.argsToOpts(Arrays.asList("a=1", "b", "-Dc=2")); assertThat(result).contains(MapEntry.entry("a", "1"), MapEntry.entry("-Dc", "2")); }
static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } return opts; }
CoffeeHouseApp implements Terminal { static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } return opts; } }
CoffeeHouseApp implements Terminal { static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } return opts; } CoffeeHouseApp(final ActorSystem system); }
CoffeeHouseApp implements Terminal { static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } return opts; } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args); }
CoffeeHouseApp implements Terminal { static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } return opts; } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args);  }