To open the door to this proposal, start a proof of concept within Nubes to map any @FunctionalInterface as a Handler with "magic" parameter injection.
Cannot be achieved as is since lambdas are not "methods" (when introspected at runtime).
Maybe compilation processing could be involved so that if a "resolving class" is annotated properly, then the code to create a Handler from it is automatically generated.
That'd be great to introduce type safety i.e. : you're trying to use a BiConsumer<String, Foo> as a Handler<RoutingContext> but I don't know how to map Foo from the RoutingContext.
To open the door to this proposal, start a proof of concept within Nubes to map any
@FunctionalInterface
as aHandler
with "magic" parameter injection.Cannot be achieved as is since lambdas are not "methods" (when introspected at runtime).
Maybe compilation processing could be involved so that if a "resolving class" is annotated properly, then the code to create a Handler from it is automatically generated.
That'd be great to introduce type safety i.e. : you're trying to use a
BiConsumer<String, Foo>
as aHandler<RoutingContext>
but I don't know how to mapFoo
from theRoutingContext
.