Top Description Inners Fields Constructors Methods
io.reactivex.rxjava3.internal.operators.mixed

public final Class ObservableSwitchMapMaybe<T, R>

extends Observable<R>
Class Inheritance
Type Parameters
<T>
the upstream value type
<R>
the downstream value type
Imports
java.util.Objects, java.util.concurrent.atomic.*, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.exceptions.Exceptions, io.reactivex.rxjava3.functions.Function, io.reactivex.rxjava3.internal.disposables.DisposableHelper, io.reactivex.rxjava3.internal.util.AtomicThrowable, io.reactivex.rxjava3.plugins.RxJavaPlugins

Maps the upstream items into MaybeSources and switches (subscribes) to the newer ones while disposing the older ones and emits the latest success value if available, optionally delaying errors from the main source or the inner sources.

History: 2.1.11 - experimental

Since
2.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final Function<? super T, ? extends MaybeSource<? extends R>>
pack-priv final Observable<T>

Constructor Summary

AccessConstructor and Description
public
ObservableSwitchMapMaybe(Observable<T> source, Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean delayErrors)

Method Summary

Modifier and TypeMethod and Description
protected void
subscribeActual(Observer<? super R> observer)

Inherited from io.reactivex.rxjava3.core.Observable:
allambambArrayambWithanyblockingFirstblockingFirstblockingForEachblockingForEachblockingIterableblockingIterableblockingLastblockingLastblockingLatestblockingMostRecentblockingNextblockingSingleblockingSingleblockingStreamblockingStreamblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribebufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferSizecachecacheWithInitialCapacitycastcollectcollectcollectIntocombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestArraycombineLatestArraycombineLatestArrayDelayErrorcombineLatestArrayDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcomposeconcatconcatconcatconcatconcatconcatconcatArrayconcatArrayDelayErrorconcatArrayEagerconcatArrayEagerconcatArrayEagerDelayErrorconcatArrayEagerDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatEagerconcatEagerconcatEagerconcatEagerconcatEagerDelayErrorconcatEagerDelayErrorconcatEagerDelayErrorconcatEagerDelayErrorconcatMapconcatMapconcatMapconcatMapCompletableconcatMapCompletableconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapEagerconcatMapEagerconcatMapEagerDelayErrorconcatMapEagerDelayErrorconcatMapIterableconcatMapMaybeconcatMapMaybeconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapSingleconcatMapSingleconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatMapStreamconcatWithconcatWithconcatWithconcatWithcontainscountcreatedebouncedebouncedebouncedebouncedefaultIfEmptydeferdelaydelaydelaydelaydelaydelaydelaySubscriptiondelaySubscriptiondelaySubscriptiondematerializedistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterNextdoAfterTerminatedoFinallydoOnCompletedoOnDisposedoOnEachdoOnEachdoOnErrordoOnLifecycledoOnNextdoOnSubscribedoOnTerminateelementAtelementAtelementAtOrErroremptyerrorerrorfilterfirstfirstElementfirstOrErrorfirstOrErrorStagefirstStageflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapCompletableflatMapCompletableflatMapIterableflatMapIterableflatMapMaybeflatMapMaybeflatMapSingleflatMapSingleflatMapStreamforEachforEachWhileforEachWhileforEachWhilefromActionfromArrayfromCallablefromCompletablefromCompletionStagefromFuturefromFuturefromIterablefromMaybefromOptionalfromPublisherfromRunnablefromSinglefromStreamfromSuppliergenerategenerategenerategenerategenerategroupBygroupBygroupBygroupBygroupBygroupJoinhideignoreElementsintervalintervalintervalintervalintervalRangeintervalRangeisEmptyjoinjustjustjustjustjustjustjustjustjustjustlastlastElementlastOrErrorlastOrErrorStagelastStageliftmapmapOptionalmaterializemergemergemergemergemergemergemergemergemergeArraymergeArraymergeArrayDelayErrormergeArrayDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeWithmergeWithmergeWithmergeWithneverobserveOnobserveOnobserveOnofTypeonErrorCompleteonErrorCompleteonErrorResumeNextonErrorResumeWithonErrorReturnonErrorReturnItemonTerminateDetachpublishpublishrangerangeLongreducereducereduceWithrepeatrepeatrepeatUntilrepeatWhenreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayretryretryretryretryretryretryUntilretryWhensafeSubscribesamplesamplesamplesamplesamplesamplesamplescanscanscanWithsequenceEqualsequenceEqualsequenceEqualsequenceEqualserializesharesinglesingleElementsingleOrErrorsingleOrErrorStagesingleStageskipskipskipskipLastskipLastskipLastskipLastskipLastskipLastskipUntilskipWhilesortedsortedstartWithstartWithstartWithstartWithstartWithArraystartWithItemstartWithIterablesubscribesubscribesubscribesubscribesubscribesubscribesubscribeActualsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchMapCompletableswitchMapCompletableDelayErrorswitchMapDelayErrorswitchMapDelayErrorswitchMapMaybeswitchMapMaybeDelayErrorswitchMapSingleswitchMapSingleDelayErrorswitchOnNextswitchOnNextswitchOnNextDelayErrorswitchOnNextDelayErrortaketaketaketakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeUntiltakeUntiltakeWhiletesttestthrottleFirstthrottleFirstthrottleFirstthrottleLastthrottleLastthrottleLastthrottleLatestthrottleLatestthrottleLatestthrottleLatestthrottleLatestthrottleWithTimeoutthrottleWithTimeoutthrottleWithTimeouttimeIntervaltimeIntervaltimeIntervaltimeIntervaltimeouttimeouttimeouttimeouttimeouttimeouttimeouttimeouttimertimertimestamptimestamptimestamptimestamptotoFlowabletoFuturetoListtoListtoListtoMaptoMaptoMaptoMultimaptoMultimaptoMultimaptoMultimaptoSortedListtoSortedListtoSortedListtoSortedListunsafeCreateunsubscribeOnusingusingwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromwrapzipzipzipzipzipzipzipzipzipzipzipzipzipArrayzipWithzipWithzipWithzipWith

