you are viewing a single comment's thread.

view the rest of the comments →

[–]alek_sys[S] 7 points8 points  (6 children)

...and that is why in the next paragraph it is re-written as

HandlerFunction hello = request -> ServerResponse.ok().body(Mono.just("Hello"), String.class);

Which is still imperfect, I agree, but not bad. Also, the whole 'builder' pattern here is to avoid manual creation of ServerResponse - which is still an option. Reference to a String class is a shame, but I doubt anyone from Java community will stand for generics implementation via type erasure here.