mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
Provide the Future#flatMap method as alias of Future#compose method - closes #3145
This commit is contained in:
@@ -150,6 +150,13 @@ public interface Future<T> extends AsyncResult<T> {
|
||||
@Override
|
||||
boolean failed();
|
||||
|
||||
/**
|
||||
* Alias for {@link #compose(Function)}.
|
||||
*/
|
||||
default <U> Future<U> flatMap(Function<T, Future<U>> mapper) {
|
||||
return compose(mapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compose this future with a {@code mapper} function.<p>
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user