Package rx.internal.operators
Class OperatorSwitchIfEmpty<T>
- java.lang.Object
-
- rx.internal.operators.OperatorSwitchIfEmpty<T>
-
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Func1<Subscriber<? super T>,Subscriber<? super T>>
,Function
,Observable.Operator<T,T>
public final class OperatorSwitchIfEmpty<T> extends java.lang.Object implements Observable.Operator<T,T>
If the Observable completes without emitting any items, subscribe to an alternate Observable. Allows for similar functionality toObservable.defaultIfEmpty(Object)
except instead of one item being emitted when empty, the results of the given Observable will be emitted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
OperatorSwitchIfEmpty.AlternateSubscriber<T>
(package private) static class
OperatorSwitchIfEmpty.ParentSubscriber<T>
-
Field Summary
Fields Modifier and Type Field Description private Observable<? extends T>
alternate
-
Constructor Summary
Constructors Constructor Description OperatorSwitchIfEmpty(Observable<? extends T> alternate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>
call(Subscriber<? super T> child)
-
-
-
Field Detail
-
alternate
private final Observable<? extends T> alternate
-
-
Constructor Detail
-
OperatorSwitchIfEmpty
public OperatorSwitchIfEmpty(Observable<? extends T> alternate)
-
-
Method Detail
-
call
public Subscriber<? super T> call(Subscriber<? super T> child)
- Specified by:
call
in interfaceFunc1<Subscriber<? super T>,Subscriber<? super T>>
-
-