@@ -2828,12 +2828,13 @@ public final <R> Maybe<R> compose(@NonNull MaybeTransformer<? super T, ? extends
2828
2828
* Returns a {@code Maybe} that is based on applying a specified function to the item emitted by the current {@code Maybe},
2829
2829
* where that function returns a {@link MaybeSource}.
2830
2830
* <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.
2832
2834
* <dl>
2833
2835
* <dt><b>Scheduler:</b></dt>
2834
2836
* <dd>{@code concatMap} does not operate by default on a particular {@link Scheduler}.</dd>
2835
2837
* </dl>
2836
- * <p>Note that flatMap and concatMap for {@code Maybe} is the same operation.
2837
2838
* @param <R> the result value type
2838
2839
* @param mapper
2839
2840
* 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
2845
2846
@ NonNull
2846
2847
@ SchedulerSupport (SchedulerSupport .NONE )
2847
2848
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 );
2850
2906
}
2851
2907
2852
2908
/**
@@ -3732,7 +3788,7 @@ public final <R> Flowable<R> flatMapPublisher(@NonNull Function<? super T, ? ext
3732
3788
* current {@code Maybe}, where that function returns a {@code Single}.
3733
3789
* When this {@code Maybe} completes a {@link NoSuchElementException} will be thrown.
3734
3790
* <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="">
3736
3792
* <dl>
3737
3793
* <dt><b>Scheduler:</b></dt>
3738
3794
* <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
3759
3815
* current {@code Maybe}, where that function returns a {@link Single}.
3760
3816
* When this {@code Maybe} just completes the resulting {@code Maybe} completes as well.
3761
3817
* <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="">
3763
3819
* <dl>
3764
3820
* <dt><b>Scheduler:</b></dt>
3765
3821
* <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
3787
3843
* Returns a {@link Completable} that completes based on applying a specified function to the item emitted by the
3788
3844
* current {@code Maybe}, where that function returns a {@code Completable}.
3789
3845
* <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="">
3791
3847
* <dl>
3792
3848
* <dt><b>Scheduler:</b></dt>
3793
3849
* <dd>{@code flatMapCompletable} does not operate by default on a particular {@link Scheduler}.</dd>
0 commit comments