src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Observable<R> switchMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
        ObjectHelper.requireNonNull(mapper, "mapper is null");
        return RxJavaPlugins.onAssembly(new ObservableSwitchMapMaybe<T, R>(this, mapper, false));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Observable<R> switchMapMaybe(@NonNull Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
        ObjectHelper.requireNonNull(mapper, "mapper is null");
        return RxJavaPlugins.onAssembly(new ObservableSwitchMapMaybe<T, R>(this, mapper, false));
    }
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > switchMapMaybe ( @ NonNull Function < ? super T , ? extends MaybeSource < ? extends R > > mapper ) { ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableSwitchMapMaybe < T , R > ( this , mapper , false ) ) ; }
Maps the upstream items into {@link MaybeSource}s and switches (subscribes) to the newer ones
while disposing the older ones (and ignoring their signals) and emits the latest success value of the current one if
available while failing immediately if this {@code Observable} or any of the
active inner {@code MaybeSource}s fail.
<p>
<img width="640" height="350" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchMap.o.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code switchMapMaybe} does not operate by default on a particular {@link Scheduler}.</dd>
<dt><b>Error handling:</b></dt>
<dd>This operator terminates with an {@code onError} if this {@code Observable} or any of
the inner {@code MaybeSource}s fail while they are active. When this happens concurrently, their
individual {@code Throwable} errors may get combined and emitted as a single
{@link io.reactivex.exceptions.CompositeException CompositeException}. Otherwise, a late
(i.e., inactive or switched out) {@code onError} from this {@code Observable} or from any of
the inner {@code MaybeSource}s will be forwarded to the global error handler via
{@link io.reactivex.plugins.RxJavaPlugins#onError(Throwable)} as
{@link io.reactivex.exceptions.UndeliverableException UndeliverableException}</dd>
</dl>
<p>History: 2.1.11 - experimental
@param <R> the output value type
@param mapper the function called with the current upstream event and should
return a {@code MaybeSource} to replace the current active inner source
and get subscribed to.
@return the new Observable instance
@see #switchMapMaybe(Function)
@since 2.2
Maps the upstream items into {