/** * Creates an UnicastSubject with the given internal buffer capacity hint. * @param <T> the value type * @param capacityHint the hint to size the internal unbounded buffer * @return an UnicastSubject instance */ @CheckReturnValue public static <T> UnicastSubject<T> create(int capacityHint) { return new UnicastSubject<T>(capacityHint, true); }
/** * Creates a {@link BehaviorProcessor} without a default item. * * @param <T> * the type of item the Subject will emit * @return the constructed {@link BehaviorProcessor} */ @CheckReturnValue public static <T> BehaviorProcessor<T> create() { return new BehaviorProcessor<T>(); }
/** * Creates a {@link BehaviorSubject} without a default item. * * @param <T> * the type of item the Subject will emit * @return the constructed {@link BehaviorSubject} */ @CheckReturnValue public static <T> BehaviorSubject<T> create() { return new BehaviorSubject<T>(); }
/** * Creates an UnicastProcessor with the given internal buffer capacity hint. * @param <T> the value type * @param capacityHint the hint to size the internal unbounded buffer * @return an UnicastProcessor instance */ @CheckReturnValue public static <T> UnicastProcessor<T> create(int capacityHint) { return new UnicastProcessor<T>(capacityHint); }
/** * Constructs a PublishSubject. * @param <T> the value type * @return the new PublishSubject */ @CheckReturnValue public static <T> PublishSubject<T> create() { return new PublishSubject<T>(); }
/** * Creates an UnicastSubject with the given internal buffer capacity hint. * @param <T> the value type * @param capacityHint the hint to size the internal unbounded buffer * @return an UnicastSubject instance */ @CheckReturnValue public static <T> UnicastSubject<T> create(int capacityHint) { return new UnicastSubject<T>(capacityHint, true); }
/** * Creates a fresh CompletableSubject. * @return the new CompletableSubject instance */ @CheckReturnValue public static CompletableSubject create() { return new CompletableSubject(); }
/** * Creates an UnicastSubject with an internal buffer capacity hint 16. * @param <T> the value type * @return an UnicastSubject instance */ @CheckReturnValue public static <T> UnicastProcessor<T> create() { return new UnicastProcessor<T>(bufferSize()); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Completable mergeCompletableDelayError(Flowable<? extends CompletableSource> sources) { return mergeCompletableDelayError(sources, Integer.MAX_VALUE); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> firstOrError(Flowable<T> source) { return elementAtOrError(source, 0); }
/** * Creates a new AsyncProcessor. * @param <T> the value type to be received and emitted * @return the new AsyncProcessor instance */ @CheckReturnValue @NonNull public static <T> AsyncProcessor<T> create() { return new AsyncProcessor<T>(); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Flowable<T> concatMaybe(Flowable<? extends Maybe<? extends T>> sources) { return concatMaybe(sources, 2); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T, R> Flowable<R> flatMapPublisher(Maybe<T> source, Function<? super T, ? extends Publisher<? extends R>> mapper) { return toFlowable(source).flatMap(mapper); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Completable concatCompletable(Flowable<? extends CompletableSource> sources) { ObjectHelper.requireNonNull(sources, "sources is null"); return concatCompletable(sources, 2); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Completable flatMapCompletable(Flowable<T> source, Function<? super T, ? extends CompletableSource> mapper) { return flatMapCompletable(source, mapper, false, Flowable.bufferSize()); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T, R> Flowable<R> flatMapPublisher(Single<T> source, Function<? super T, ? extends Publisher<? extends R>> mapper) { return toFlowable(source).flatMap(mapper); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<Boolean> isEmpty(Flowable<T> source) { return all(source, Functions.alwaysFalse()); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<List<T>> toList(Flowable<T> source) { ObjectHelper.requireNonNull(source, "source is null"); return RxJavaObservablePlugins.onAssembly(new FlowableToListSingle<T, List<T>>(source)); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> singleOrError(Flowable<T> source) { ObjectHelper.requireNonNull(source, "source is null"); return RxJavaObservablePlugins.onAssembly(new FlowableSingleSingle<T>(source, null)); }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Flowable<T> concatMaybeArray(MaybeSource<? extends T>... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); return RxJavaFlowablePlugins.onAssembly(new MaybeConcatArray<T>(sources)); }