/** * Converts this Maybe into an Observable instance composing disposal * through. * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * @return the new Observable instance */ @SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new MaybeToObservable<T>(this)); }
/** * Converts this Single into an {@link Observable}. * <p> * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.toObservable.png" alt=""> * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * * @return an {@link Observable} that emits a single item T or an error. */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public final Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new SingleToObservable<T>(this)); }
/** * Returns an Observable which when subscribed to subscribes to this Completable and * relays the terminal events to the subscriber. * <p> * <img width="640" height="293" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.toObservable.png" alt=""> * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * @param <T> the value type * @return the new Observable created */ @CheckReturnValue @SuppressWarnings("unchecked") @SchedulerSupport(SchedulerSupport.NONE) public final <T> Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new CompletableToObservable<T>(this)); }
/** * Converts this Maybe into an Observable instance composing cancellation * through. * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * @return the new Observable instance */ @SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new MaybeToObservable<T>(this)); }
/** * Returns an Observable which when subscribed to subscribes to this Completable and * relays the terminal events to the subscriber. * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * @param <T> the value type * @return the new Observable created */ @CheckReturnValue @SuppressWarnings("unchecked") @SchedulerSupport(SchedulerSupport.NONE) public final <T> Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new CompletableToObservable<T>(this)); }
/** * Converts this Single into an {@link Observable}. * <p> * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.toObservable.png" alt=""> * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code toObservable} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * * @return an {@link Observable} that emits a single item T or an error. */ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public final Observable<T> toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable<T>)this).fuseToObservable(); } return RxJavaPlugins.onAssembly(new SingleToObservable<T>(this)); }