@@ -2828,12 +2828,13 @@ public final <R> Maybe<R> compose(@NonNull MaybeTransformer<? super T, ? extends
28282828 * Returns a {@code Maybe} that is based on applying a specified function to the item emitted by the current {@code Maybe},
28292829 * where that function returns a {@link MaybeSource}.
28302830 * <p>
2831- * <img width="640" height="356" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMap.png" alt="">
2831+ * <img width="640" height="216" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.concatMap.png" alt="">
2832+ * <p>
2833+ * Note that flatMap and concatMap for {@code Maybe} is the same operation.
28322834 * <dl>
28332835 * <dt><b>Scheduler:</b></dt>
28342836 * <dd>{@code concatMap} does not operate by default on a particular {@link Scheduler}.</dd>
28352837 * </dl>
2836- * <p>Note that flatMap and concatMap for {@code Maybe} is the same operation.
28372838 * @param <R> the result value type
28382839 * @param mapper
28392840 * a function that, when applied to the item emitted by the current {@code Maybe}, returns a {@code MaybeSource}
@@ -2845,8 +2846,63 @@ public final <R> Maybe<R> compose(@NonNull MaybeTransformer<? super T, ? extends
28452846 @ NonNull
28462847 @ SchedulerSupport (SchedulerSupport .NONE )
28472848 public final <R > Maybe <R > concatMap (@ NonNull Function <? super T , ? extends MaybeSource <? extends R >> mapper ) {
2848- Objects .requireNonNull (mapper , "mapper is null" );
2849- return RxJavaPlugins .onAssembly (new MaybeFlatten <>(this , mapper ));
2849+ return flatMap (mapper );
2850+ }
2851+
2852+ /**
2853+ * Returns a {@link Completable} that completes based on applying a specified function to the item emitted by the
2854+ * current {@code Maybe}, where that function returns a {@code Completable}.
2855+ * <p>
2856+ * <img width="640" height="304" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.concatMapCompletable.png" alt="">
2857+ * <p>
2858+ * This operator is an alias for {@link #flatMapCompletable(Function)}.
2859+ * <dl>
2860+ * <dt><b>Scheduler:</b></dt>
2861+ * <dd>{@code concatMapCompletable} does not operate by default on a particular {@link Scheduler}.</dd>
2862+ * </dl>
2863+ *
2864+ * @param mapper
2865+ * a function that, when applied to the item emitted by the current {@code Maybe}, returns a
2866+ * {@code Completable}
2867+ * @return the new {@code Completable} instance
2868+ * @throws NullPointerException if {@code mapper} is {@code null}
2869+ * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
2870+ * @since 3.0.0
2871+ */
2872+ @ CheckReturnValue
2873+ @ NonNull
2874+ @ SchedulerSupport (SchedulerSupport .NONE )
2875+ public final Completable concatMapCompletable (@ NonNull Function <? super T , ? extends CompletableSource > mapper ) {
2876+ return flatMapCompletable (mapper );
2877+ }
2878+
2879+ /**
2880+ * Returns a {@code Maybe} based on applying a specified function to the item emitted by the
2881+ * current {@code Maybe}, where that function returns a {@link Single}.
2882+ * When this {@code Maybe} just completes the resulting {@code Maybe} completes as well.
2883+ * <p>
2884+ * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.concatMapSingle.png" alt="">
2885+ * <p>
2886+ * This operator is an alias for {@link #flatMapSingleElement(Function)}.
2887+ * <dl>
2888+ * <dt><b>Scheduler:</b></dt>
2889+ * <dd>{@code concatMapSingle} does not operate by default on a particular {@link Scheduler}.</dd>
2890+ * </dl>
2891+ *
2892+ * @param <R> the result value type
2893+ * @param mapper
2894+ * a function that, when applied to the item emitted by the current {@code Maybe}, returns a
2895+ * {@code Single}
2896+ * @return the new {@code Maybe} instance
2897+ * @throws NullPointerException if {@code mapper} is {@code null}
2898+ * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
2899+ * @since 3.0.0
2900+ */
2901+ @ CheckReturnValue
2902+ @ NonNull
2903+ @ SchedulerSupport (SchedulerSupport .NONE )
2904+ public final <R > Maybe <R > concatMapSingle (@ NonNull Function <? super T , ? extends SingleSource <? extends R >> mapper ) {
2905+ return flatMapSingleElement (mapper );
28502906 }
28512907
28522908 /**
@@ -3732,7 +3788,7 @@ public final <R> Flowable<R> flatMapPublisher(@NonNull Function<? super T, ? ext
37323788 * current {@code Maybe}, where that function returns a {@code Single}.
37333789 * When this {@code Maybe} completes a {@link NoSuchElementException} will be thrown.
37343790 * <p>
3735- * <img width="640" height="356 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapSingle .png" alt="">
3791+ * <img width="640" height="346 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapSingle3 .png" alt="">
37363792 * <dl>
37373793 * <dt><b>Scheduler:</b></dt>
37383794 * <dd>{@code flatMapSingle} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -3759,7 +3815,7 @@ public final <R> Single<R> flatMapSingle(@NonNull Function<? super T, ? extends
37593815 * current {@code Maybe}, where that function returns a {@link Single}.
37603816 * When this {@code Maybe} just completes the resulting {@code Maybe} completes as well.
37613817 * <p>
3762- * <img width="640" height="356 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapSingle.png" alt="">
3818+ * <img width="640" height="315 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapSingle.png" alt="">
37633819 * <dl>
37643820 * <dt><b>Scheduler:</b></dt>
37653821 * <dd>{@code flatMapSingleElement} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -3787,7 +3843,7 @@ public final <R> Maybe<R> flatMapSingleElement(@NonNull Function<? super T, ? ex
37873843 * Returns a {@link Completable} that completes based on applying a specified function to the item emitted by the
37883844 * current {@code Maybe}, where that function returns a {@code Completable}.
37893845 * <p>
3790- * <img width="640" height="267 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapCompletable .png" alt="">
3846+ * <img width="640" height="303 " src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.flatMapCompletable3 .png" alt="">
37913847 * <dl>
37923848 * <dt><b>Scheduler:</b></dt>
37933849 * <dd>{@code flatMapCompletable} does not operate by default on a particular {@link Scheduler}.</dd>
0 commit comments