!htp #17965 more consistent and 22-ified javadsl handleWith

This commit is contained in:
Konrad Malawski 2015-07-13 16:46:07 +02:00
parent b137117399
commit 569c0bf079
27 changed files with 339 additions and 272 deletions

View file

@ -32,12 +32,12 @@ public class HighLevelServerExample extends HttpApp {
public Route createRoute() {
// This handler generates responses to `/hello?name=XXX` requests
Route helloRoute =
handleWith(name,
handleWith1(name,
// in Java 8 the following becomes simply
// (ctx, name) -> ctx.complete("Hello " + name + "!")
new Handler1<String>() {
@Override
public RouteResult handle(RequestContext ctx, String name) {
public RouteResult apply(RequestContext ctx, String name) {
return ctx.complete("Hello " + name + "!");
}
});