@Test public void testPathPattern() throws Exception { String pathPattern1 = Route.build("/api/people/:person").pathPattern().toString(); assertEquals("/api/people/(?<person>[^/]*)[/]?", pathPattern1); String pathPattern2 = Route.build("/api/people/:person/hands/:hand/slap").pathPattern().toString(); assertEquals("/api/people/(?<person>[^/]*)/hands/(?<hand>[^/]*)/slap[/]?", pathPattern2); }
public Pattern pathPattern() { return pathPattern; }
Route { public Pattern pathPattern() { return pathPattern; } }
Route { public Pattern pathPattern() { return pathPattern; } private  Route(String path, Pattern pathPattern, List<String> keywords); }
Route { public Pattern pathPattern() { return pathPattern; } private  Route(String path, Pattern pathPattern, List<String> keywords); static Pattern compile(String pattern, List<String> keywords); static Route build(String pattern); Pattern pathPattern(); boolean matches(String path); Map<String, String> groups(String path); @Override boolean equals(final Object o); @Override int hashCode(); }
Route { public Pattern pathPattern() { return pathPattern; } private  Route(String path, Pattern pathPattern, List<String> keywords); static Pattern compile(String pattern, List<String> keywords); static Route build(String pattern); Pattern pathPattern(); boolean matches(String path); Map<String, String> groups(String path); @Override boolean equals(final Object o); @Override int hashCode();  }