I'm trying to extend this interface:
@FunctionalInterface
public interface HandlerFunction<T extends ServerResponse> {
Mono<T> handle(ServerRequest request);
}
Like this:
@FunctionalInterface
public interface HandlerFn<R extends ServerRequest> extends HandlerFunction<ServerResponse> {
default Mono<ServerResponse> handle(ServerRequest request) {
return handleFn(request);
}
Mono<ServerResponse> handleFn(R request);
}
I'm getting this error (on handleFn(request)):
The method handleFn(R) in the type HandlerFn<R> is not applicable for the arguments (ServerRequest)
In this code snippet, why when calling handleFn(request) the type R is not inferred as ServerRequest ?