@Test public void named_argument() throws Exception { class Helper { GroupName group_(String host, String port) { final Map<String, MetricValue> tags = new HashMap<>(); tags.put("host", MetricValue.fromStrValue(host)); tags.put("port", MetricValue.fromStrValue(port)); return GroupName.valueOf(SimpleGroupPath.valueOf(EMPTY_LIST), tags); } } final Helper H = new Helper(); final NameBoundResolver params = new NameBoundResolverSet( new SimpleBoundNameResolver( new SimpleBoundNameResolver.Names(Any2.right("host")), new ConstResolver( new ResolverTuple(newTupleElement("www.google.com")), new ResolverTuple(newTupleElement("www.groupon.com")))), new SimpleBoundNameResolver( new SimpleBoundNameResolver.Names(Any2.right("port")), new ConstResolver( new ResolverTuple(newTupleElement("8080")), new ResolverTuple(newTupleElement("80")))) ); final UrlPattern pattern = new UrlPattern("http: Map<GroupName, String> result = pattern.getUrls().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); assertThat(result, allOf( hasEntry(H.group_("www.google.com", "8080"), "http: hasEntry(H.group_("www.google.com", "80"), "http: hasEntry(H.group_("www.groupon.com", "8080"), "http: hasEntry(H.group_("www.groupon.com", "80"), "http: )); }
public Stream<Map.Entry<GroupName, String>> getUrls() throws Exception { return templateArgs.resolve() .map(this::apply_args_); }
UrlPattern { public Stream<Map.Entry<GroupName, String>> getUrls() throws Exception { return templateArgs.resolve() .map(this::apply_args_); } }
UrlPattern { public Stream<Map.Entry<GroupName, String>> getUrls() throws Exception { return templateArgs.resolve() .map(this::apply_args_); } UrlPattern(@NonNull StringTemplate urlTemplate, @NonNull NameBoundResolver templateArgs);  UrlPattern(String urlTemplate, NameBoundResolver templateArgs); }
UrlPattern { public Stream<Map.Entry<GroupName, String>> getUrls() throws Exception { return templateArgs.resolve() .map(this::apply_args_); } UrlPattern(@NonNull StringTemplate urlTemplate, @NonNull NameBoundResolver templateArgs);  UrlPattern(String urlTemplate, NameBoundResolver templateArgs); Stream<Map.Entry<GroupName, String>> getUrls(); @Override String toString(); }
UrlPattern { public Stream<Map.Entry<GroupName, String>> getUrls() throws Exception { return templateArgs.resolve() .map(this::apply_args_); } UrlPattern(@NonNull StringTemplate urlTemplate, @NonNull NameBoundResolver templateArgs);  UrlPattern(String urlTemplate, NameBoundResolver templateArgs); Stream<Map.Entry<GroupName, String>> getUrls(); @Override String toString();  }