Field Detail

delayErrorsback to summary
pack-priv final boolean delayErrors
mapperback to summary
pack-priv final Function<? super T, ? extends MaybeSource<? extends R>> mapper
sourceback to summary
pack-priv final Observable<T> source

Constructor Detail

ObservableSwitchMapMaybeback to summary
public ObservableSwitchMapMaybe(Observable<T> source, Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean delayErrors)

Method Detail

subscribeActualback to summary
protected void subscribeActual(Observer<? super R> observer)
Annotations
@Override
io.reactivex.rxjava3.internal.operators.mixed back to summary

pack-priv final Class ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver<T, R>

extends AtomicInteger
implements Observer<T>, Disposable
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.core.Observer

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv final Observer<? super R>
pack-priv final AtomicThrowable
pack-priv final AtomicReference<ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<R>>
pack-priv static final ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<Object>
pack-priv final Function<? super T, ? extends MaybeSource<? extends R>>
private static final long
pack-priv Disposable

Constructor Summary

AccessConstructor and Description
pack-priv
SwitchMapMaybeMainObserver(Observer<? super R> downstream, Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean delayErrors)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public boolean
isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.
public void
onComplete()

Implements io.reactivex.rxjava3.core.Observer.onComplete.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
public void
onNext(T
the item emitted by the Observable
t
)

Implements io.reactivex.rxjava3.core.Observer.onNext.

Provides the Observer with a new item to observe.
public void
Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
delayErrorsback to summary
pack-priv final boolean delayErrors
doneback to summary
pack-priv volatile boolean done
downstreamback to summary
pack-priv final Observer<? super R> downstream
errorsback to summary
pack-priv final AtomicThrowable errors
innerback to summary
pack-priv final AtomicReference<ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<R>> inner
INNER_DISPOSEDback to summary
pack-priv static final ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<Object> INNER_DISPOSED
mapperback to summary
pack-priv final Function<? super T, ? extends MaybeSource<? extends R>> mapper
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicInteger.serialVersionUID.

upstreamback to summary
pack-priv Disposable upstream

Constructor Detail

SwitchMapMaybeMainObserverback to summary
pack-priv SwitchMapMaybeMainObserver(Observer<? super R> downstream, Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean delayErrors)

Method Detail

disposeback to summary
public void dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Doc from io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.

Annotations
@Override
disposeInnerback to summary
pack-priv void disposeInner()
Annotations
@SuppressWarnings:unchecked, rawtypes
drainback to summary
pack-priv void drain()
innerCompleteback to summary
pack-priv void innerComplete(ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<R> sender)
innerErrorback to summary
pack-priv void innerError(ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<R> sender, Throwable ex)
isDisposedback to summary
public boolean isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Doc from io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.

Returns:boolean

true if this resource has been disposed

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements io.reactivex.rxjava3.core.Observer.onComplete.

Doc from io.reactivex.rxjava3.core.Observer.onComplete.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)
Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements io.reactivex.rxjava3.core.Observer.onNext.

Doc from io.reactivex.rxjava3.core.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onComplete or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
@SuppressWarnings:unchecked, rawtypes
onSubscribeback to summary
public void onSubscribe(Disposable d)
Annotations
@Override
io.reactivex.rxjava3.internal.operators.mixed back to summary

pack-priv final Class ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver.SwitchMapMaybeObserver<R>

extends AtomicReference<Disposable>
implements MaybeObserver<R>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.core.MaybeObserver

Field Summary

Modifier and TypeField and Description
pack-priv volatile R
pack-priv final ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver<?, R>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Field Detail

itemback to summary
pack-priv volatile R item
parentback to summary
pack-priv final ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver<?, R> parent
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicReference.serialVersionUID.

Constructor Detail

SwitchMapMaybeObserverback to summary
pack-priv SwitchMapMaybeObserver(ObservableSwitchMapMaybe.SwitchMapMaybeMainObserver<?, R> parent)

Method Detail

disposeback to summary
pack-priv void dispose()
onCompleteback to summary
public void onComplete()

Implements io.reactivex.rxjava3.core.MaybeObserver.onComplete.

Doc from io.reactivex.rxjava3.core.MaybeObserver.onComplete.

Called once the deferred computation completes normally.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)
Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Disposable d)
Annotations
@Override
onSuccessback to summary
public void onSuccess(R t)

Implements io.reactivex.rxjava3.core.MaybeObserver.onSuccess.

Doc from io.reactivex.rxjava3.core.MaybeObserver.onSuccess.

Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.

The Maybe will not call this method if it calls onError.

Parameters
t:R

the item emitted by the Maybe

Annotations
@Override