From ceb1bf116bf610762ebd57a62fb06dae3656aebe Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 2 Oct 2019 22:24:37 +0200 Subject: [PATCH] Provide the Future#flatMap method as alias of Future#compose method - closes #3145 --- src/main/java/io/vertx/core/Future.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/vertx/core/Future.java b/src/main/java/io/vertx/core/Future.java index 3bdea6321..adc4dd6aa 100644 --- a/src/main/java/io/vertx/core/Future.java +++ b/src/main/java/io/vertx/core/Future.java @@ -150,6 +150,13 @@ public interface Future extends AsyncResult { @Override boolean failed(); + /** + * Alias for {@link #compose(Function)}. + */ + default Future flatMap(Function> mapper) { + return compose(mapper); + } + /** * Compose this future with a {@code mapper} function.

*