@Test public void filter() { String string = "42"; HandlerFunction<EntityResponse<String>> handlerFunction = request -> EntityResponse.fromObject(string).build(); RouterFunction<EntityResponse<String>> routerFunction = request -> Optional.of(handlerFunction); HandlerFilterFunction<EntityResponse<String>, EntityResponse<Integer>> filterFunction = (request, next) -> { String stringResponse = next.handle(request).entity(); Integer intResponse = Integer.parseInt(stringResponse); return EntityResponse.fromObject(intResponse).build(); }; RouterFunction<EntityResponse<Integer>> result = routerFunction.filter(filterFunction); assertNotNull(result); MockHttpServletRequest servletRequest = new MockHttpServletRequest(); ServerRequest request = new DefaultServerRequest(servletRequest, emptyList()); Optional<EntityResponse<Integer>> resultHandlerFunction = result.route(request) .map(hf -> { try { return hf.handle(request); } catch (Exception e) { fail(e.getMessage()); return null; } }); assertTrue(resultHandlerFunction.isPresent()); assertEquals(42, (int)resultHandlerFunction.get().entity()); }
public static Builder route() { return new RouterFunctionBuilder(); }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); } }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  static Builder route(); static RouterFunction<T> route(
			RequestPredicate predicate, HandlerFunction<T> handlerFunction); static RouterFunction<T> nest(
			RequestPredicate predicate, RouterFunction<T> routerFunction); static RouterFunction<ServerResponse> resources(String pattern, Resource location); static Function<ServerRequest, Optional<Resource>> resourceLookupFunction(String pattern, Resource location); static RouterFunction<ServerResponse> resources(Function<ServerRequest, Optional<Resource>> lookupFunction); }
RouterFunctions { public static Builder route() { return new RouterFunctionBuilder(); }  static Builder route(); static RouterFunction<T> route(
			RequestPredicate predicate, HandlerFunction<T> handlerFunction); static RouterFunction<T> nest(
			RequestPredicate predicate, RouterFunction<T> routerFunction); static RouterFunction<ServerResponse> resources(String pattern, Resource location); static Function<ServerRequest, Optional<Resource>> resourceLookupFunction(String pattern, Resource location); static RouterFunction<ServerResponse> resources(Function<ServerRequest, Optional<Resource>> lookupFunction); static final String REQUEST_ATTRIBUTE; static final String URI_TEMPLATE_VARIABLES_ATTRIBUTE; static final String MATCHING_PATTERN_ATTRIBUTE; }