diff --git a/src/main/java/io/reactivex/rxjava3/core/Completable.java b/src/main/java/io/reactivex/rxjava3/core/Completable.java index 96eb10c447..2f424fd405 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Completable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Completable.java @@ -630,7 +630,7 @@ public static Completable fromFuture(@NonNull Future future) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Completable fromMaybe(@NonNull MaybeSource maybe) { + public static <@NonNull T> Completable fromMaybe(@NonNull MaybeSource maybe) { Objects.requireNonNull(maybe, "maybe is null"); return RxJavaPlugins.onAssembly(new MaybeIgnoreElementCompletable<>(maybe)); } @@ -686,7 +686,7 @@ public static Completable fromRunnable(@NonNull Runnable run) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Completable fromObservable(@NonNull ObservableSource observable) { + public static <@NonNull T> Completable fromObservable(@NonNull ObservableSource observable) { Objects.requireNonNull(observable, "observable is null"); return RxJavaPlugins.onAssembly(new CompletableFromObservable<>(observable)); } @@ -724,7 +724,7 @@ public static Completable fromObservable(@NonNull ObservableSource observ @NonNull @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) - public static Completable fromPublisher(@NonNull Publisher publisher) { + public static <@NonNull T> Completable fromPublisher(@NonNull Publisher publisher) { Objects.requireNonNull(publisher, "publisher is null"); return RxJavaPlugins.onAssembly(new CompletableFromPublisher<>(publisher)); } @@ -746,7 +746,7 @@ public static Completable fromPublisher(@NonNull Publisher publisher) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Completable fromSingle(@NonNull SingleSource single) { + public static <@NonNull T> Completable fromSingle(@NonNull SingleSource single) { Objects.requireNonNull(single, "single is null"); return RxJavaPlugins.onAssembly(new CompletableFromSingle<>(single)); } @@ -1225,7 +1225,7 @@ public static Completable switchOnNextDelayError(@NonNull Publisher<@NonNull ? e @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Completable using(@NonNull Supplier resourceSupplier, + public static <@NonNull R> Completable using(@NonNull Supplier resourceSupplier, @NonNull Function sourceSupplier, @NonNull Consumer resourceCleanup) { return using(resourceSupplier, sourceSupplier, resourceCleanup, true); @@ -1261,7 +1261,7 @@ public static Completable using(@NonNull Supplier resourceSupplier, @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Completable using( + public static <@NonNull R> Completable using( @NonNull Supplier resourceSupplier, @NonNull Function sourceSupplier, @NonNull Consumer resourceCleanup, @@ -2194,7 +2194,7 @@ public final Completable lift(@NonNull CompletableOperator onLift) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single> materialize() { + public final <@NonNull T> Single> materialize() { return RxJavaPlugins.onAssembly(new CompletableMaterialize<>(this)); } @@ -2356,7 +2356,7 @@ public final Completable onErrorResumeWith(@NonNull CompletableSource fallback) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe onErrorReturn(@NonNull Function itemSupplier) { + public final <@NonNull T> Maybe onErrorReturn(@NonNull Function itemSupplier) { Objects.requireNonNull(itemSupplier, "itemSupplier is null"); return RxJavaPlugins.onAssembly(new CompletableOnErrorReturn<>(this, itemSupplier)); } @@ -2384,7 +2384,7 @@ public final Maybe onErrorReturn(@NonNull Function Maybe onErrorReturnItem(@NonNull T item) { + public final <@NonNull T> Maybe onErrorReturnItem(@NonNull T item) { Objects.requireNonNull(item, "item is null"); return onErrorReturn(Functions.justFunction(item)); } @@ -2483,7 +2483,7 @@ public final Completable repeatUntil(@NonNull BooleanSupplier stop) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Completable repeatWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Completable repeatWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return fromPublisher(toFlowable().repeatWhen(handler)); } @@ -2655,7 +2655,7 @@ public final Completable retryUntil(@NonNull BooleanSupplier stop) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Completable retryWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Completable retryWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return fromPublisher(toFlowable().retryWhen(handler)); } @@ -2726,7 +2726,7 @@ public final Completable startWith(@NonNull CompletableSource other) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public final Flowable startWith(@NonNull SingleSource other) { + public final <@NonNull T> Flowable startWith(@NonNull SingleSource other) { Objects.requireNonNull(other, "other is null"); return Flowable.concat(Single.wrap(other).toFlowable(), toFlowable()); } @@ -2752,7 +2752,7 @@ public final Flowable startWith(@NonNull SingleSource other) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public final Flowable startWith(@NonNull MaybeSource other) { + public final <@NonNull T> Flowable startWith(@NonNull MaybeSource other) { Objects.requireNonNull(other, "other is null"); return Flowable.concat(Maybe.wrap(other).toFlowable(), toFlowable()); } @@ -2774,7 +2774,7 @@ public final Flowable startWith(@NonNull MaybeSource other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Observable startWith(@NonNull ObservableSource other) { + public final <@NonNull T> Observable startWith(@NonNull ObservableSource other) { Objects.requireNonNull(other, "other is null"); return Observable.wrap(other).concatWith(this.toObservable()); } @@ -2800,7 +2800,7 @@ public final Observable startWith(@NonNull ObservableSource other) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable startWith(@NonNull Publisher other) { + public final <@NonNull T> Flowable startWith(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return this.toFlowable().startWith(other); } @@ -3214,7 +3214,7 @@ public final R to(@NonNull CompletableConverter converter) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable toFlowable() { + public final <@NonNull T> Flowable toFlowable() { if (this instanceof FuseToFlowable) { return ((FuseToFlowable)this).fuseToFlowable(); } @@ -3259,7 +3259,7 @@ public final Future toFuture() { @SuppressWarnings("unchecked") @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Maybe toMaybe() { + public final <@NonNull T> Maybe toMaybe() { if (this instanceof FuseToMaybe) { return ((FuseToMaybe)this).fuseToMaybe(); } @@ -3282,7 +3282,7 @@ public final Maybe toMaybe() { @SuppressWarnings("unchecked") @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable toObservable() { + public final <@NonNull T> Observable toObservable() { if (this instanceof FuseToObservable) { return ((FuseToObservable)this).fuseToObservable(); } @@ -3469,7 +3469,7 @@ public static Completable fromCompletionStage(@NonNull CompletionStage stage) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final CompletionStage toCompletionStage(@Nullable T defaultItem) { + public final <@Nullable T> CompletionStage toCompletionStage(T defaultItem) { return subscribeWith(new CompletionStageConsumer<>(true, defaultItem)); } } diff --git a/src/main/java/io/reactivex/rxjava3/core/Flowable.java b/src/main/java/io/reactivex/rxjava3/core/Flowable.java index d22d8dc4dc..31827d9e1c 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Flowable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Flowable.java @@ -193,7 +193,7 @@ public abstract class Flowable<@NonNull T> implements Publisher { @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable amb(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable amb(@NonNull Iterable<@NonNull ? extends Publisher> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableAmb<>(null, sources)); } @@ -232,7 +232,7 @@ public static Flowable amb(@NonNull Iterable<@NonNull ? extends Publisher @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable ambArray(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable ambArray(@NonNull Publisher... sources) { Objects.requireNonNull(sources, "sources is null"); int len = sources.length; if (len == 0) { @@ -296,7 +296,7 @@ public static int bufferSize() { @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @NonNull - public static Flowable combineLatestArray(@NonNull Publisher<@NonNull ? extends T>[] sources, @NonNull Function combiner) { + public static <@NonNull T, @NonNull R> Flowable combineLatestArray(@NonNull Publisher[] sources, @NonNull Function combiner) { return combineLatestArray(sources, combiner, bufferSize()); } @@ -344,7 +344,7 @@ public static int bufferSize() { @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) - public static Flowable combineLatestArray(@NonNull Publisher<@NonNull ? extends T>[] sources, @NonNull Function combiner, int bufferSize) { + public static <@NonNull T, @NonNull R> Flowable combineLatestArray(@NonNull Publisher[] sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -395,7 +395,7 @@ public static Flowable combineLatestArray(@NonNull Publisher<@NonNull @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @NonNull - public static Flowable combineLatest(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, + public static <@NonNull T, @NonNull R> Flowable combineLatest(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function combiner) { return combineLatest(sources, combiner, bufferSize()); } @@ -444,7 +444,7 @@ public static Flowable combineLatestArray(@NonNull Publisher<@NonNull @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) - public static Flowable combineLatest(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, + public static <@NonNull T, @NonNull R> Flowable combineLatest(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -493,7 +493,7 @@ public static Flowable combineLatest(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @NonNull - public static Flowable combineLatestArrayDelayError(@NonNull Publisher<@NonNull ? extends T>[] sources, + public static <@NonNull T, @NonNull R> Flowable combineLatestArrayDelayError(@NonNull Publisher[] sources, @NonNull Function combiner) { return combineLatestArrayDelayError(sources, combiner, bufferSize()); } @@ -543,7 +543,7 @@ public static Flowable combineLatest(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.FULL) - public static Flowable combineLatestArrayDelayError(@NonNull Publisher<@NonNull ? extends T>[] sources, + public static <@NonNull T, @NonNull R> Flowable combineLatestArrayDelayError(@NonNull Publisher[] sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -596,7 +596,7 @@ public static Flowable combineLatest(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @NonNull - public static Flowable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, + public static <@NonNull T, @NonNull R> Flowable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function combiner) { return combineLatestDelayError(sources, combiner, bufferSize()); } @@ -646,7 +646,7 @@ public static Flowable combineLatest(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @NonNull - public static Flowable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, + public static <@NonNull T, @NonNull R> Flowable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -691,8 +691,8 @@ public static Flowable combineLatestDelayError(@NonNull Iterable<@NonN @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, + public static <@NonNull T1, @NonNull T2, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiFunction combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -740,9 +740,9 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Function3 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -795,9 +795,9 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, @NonNull Function4 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -854,10 +854,10 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, - @NonNull Publisher<@NonNull ? extends T5> source5, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, + @NonNull Publisher source5, @NonNull Function5 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -918,10 +918,10 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, - @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, + @NonNull Publisher source5, @NonNull Publisher source6, @NonNull Function6 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -987,11 +987,11 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, - @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, + @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Function7 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -1061,11 +1061,11 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, - @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, @NonNull Publisher<@NonNull ? extends T8> source8, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, + @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Publisher source8, @NonNull Function8 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -1140,12 +1140,12 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable combineLatest( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, - @NonNull Publisher<@NonNull ? extends T3> source3, @NonNull Publisher<@NonNull ? extends T4> source4, - @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, @NonNull Publisher<@NonNull ? extends T8> source8, - @NonNull Publisher<@NonNull ? extends T9> source9, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Flowable combineLatest( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4, + @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Publisher source8, + @NonNull Publisher source9, @NonNull Function9 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -1184,7 +1184,7 @@ public static Flowable combineLatest( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concat(@NonNull Iterable<@NonNull ? extends Publisher> sources) { Objects.requireNonNull(sources, "sources is null"); // unlike general sources, fromIterable can only throw on a boundary because it is consumed only there return fromIterable(sources).concatMapDelayError((Function)Functions.identity(), false, 2); @@ -1216,7 +1216,7 @@ public static Flowable concat(@NonNull Iterable<@NonNull ? extends Publis @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concat(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return concat(sources, bufferSize()); } @@ -1250,7 +1250,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Publi @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concat(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int prefetch) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends Publisher> sources, int prefetch) { return fromPublisher(sources).concatMap((Function)Functions.identity(), prefetch); } @@ -1282,7 +1282,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Publi @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2) { + public static <@NonNull T> Flowable concat(@NonNull Publisher source1, @NonNull Publisher source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return concatArray(source1, source2); @@ -1318,9 +1318,9 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends T> so @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( - @NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, - @NonNull Publisher<@NonNull ? extends T> source3) { + public static <@NonNull T> Flowable concat( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -1359,9 +1359,9 @@ public static Flowable concat( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( - @NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, - @NonNull Publisher<@NonNull ? extends T> source3, @NonNull Publisher<@NonNull ? extends T> source4) { + public static <@NonNull T> Flowable concat( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -1394,7 +1394,7 @@ public static Flowable concat( @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable concatArray(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArray(@NonNull Publisher... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -1429,7 +1429,7 @@ public static Flowable concatArray(@NonNull Publisher<@NonNull ? extends @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable concatArrayDelayError(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArrayDelayError(@NonNull Publisher... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -1468,7 +1468,7 @@ public static Flowable concatArrayDelayError(@NonNull Publisher<@NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable concatArrayEager(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArrayEager(@NonNull Publisher... sources) { return concatArrayEager(bufferSize(), bufferSize(), sources); } @@ -1505,7 +1505,7 @@ public static Flowable concatArrayEager(@NonNull Publisher<@NonNull ? ext @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "rawtypes", "unchecked" }) @SafeVarargs - public static Flowable concatArrayEager(int maxConcurrency, int prefetch, @NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArrayEager(int maxConcurrency, int prefetch, @NonNull Publisher... sources) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1541,7 +1541,7 @@ public static Flowable concatArrayEager(int maxConcurrency, int prefetch, @BackpressureSupport(BackpressureKind.FULL) @SafeVarargs @NonNull - public static Flowable concatArrayEagerDelayError(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArrayEagerDelayError(@NonNull Publisher... sources) { return concatArrayEagerDelayError(bufferSize(), bufferSize(), sources); } @@ -1579,7 +1579,7 @@ public static Flowable concatArrayEagerDelayError(@NonNull Publisher<@Non @BackpressureSupport(BackpressureKind.FULL) @SafeVarargs @NonNull - public static Flowable concatArrayEagerDelayError(int maxConcurrency, int prefetch, @NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable concatArrayEagerDelayError(int maxConcurrency, int prefetch, @NonNull Publisher... sources) { return fromArray(sources).concatMapEagerDelayError((Function)Functions.identity(), true, maxConcurrency, prefetch); } @@ -1607,7 +1607,7 @@ public static Flowable concatArrayEagerDelayError(int maxConcurrency, int @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources) { Objects.requireNonNull(sources, "sources is null"); return fromIterable(sources).concatMapDelayError((Function)Functions.identity()); } @@ -1632,7 +1632,7 @@ public static Flowable concatDelayError(@NonNull Iterable<@NonNull ? exte @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return concatDelayError(sources, bufferSize(), true); } @@ -1661,7 +1661,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int prefetch, boolean tillTheEnd) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources, int prefetch, boolean tillTheEnd) { return fromPublisher(sources).concatMapDelayError((Function)Functions.identity(), tillTheEnd, prefetch); } @@ -1691,7 +1691,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher> sources) { return concatEager(sources, bufferSize(), bufferSize()); } @@ -1727,7 +1727,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends P @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1760,7 +1760,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends P @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return concatEager(sources, bufferSize(), bufferSize()); } @@ -1796,7 +1796,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends Publisher> sources, int maxConcurrency, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1830,7 +1830,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources) { return concatEagerDelayError(sources, bufferSize(), bufferSize()); } @@ -1867,7 +1867,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1901,7 +1901,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return concatEagerDelayError(sources, bufferSize(), bufferSize()); } @@ -1938,7 +1938,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int prefetch) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources, int maxConcurrency, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -2003,7 +2003,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @NonNull @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable create(@NonNull FlowableOnSubscribe source, @NonNull BackpressureStrategy mode) { + public static <@NonNull T> Flowable create(@NonNull FlowableOnSubscribe source, @NonNull BackpressureStrategy mode) { Objects.requireNonNull(source, "source is null"); Objects.requireNonNull(mode, "mode is null"); return RxJavaPlugins.onAssembly(new FlowableCreate<>(source, mode)); @@ -2040,7 +2040,7 @@ public static Flowable create(@NonNull FlowableOnSubscribe source, @No @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable defer(@NonNull Supplier> supplier) { + public static <@NonNull T> Flowable defer(@NonNull Supplier> supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new FlowableDefer<>(supplier)); } @@ -2067,7 +2067,7 @@ public static Flowable defer(@NonNull Supplier Flowable empty() { + public static <@NonNull T> Flowable empty() { return RxJavaPlugins.onAssembly((Flowable) FlowableEmpty.INSTANCE); } @@ -2095,7 +2095,7 @@ public static Flowable empty() { @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable error(@NonNull Supplier supplier) { + public static <@NonNull T> Flowable error(@NonNull Supplier supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new FlowableError<>(supplier)); } @@ -2124,7 +2124,7 @@ public static Flowable error(@NonNull Supplier suppl @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable error(@NonNull Throwable throwable) { + public static <@NonNull T> Flowable error(@NonNull Throwable throwable) { Objects.requireNonNull(throwable, "throwable is null"); return error(Functions.justSupplier(throwable)); } @@ -2157,7 +2157,7 @@ public static Flowable error(@NonNull Throwable throwable) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.PASS_THROUGH) - public static Flowable fromAction(@NonNull Action action) { + public static <@NonNull T> Flowable fromAction(@NonNull Action action) { Objects.requireNonNull(action, "action is null"); return RxJavaPlugins.onAssembly(new FlowableFromAction<>(action)); } @@ -2259,7 +2259,7 @@ public static Flowable fromAction(@NonNull Action action) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.PASS_THROUGH) - public static Flowable fromCompletable(@NonNull CompletableSource completableSource) { + public static <@NonNull T> Flowable fromCompletable(@NonNull CompletableSource completableSource) { Objects.requireNonNull(completableSource, "completableSource is null"); return RxJavaPlugins.onAssembly(new FlowableFromCompletable<>(completableSource)); } @@ -2379,7 +2379,7 @@ public static Flowable fromCompletable(@NonNull CompletableSource complet @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static <@NonNull T> Flowable fromIterable(@NonNull Iterable<@NonNull ? extends T> source) { + public static <@NonNull T> Flowable fromIterable(@NonNull Iterable source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new FlowableFromIterable<>(source)); } @@ -2406,7 +2406,7 @@ public static Flowable fromCompletable(@NonNull CompletableSource complet @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static Flowable fromMaybe(@NonNull MaybeSource maybe) { + public static <@NonNull T> Flowable fromMaybe(@NonNull MaybeSource maybe) { Objects.requireNonNull(maybe, "maybe is null"); return RxJavaPlugins.onAssembly(new MaybeToFlowable<>(maybe)); } @@ -2454,7 +2454,7 @@ public static Flowable fromMaybe(@NonNull MaybeSource maybe) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable fromObservable(@NonNull ObservableSource source, @NonNull BackpressureStrategy strategy) { + public static <@NonNull T> Flowable fromObservable(@NonNull ObservableSource source, @NonNull BackpressureStrategy strategy) { Objects.requireNonNull(source, "source is null"); Objects.requireNonNull(strategy, "strategy is null"); Flowable f = new FlowableFromObservable<>(source); @@ -2504,7 +2504,7 @@ public static Flowable fromObservable(@NonNull ObservableSource source @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") - public static Flowable fromPublisher(@NonNull Publisher<@NonNull ? extends T> publisher) { + public static <@NonNull T> Flowable fromPublisher(@NonNull Publisher publisher) { if (publisher instanceof Flowable) { return RxJavaPlugins.onAssembly((Flowable)publisher); } @@ -2547,7 +2547,7 @@ public static Flowable fromPublisher(@NonNull Publisher<@NonNull ? extend @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.PASS_THROUGH) - public static Flowable fromRunnable(@NonNull Runnable run) { + public static <@NonNull T> Flowable fromRunnable(@NonNull Runnable run) { Objects.requireNonNull(run, "run is null"); return RxJavaPlugins.onAssembly(new FlowableFromRunnable<>(run)); } @@ -2573,7 +2573,7 @@ public static Flowable fromRunnable(@NonNull Runnable run) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static Flowable fromSingle(@NonNull SingleSource source) { + public static <@NonNull T> Flowable fromSingle(@NonNull SingleSource source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new SingleToFlowable<>(source)); } @@ -2646,7 +2646,7 @@ public static Flowable fromSingle(@NonNull SingleSource source) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable generate(@NonNull Consumer<@NonNull Emitter> generator) { + public static <@NonNull T> Flowable generate(@NonNull Consumer<@NonNull Emitter> generator) { Objects.requireNonNull(generator, "generator is null"); return generate(Functions.nullSupplier(), FlowableInternalHelper.simpleGenerator(generator), @@ -2681,7 +2681,7 @@ public static Flowable generate(@NonNull Consumer<@NonNull Emitter> ge @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator) { + public static <@NonNull T, @NonNull S> Flowable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator) { Objects.requireNonNull(generator, "generator is null"); return generate(initialState, FlowableInternalHelper.simpleBiGenerator(generator), Functions.emptyConsumer()); @@ -2717,7 +2717,7 @@ public static Flowable generate(@NonNull Supplier initialState, @No @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator, + public static <@NonNull T, @NonNull S> Flowable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator, @NonNull Consumer disposeState) { Objects.requireNonNull(generator, "generator is null"); return generate(initialState, FlowableInternalHelper.simpleBiGenerator(generator), disposeState); @@ -2752,7 +2752,7 @@ public static Flowable generate(@NonNull Supplier initialState, @No @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator) { + public static <@NonNull T, @NonNull S> Flowable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator) { return generate(initialState, generator, Functions.emptyConsumer()); } @@ -2787,7 +2787,7 @@ public static Flowable generate(@NonNull Supplier initialState, @No @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator, @NonNull Consumer disposeState) { + public static <@NonNull T, @NonNull S> Flowable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator, @NonNull Consumer disposeState) { Objects.requireNonNull(initialState, "initialState is null"); Objects.requireNonNull(generator, "generator is null"); Objects.requireNonNull(disposeState, "disposeState is null"); @@ -3494,7 +3494,7 @@ public static Flowable intervalRange(long start, long count, long initialD @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).flatMap((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -3547,7 +3547,7 @@ public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publish @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArray(int maxConcurrency, int bufferSize, @NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable mergeArray(int maxConcurrency, int bufferSize, @NonNull Publisher... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -3592,7 +3592,7 @@ public static Flowable mergeArray(int maxConcurrency, int bufferSize, @No @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher> sources) { return fromIterable(sources).flatMap((Function)Functions.identity()); } @@ -3642,7 +3642,7 @@ public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publish @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency) { + public static <@NonNull T> Flowable merge(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency) { return fromIterable(sources).flatMap((Function)Functions.identity(), maxConcurrency); } @@ -3688,7 +3688,7 @@ public static Flowable merge(@NonNull Iterable<@NonNull ? extends Publish @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable merge(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return merge(sources, bufferSize()); } @@ -3740,7 +3740,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends Publis @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency) { + public static <@NonNull T> Flowable merge(@NonNull Publisher<@NonNull ? extends Publisher> sources, int maxConcurrency) { return fromPublisher(sources).flatMap((Function)Functions.identity(), maxConcurrency); } @@ -3786,7 +3786,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends Publis @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArray(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable mergeArray(@NonNull Publisher... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), sources.length); } @@ -3833,7 +3833,7 @@ public static Flowable mergeArray(@NonNull Publisher<@NonNull ? extends T @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2) { + public static <@NonNull T> Flowable merge(@NonNull Publisher source1, @NonNull Publisher source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return fromArray(source1, source2).flatMap((Function)Functions.identity(), false, 2); @@ -3884,7 +3884,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends T> sou @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, @NonNull Publisher<@NonNull ? extends T> source3) { + public static <@NonNull T> Flowable merge(@NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -3938,9 +3938,9 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends T> sou @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge( - @NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, - @NonNull Publisher<@NonNull ? extends T> source3, @NonNull Publisher<@NonNull ? extends T> source4) { + public static <@NonNull T> Flowable merge( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -3981,7 +3981,7 @@ public static Flowable merge( @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources) { return fromIterable(sources).flatMap((Function)Functions.identity(), true); } @@ -4023,7 +4023,7 @@ public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? exten @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).flatMap((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -4066,7 +4066,7 @@ public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? exten @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArrayDelayError(int maxConcurrency, int bufferSize, @NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable mergeArrayDelayError(int maxConcurrency, int bufferSize, @NonNull Publisher... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -4106,7 +4106,7 @@ public static Flowable mergeArrayDelayError(int maxConcurrency, int buffe @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends Publisher> sources, int maxConcurrency) { return fromIterable(sources).flatMap((Function)Functions.identity(), true, maxConcurrency); } @@ -4143,7 +4143,7 @@ public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? exten @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return mergeDelayError(sources, bufferSize()); } @@ -4185,7 +4185,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int maxConcurrency) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources, int maxConcurrency) { return fromPublisher(sources).flatMap((Function)Functions.identity(), true, maxConcurrency); } @@ -4223,7 +4223,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArrayDelayError(@NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T> Flowable mergeArrayDelayError(@NonNull Publisher... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), true, sources.length); } @@ -4262,7 +4262,7 @@ public static Flowable mergeArrayDelayError(@NonNull Publisher<@NonNull ? @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher source1, @NonNull Publisher source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return fromArray(source1, source2).flatMap((Function)Functions.identity(), true, 2); @@ -4306,7 +4306,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, @NonNull Publisher<@NonNull ? extends T> source3) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -4353,9 +4353,9 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError( - @NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, - @NonNull Publisher<@NonNull ? extends T> source3, @NonNull Publisher<@NonNull ? extends T> source4) { + public static <@NonNull T> Flowable mergeDelayError( + @NonNull Publisher source1, @NonNull Publisher source2, + @NonNull Publisher source3, @NonNull Publisher source4) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); Objects.requireNonNull(source3, "source3 is null"); @@ -4386,7 +4386,7 @@ public static Flowable mergeDelayError( @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") @NonNull - public static Flowable never() { + public static <@NonNull T> Flowable never() { return RxJavaPlugins.onAssembly((Flowable) FlowableNever.INSTANCE); } @@ -4506,7 +4506,7 @@ public static Flowable rangeLong(long start, long count) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2) { + public static <@NonNull T> Single sequenceEqual(@NonNull Publisher source1, @NonNull Publisher source2) { return sequenceEqual(source1, source2, ObjectHelper.equalsPredicate(), bufferSize()); } @@ -4540,7 +4540,7 @@ public static Single sequenceEqual(@NonNull Publisher<@NonNull ? ex @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, + public static <@NonNull T> Single sequenceEqual(@NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiPredicate isEqual) { return sequenceEqual(source1, source2, isEqual, bufferSize()); } @@ -4578,7 +4578,7 @@ public static Single sequenceEqual(@NonNull Publisher<@NonNull ? ex @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Single sequenceEqual(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, + public static <@NonNull T> Single sequenceEqual(@NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiPredicate isEqual, int bufferSize) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -4617,7 +4617,7 @@ public static Single sequenceEqual(@NonNull Publisher<@NonNull ? ex @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull Publisher<@NonNull ? extends T> source1, @NonNull Publisher<@NonNull ? extends T> source2, int bufferSize) { + public static <@NonNull T> Single sequenceEqual(@NonNull Publisher source1, @NonNull Publisher source2, int bufferSize) { return sequenceEqual(source1, source2, ObjectHelper.equalsPredicate(), bufferSize); } @@ -4659,7 +4659,7 @@ public static Single sequenceEqual(@NonNull Publisher<@NonNull ? ex @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int bufferSize) { + public static <@NonNull T> Flowable switchOnNext(@NonNull Publisher> sources, int bufferSize) { return fromPublisher(sources).switchMap((Function)Functions.identity(), bufferSize); } @@ -4698,7 +4698,7 @@ public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return fromPublisher(sources).switchMap((Function)Functions.identity()); } @@ -4738,7 +4738,7 @@ public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources) { + public static <@NonNull T> Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources) { return switchOnNextDelayError(sources, bufferSize()); } @@ -4781,8 +4781,8 @@ public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, int prefetch) { - return fromPublisher(sources).switchMapDelayError(Functions.>identity(), prefetch); + public static <@NonNull T> Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends Publisher> sources, int prefetch) { + return fromPublisher(sources).switchMapDelayError(Functions.>identity(), prefetch); } /** @@ -4870,7 +4870,7 @@ public static Flowable timer(long delay, @NonNull TimeUnit unit, @NonNull @NonNull @BackpressureSupport(BackpressureKind.NONE) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable unsafeCreate(@NonNull Publisher onSubscribe) { + public static <@NonNull T> Flowable unsafeCreate(@NonNull Publisher onSubscribe) { Objects.requireNonNull(onSubscribe, "onSubscribe is null"); if (onSubscribe instanceof Flowable) { throw new IllegalArgumentException("unsafeCreate(Flowable) should be upgraded"); @@ -4908,9 +4908,9 @@ public static Flowable unsafeCreate(@NonNull Publisher onSubscribe) { @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable using( + public static <@NonNull T, @NonNull D> Flowable using( @NonNull Supplier resourceSupplier, - @NonNull Function> sourceSupplier, + @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup) { return using(resourceSupplier, sourceSupplier, resourceCleanup, true); } @@ -4951,9 +4951,9 @@ public static Flowable using( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable using( + public static <@NonNull T, @NonNull D> Flowable using( @NonNull Supplier resourceSupplier, - @NonNull Function> sourceSupplier, + @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup, boolean eager) { Objects.requireNonNull(resourceSupplier, "resourceSupplier is null"); @@ -5011,7 +5011,7 @@ public static Flowable using( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, @NonNull Function zipper) { + public static <@NonNull T, @NonNull R> Flowable zip(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function zipper) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableZip<>(null, sources, zipper, bufferSize(), false)); @@ -5072,7 +5072,7 @@ public static Flowable zip(@NonNull Iterable<@NonNull ? extends Publis @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ? extends T>> sources, + public static <@NonNull T, @NonNull R> Flowable zip(@NonNull Iterable<@NonNull ? extends Publisher> sources, @NonNull Function zipper, boolean delayError, int bufferSize) { Objects.requireNonNull(zipper, "zipper is null"); @@ -5134,8 +5134,8 @@ public static Flowable zip(@NonNull Iterable<@NonNull ? extends Publis @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, + public static <@NonNull T1, @NonNull T2, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiFunction zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5197,8 +5197,8 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, + public static <@NonNull T1, @NonNull T2, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiFunction zipper, boolean delayError) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5262,8 +5262,8 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, + public static <@NonNull T1, @NonNull T2, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull BiFunction zipper, boolean delayError, int bufferSize) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5328,8 +5328,8 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, @NonNull Function3 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5399,9 +5399,9 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Function4 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5475,9 +5475,9 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, @NonNull Publisher<@NonNull ? extends T5> source5, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Publisher source5, @NonNull Function5 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5555,9 +5555,9 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Publisher source5, @NonNull Publisher source6, @NonNull Function6 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5639,10 +5639,10 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Function7 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5728,10 +5728,10 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, @NonNull Publisher<@NonNull ? extends T8> source8, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Publisher source8, @NonNull Function8 zipper) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -5822,10 +5822,10 @@ public static Flowable zip( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable zip( - @NonNull Publisher<@NonNull ? extends T1> source1, @NonNull Publisher<@NonNull ? extends T2> source2, @NonNull Publisher<@NonNull ? extends T3> source3, - @NonNull Publisher<@NonNull ? extends T4> source4, @NonNull Publisher<@NonNull ? extends T5> source5, @NonNull Publisher<@NonNull ? extends T6> source6, - @NonNull Publisher<@NonNull ? extends T7> source7, @NonNull Publisher<@NonNull ? extends T8> source8, @NonNull Publisher<@NonNull ? extends T9> source9, + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Flowable zip( + @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, + @NonNull Publisher source4, @NonNull Publisher source5, @NonNull Publisher source6, + @NonNull Publisher source7, @NonNull Publisher source8, @NonNull Publisher source9, @NonNull Function9 zipper) { Objects.requireNonNull(source1, "source1 is null"); @@ -5897,8 +5897,8 @@ public static Flowable zip( @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable zipArray(@NonNull Function zipper, - boolean delayError, int bufferSize, @NonNull Publisher<@NonNull ? extends T>... sources) { + public static <@NonNull T, @NonNull R> Flowable zipArray(@NonNull Function zipper, + boolean delayError, int bufferSize, @NonNull Publisher... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -5973,7 +5973,7 @@ public final Single all(@NonNull Predicate predicate) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable ambWith(@NonNull Publisher<@NonNull ? extends T> other) { + public final Flowable ambWith(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return ambArray(this, other); } @@ -6681,7 +6681,7 @@ public final void blockingSubscribe(@NonNull Consumer onNext, @NonNul */ @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public final void blockingSubscribe(@NonNull Subscriber<@NonNull ? super T> subscriber) { + public final void blockingSubscribe(@NonNull Subscriber subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); FlowableBlockingSubscribe.subscribe(this, subscriber); } @@ -6788,7 +6788,7 @@ public final Flowable> buffer(int count, int skip) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final > Flowable buffer(int count, int skip, @NonNull Supplier bufferSupplier) { + public final <@NonNull U extends Collection> Flowable buffer(int count, int skip, @NonNull Supplier bufferSupplier) { ObjectHelper.verifyPositive(count, "count"); ObjectHelper.verifyPositive(skip, "skip"); Objects.requireNonNull(bufferSupplier, "bufferSupplier is null"); @@ -6827,7 +6827,7 @@ public final > Flowable buffer(int count, int @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Flowable buffer(int count, @NonNull Supplier bufferSupplier) { + public final <@NonNull U extends Collection> Flowable buffer(int count, @NonNull Supplier bufferSupplier) { return buffer(count, count, bufferSupplier); } @@ -6942,7 +6942,7 @@ public final Flowable> buffer(long timespan, long timeskip, @NonNull Tim @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final > Flowable buffer(long timespan, long timeskip, @NonNull TimeUnit unit, + public final <@NonNull U extends Collection> Flowable buffer(long timespan, long timeskip, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Supplier bufferSupplier) { Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -7103,7 +7103,7 @@ public final Flowable> buffer(long timespan, @NonNull TimeUnit unit, @No @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull - public final > Flowable buffer( + public final <@NonNull U extends Collection> Flowable buffer( long timespan, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, int count, @NonNull Supplier bufferSupplier, @@ -7182,9 +7182,9 @@ public final Flowable> buffer(long timespan, @NonNull TimeUnit unit, @No @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> buffer( - @NonNull Publisher<@NonNull ? extends TOpening> openingIndicator, - @NonNull Function> closingIndicator) { + public final <@NonNull TOpening, @NonNull TClosing> Flowable> buffer( + @NonNull Publisher openingIndicator, + @NonNull Function> closingIndicator) { return buffer(openingIndicator, closingIndicator, ArrayListSupplier.asSupplier()); } @@ -7223,9 +7223,9 @@ public final Flowable> buffer( @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Flowable buffer( - @NonNull Publisher<@NonNull ? extends TOpening> openingIndicator, - @NonNull Function> closingIndicator, + public final <@NonNull TOpening, @NonNull TClosing, @NonNull U extends Collection> Flowable buffer( + @NonNull Publisher openingIndicator, + @NonNull Function> closingIndicator, @NonNull Supplier bufferSupplier) { Objects.requireNonNull(openingIndicator, "openingIndicator is null"); Objects.requireNonNull(closingIndicator, "closingIndicator is null"); @@ -7264,7 +7264,7 @@ public final > Flowable b @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> buffer(@NonNull Publisher boundaryIndicator) { + public final <@NonNull B> Flowable> buffer(@NonNull Publisher boundaryIndicator) { return buffer(boundaryIndicator, ArrayListSupplier.asSupplier()); } @@ -7302,7 +7302,7 @@ public final Flowable> buffer(@NonNull Publisher boundaryIndicato @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> buffer(@NonNull Publisher boundaryIndicator, int initialCapacity) { + public final <@NonNull B> Flowable> buffer(@NonNull Publisher boundaryIndicator, int initialCapacity) { ObjectHelper.verifyPositive(initialCapacity, "initialCapacity"); return buffer(boundaryIndicator, Functions.createArrayList(initialCapacity)); } @@ -7342,7 +7342,7 @@ public final Flowable> buffer(@NonNull Publisher boundaryIndicato @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Flowable buffer(@NonNull Publisher boundaryIndicator, @NonNull Supplier bufferSupplier) { + public final <@NonNull B, @NonNull U extends Collection> Flowable buffer(@NonNull Publisher boundaryIndicator, @NonNull Supplier bufferSupplier) { Objects.requireNonNull(boundaryIndicator, "boundaryIndicator is null"); Objects.requireNonNull(bufferSupplier, "bufferSupplier is null"); return RxJavaPlugins.onAssembly(new FlowableBufferExactBoundary<>(this, boundaryIndicator, bufferSupplier)); @@ -7499,7 +7499,7 @@ public final Flowable cacheWithInitialCapacity(int initialCapacity) { @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable cast(@NonNull Class clazz) { + public final <@NonNull U> Flowable cast(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return map(Functions.castFunction(clazz)); } @@ -7538,7 +7538,7 @@ public final Flowable cast(@NonNull Class clazz) { @NonNull @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) - public final Single collect(@NonNull Supplier initialItemSupplier, @NonNull BiConsumer collector) { + public final <@NonNull U> Single collect(@NonNull Supplier initialItemSupplier, @NonNull BiConsumer collector) { Objects.requireNonNull(initialItemSupplier, "initialItemSupplier is null"); Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new FlowableCollectSingle<>(this, initialItemSupplier, collector)); @@ -7610,7 +7610,7 @@ public final Single collect(@NonNull Supplier initialItemSup @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable compose(@NonNull FlowableTransformer composer) { + public final <@NonNull R> Flowable compose(@NonNull FlowableTransformer composer) { return fromPublisher(((FlowableTransformer) Objects.requireNonNull(composer, "composer is null")).apply(this)); } @@ -7647,7 +7647,7 @@ public final Flowable compose(@NonNull FlowableTransformer Flowable concatMap(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMap(@NonNull Function> mapper) { return concatMap(mapper, 2); } @@ -7688,7 +7688,7 @@ public final Flowable concatMap(@NonNull Function Flowable concatMap(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> Flowable concatMap(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); if (this instanceof ScalarSupplier) { @@ -7742,7 +7742,7 @@ public final Flowable concatMap(@NonNull Function Flowable concatMap(@NonNull Function> mapper, int prefetch, @NonNull Scheduler scheduler) { + public final <@NonNull R> Flowable concatMap(@NonNull Function> mapper, int prefetch, @NonNull Scheduler scheduler) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -7953,7 +7953,7 @@ public final Completable concatMapCompletableDelayError(@NonNull Function Flowable concatMapDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapDelayError(@NonNull Function> mapper) { return concatMapDelayError(mapper, true, 2); } @@ -7994,7 +7994,7 @@ public final Flowable concatMapDelayError(@NonNull Function Flowable concatMapDelayError(@NonNull Function> mapper, + public final <@NonNull R> Flowable concatMapDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -8048,7 +8048,7 @@ public final Flowable concatMapDelayError(@NonNull Function Flowable concatMapDelayError(@NonNull Function> mapper, + public final <@NonNull R> Flowable concatMapDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch, @NonNull Scheduler scheduler) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -8081,7 +8081,7 @@ public final Flowable concatMapDelayError(@NonNull Function Flowable concatMapEager(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapEager(@NonNull Function> mapper) { return concatMapEager(mapper, bufferSize(), bufferSize()); } @@ -8113,7 +8113,7 @@ public final Flowable concatMapEager(@NonNull Function Flowable concatMapEager(@NonNull Function> mapper, + public final <@NonNull R> Flowable concatMapEager(@NonNull Function> mapper, int maxConcurrency, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -8149,7 +8149,7 @@ public final Flowable concatMapEager(@NonNull Function Flowable concatMapEagerDelayError(@NonNull Function> mapper, + public final <@NonNull R> Flowable concatMapEagerDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapEagerDelayError(mapper, tillTheEnd, bufferSize(), bufferSize()); } @@ -8187,7 +8187,7 @@ public final Flowable concatMapEagerDelayError(@NonNull Function Flowable concatMapEagerDelayError(@NonNull Function> mapper, + public final <@NonNull R> Flowable concatMapEagerDelayError(@NonNull Function> mapper, boolean tillTheEnd, int maxConcurrency, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -8221,7 +8221,7 @@ public final Flowable concatMapEagerDelayError(@NonNull Function Flowable concatMapIterable(@NonNull Function> mapper) { + public final <@NonNull U> Flowable concatMapIterable(@NonNull Function> mapper) { return concatMapIterable(mapper, 2); } @@ -8254,7 +8254,7 @@ public final Flowable concatMapIterable(@NonNull Function Flowable concatMapIterable(@NonNull Function> mapper, int prefetch) { + public final <@NonNull U> Flowable concatMapIterable(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableFlattenIterable<>(this, mapper, prefetch)); @@ -8289,7 +8289,7 @@ public final Flowable concatMapIterable(@NonNull Function Flowable concatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapMaybe(@NonNull Function> mapper) { return concatMapMaybe(mapper, 2); } @@ -8327,7 +8327,7 @@ public final Flowable concatMapMaybe(@NonNull Function Flowable concatMapMaybe(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> Flowable concatMapMaybe(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapMaybe<>(this, mapper, ErrorMode.IMMEDIATE, prefetch)); @@ -8362,7 +8362,7 @@ public final Flowable concatMapMaybe(@NonNull Function Flowable concatMapMaybeDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapMaybeDelayError(@NonNull Function> mapper) { return concatMapMaybeDelayError(mapper, true, 2); } @@ -8401,7 +8401,7 @@ public final Flowable concatMapMaybeDelayError(@NonNull Function Flowable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd) { + public final <@NonNull R> Flowable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapMaybeDelayError(mapper, tillTheEnd, 2); } @@ -8444,7 +8444,7 @@ public final Flowable concatMapMaybeDelayError(@NonNull Function Flowable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch) { + public final <@NonNull R> Flowable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapMaybe<>(this, mapper, tillTheEnd ? ErrorMode.END : ErrorMode.BOUNDARY, prefetch)); @@ -8479,7 +8479,7 @@ public final Flowable concatMapMaybeDelayError(@NonNull Function Flowable concatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapSingle(@NonNull Function> mapper) { return concatMapSingle(mapper, 2); } @@ -8517,7 +8517,7 @@ public final Flowable concatMapSingle(@NonNull Function Flowable concatMapSingle(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> Flowable concatMapSingle(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapSingle<>(this, mapper, ErrorMode.IMMEDIATE, prefetch)); @@ -8552,7 +8552,7 @@ public final Flowable concatMapSingle(@NonNull Function Flowable concatMapSingleDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapSingleDelayError(@NonNull Function> mapper) { return concatMapSingleDelayError(mapper, true, 2); } @@ -8591,7 +8591,7 @@ public final Flowable concatMapSingleDelayError(@NonNull Function Flowable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd) { + public final <@NonNull R> Flowable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapSingleDelayError(mapper, tillTheEnd, 2); } @@ -8634,7 +8634,7 @@ public final Flowable concatMapSingleDelayError(@NonNull Function Flowable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch) { + public final <@NonNull R> Flowable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapSingle<>(this, mapper, tillTheEnd ? ErrorMode.END : ErrorMode.BOUNDARY, prefetch)); @@ -8664,7 +8664,7 @@ public final Flowable concatMapSingleDelayError(@NonNull Function concatWith(@NonNull Publisher<@NonNull ? extends T> other) { + public final Flowable concatWith(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return concat(this, other); } @@ -8838,7 +8838,7 @@ public final Single count() { @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable debounce(@NonNull Function> debounceIndicator) { + public final <@NonNull U> Flowable debounce(@NonNull Function> debounceIndicator) { Objects.requireNonNull(debounceIndicator, "debounceIndicator is null"); return RxJavaPlugins.onAssembly(new FlowableDebounce<>(this, debounceIndicator)); } @@ -8994,7 +8994,7 @@ public final Flowable defaultIfEmpty(@NonNull T defaultItem) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable delay(@NonNull Function> itemDelayIndicator) { + public final <@NonNull U> Flowable delay(@NonNull Function> itemDelayIndicator) { Objects.requireNonNull(itemDelayIndicator, "itemDelayIndicator is null"); return flatMap(FlowableInternalHelper.itemDelay(itemDelayIndicator)); } @@ -9160,8 +9160,8 @@ public final Flowable delay(long time, @NonNull TimeUnit unit, @NonNull Sched @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable delay(@NonNull Publisher subscriptionIndicator, - @NonNull Function> itemDelayIndicator) { + public final <@NonNull U, @NonNull V> Flowable delay(@NonNull Publisher subscriptionIndicator, + @NonNull Function> itemDelayIndicator) { return delaySubscription(subscriptionIndicator).delay(itemDelayIndicator); } @@ -9187,7 +9187,7 @@ public final Flowable delay(@NonNull Publisher subscriptionIndicato @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable delaySubscription(@NonNull Publisher subscriptionIndicator) { + public final <@NonNull U> Flowable delaySubscription(@NonNull Publisher subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new FlowableDelaySubscriptionOther<>(this, subscriptionIndicator)); } @@ -9303,7 +9303,7 @@ public final Flowable delaySubscription(long time, @NonNull TimeUnit unit, @N @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.PASS_THROUGH) - public final Flowable dematerialize(@NonNull Function<@NonNull ? super T, @NonNull Notification> selector) { + public final <@NonNull R> Flowable dematerialize(@NonNull Function<@NonNull ? super T, @NonNull Notification> selector) { Objects.requireNonNull(selector, "selector is null"); return RxJavaPlugins.onAssembly(new FlowableDematerialize<>(this, selector)); } @@ -9390,7 +9390,7 @@ public final Flowable distinct() { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable distinct(@NonNull Function keySelector) { + public final <@NonNull K> Flowable distinct(@NonNull Function keySelector) { return distinct(keySelector, Functions.createHashSet()); } @@ -9426,7 +9426,7 @@ public final Flowable distinct(@NonNull Function keySelecto @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable distinct(@NonNull Function keySelector, + public final <@NonNull K> Flowable distinct(@NonNull Function keySelector, @NonNull Supplier> collectionSupplier) { Objects.requireNonNull(keySelector, "keySelector is null"); Objects.requireNonNull(collectionSupplier, "collectionSupplier is null"); @@ -9517,7 +9517,7 @@ public final Flowable distinctUntilChanged() { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable distinctUntilChanged(@NonNull Function keySelector) { + public final <@NonNull K> Flowable distinctUntilChanged(@NonNull Function keySelector) { Objects.requireNonNull(keySelector, "keySelector is null"); return RxJavaPlugins.onAssembly(new FlowableDistinctUntilChanged<>(this, keySelector, ObjectHelper.equalsPredicate())); } @@ -9806,7 +9806,7 @@ public final Flowable doOnEach(@NonNull Consumer<@NonNull ? super Notificatio @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable doOnEach(@NonNull Subscriber<@NonNull ? super T> subscriber) { + public final Flowable doOnEach(@NonNull Subscriber subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); return doOnEach( FlowableInternalHelper.subscriberOnNext(subscriber), @@ -10221,7 +10221,7 @@ public final Single firstOrError() { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable flatMap(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMap(@NonNull Function> mapper) { return flatMap(mapper, false, bufferSize(), bufferSize()); } @@ -10256,7 +10256,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, boolean delayErrors) { + public final <@NonNull R> Flowable flatMap(@NonNull Function> mapper, boolean delayErrors) { return flatMap(mapper, delayErrors, bufferSize(), bufferSize()); } @@ -10293,7 +10293,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, int maxConcurrency) { + public final <@NonNull R> Flowable flatMap(@NonNull Function> mapper, int maxConcurrency) { return flatMap(mapper, false, maxConcurrency, bufferSize()); } @@ -10333,7 +10333,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { + public final <@NonNull R> Flowable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { return flatMap(mapper, delayErrors, maxConcurrency, bufferSize()); } @@ -10375,7 +10375,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull R> Flowable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -10424,10 +10424,10 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap( - @NonNull Function> onNextMapper, - @NonNull Function> onErrorMapper, - @NonNull Supplier> onCompleteSupplier) { + public final <@NonNull R> Flowable flatMap( + @NonNull Function> onNextMapper, + @NonNull Function> onErrorMapper, + @NonNull Supplier> onCompleteSupplier) { Objects.requireNonNull(onNextMapper, "onNextMapper is null"); Objects.requireNonNull(onErrorMapper, "onErrorMapper is null"); Objects.requireNonNull(onCompleteSupplier, "onCompleteSupplier is null"); @@ -10472,10 +10472,10 @@ public final Flowable flatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable flatMap( - @NonNull Function> onNextMapper, - @NonNull Function> onErrorMapper, - @NonNull Supplier> onCompleteSupplier, + public final <@NonNull R> Flowable flatMap( + @NonNull Function> onNextMapper, + @NonNull Function> onErrorMapper, + @NonNull Supplier> onCompleteSupplier, int maxConcurrency) { Objects.requireNonNull(onNextMapper, "onNextMapper is null"); Objects.requireNonNull(onErrorMapper, "onErrorMapper is null"); @@ -10516,7 +10516,7 @@ public final Flowable flatMap( @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Flowable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner) { return flatMap(mapper, combiner, false, bufferSize(), bufferSize()); } @@ -10556,7 +10556,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Flowable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors) { return flatMap(mapper, combiner, delayErrors, bufferSize(), bufferSize()); } @@ -10601,7 +10601,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Flowable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors, int maxConcurrency) { return flatMap(mapper, combiner, delayErrors, maxConcurrency, bufferSize()); } @@ -10648,7 +10648,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Flowable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -10694,7 +10694,7 @@ public final Flowable flatMap(@NonNull Function Flowable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Flowable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, int maxConcurrency) { return flatMap(mapper, combiner, false, maxConcurrency, bufferSize()); } @@ -10776,7 +10776,7 @@ public final Completable flatMapCompletable(@NonNull Function Flowable flatMapIterable(@NonNull Function> mapper) { + public final <@NonNull U> Flowable flatMapIterable(@NonNull Function> mapper) { return flatMapIterable(mapper, bufferSize()); } @@ -10810,7 +10810,7 @@ public final Flowable flatMapIterable(@NonNull Function Flowable flatMapIterable(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull U> Flowable flatMapIterable(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new FlowableFlattenIterable<>(this, mapper, bufferSize)); @@ -10849,7 +10849,7 @@ public final Flowable flatMapIterable(@NonNull Function Flowable flatMapIterable(@NonNull Function> mapper, + public final <@NonNull U, @NonNull V> Flowable flatMapIterable(@NonNull Function> mapper, @NonNull BiFunction combiner) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -10894,7 +10894,7 @@ public final Flowable flatMapIterable(@NonNull Function Flowable flatMapIterable(@NonNull Function> mapper, + public final <@NonNull U, @NonNull V> Flowable flatMapIterable(@NonNull Function> mapper, @NonNull BiFunction combiner, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -10919,7 +10919,7 @@ public final Flowable flatMapIterable(@NonNull Function Flowable flatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMapMaybe(@NonNull Function> mapper) { return flatMapMaybe(mapper, false, Integer.MAX_VALUE); } @@ -10948,7 +10948,7 @@ public final Flowable flatMapMaybe(@NonNull Function Flowable flatMapMaybe(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { + public final <@NonNull R> Flowable flatMapMaybe(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new FlowableFlatMapMaybe<>(this, mapper, delayErrors, maxConcurrency)); @@ -10972,7 +10972,7 @@ public final Flowable flatMapMaybe(@NonNull Function Flowable flatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMapSingle(@NonNull Function> mapper) { return flatMapSingle(mapper, false, Integer.MAX_VALUE); } @@ -11001,7 +11001,7 @@ public final Flowable flatMapSingle(@NonNull Function Flowable flatMapSingle(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { + public final <@NonNull R> Flowable flatMapSingle(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new FlowableFlatMapSingle<>(this, mapper, delayErrors, maxConcurrency)); @@ -11187,7 +11187,7 @@ public final Disposable forEachWhile(@NonNull Predicate onNext, @NonN @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> groupBy(@NonNull Function keySelector) { + public final <@NonNull K> Flowable> groupBy(@NonNull Function keySelector) { return groupBy(keySelector, Functions.identity(), false, bufferSize()); } @@ -11246,7 +11246,7 @@ public final Flowable> groupBy(@NonNull Function Flowable> groupBy(@NonNull Function keySelector, boolean delayError) { + public final <@NonNull K> Flowable> groupBy(@NonNull Function keySelector, boolean delayError) { return groupBy(keySelector, Functions.identity(), delayError, bufferSize()); } @@ -11309,7 +11309,7 @@ public final Flowable> groupBy(@NonNull Function Flowable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Flowable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector) { return groupBy(keySelector, valueSelector, false, bufferSize()); } @@ -11374,7 +11374,7 @@ public final Flowable> groupBy(@NonNull Function Flowable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Flowable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector, boolean delayError) { return groupBy(keySelector, valueSelector, delayError, bufferSize()); } @@ -11441,7 +11441,7 @@ public final Flowable> groupBy(@NonNull Function Flowable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Flowable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector, boolean delayError, int bufferSize) { Objects.requireNonNull(keySelector, "keySelector is null"); @@ -11562,7 +11562,7 @@ public final Flowable> groupBy(@NonNull Function Flowable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Flowable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector, boolean delayError, int bufferSize, @NonNull Function, ? extends Map> evictingMapFactory) { @@ -11612,10 +11612,10 @@ public final Flowable> groupBy(@NonNull Function Flowable groupJoin( - @NonNull Publisher<@NonNull ? extends TRight> other, - @NonNull Function> leftEnd, - @NonNull Function> rightEnd, + public final <@NonNull TRight, @NonNull TLeftEnd, @NonNull TRightEnd, @NonNull R> Flowable groupJoin( + @NonNull Publisher other, + @NonNull Function> leftEnd, + @NonNull Function> rightEnd, @NonNull BiFunction, ? extends R> resultSelector) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(leftEnd, "leftEnd is null"); @@ -11736,10 +11736,10 @@ public final Single isEmpty() { @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable join( - @NonNull Publisher<@NonNull ? extends TRight> other, - @NonNull Function> leftEnd, - @NonNull Function> rightEnd, + public final <@NonNull TRight, @NonNull TLeftEnd, @NonNull TRightEnd, @NonNull R> Flowable join( + @NonNull Publisher other, + @NonNull Function> leftEnd, + @NonNull Function> rightEnd, @NonNull BiFunction resultSelector) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(leftEnd, "leftEnd is null"); @@ -11976,7 +11976,7 @@ public final Single lastOrError() { @NonNull @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable lift(@NonNull FlowableOperator lifter) { + public final <@NonNull R> Flowable lift(@NonNull FlowableOperator lifter) { Objects.requireNonNull(lifter, "lifter is null"); return RxJavaPlugins.onAssembly(new FlowableLift<>(this, lifter)); } @@ -12061,7 +12061,7 @@ public final Flowable> materialize() { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable mergeWith(@NonNull Publisher<@NonNull ? extends T> other) { + public final Flowable mergeWith(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return merge(this, other); } @@ -12334,7 +12334,7 @@ public final Flowable observeOn(@NonNull Scheduler scheduler, boolean delayEr @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable ofType(@NonNull Class clazz) { + public final <@NonNull U> Flowable ofType(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return filter(Functions.isInstanceOf(clazz)).cast(clazz); } @@ -12781,7 +12781,7 @@ public final Flowable onBackpressureReduce(@NonNull BiFunction reduc @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable onBackpressureReduce(@NonNull Supplier supplier, @NonNull BiFunction reducer) { + public final <@NonNull R> Flowable onBackpressureReduce(@NonNull Supplier supplier, @NonNull BiFunction reducer) { Objects.requireNonNull(supplier, "supplier is null"); Objects.requireNonNull(reducer, "reducer is null"); return RxJavaPlugins.onAssembly(new FlowableOnBackpressureReduceWith<>(this, supplier, reducer)); @@ -12878,7 +12878,7 @@ public final Flowable onErrorComplete(@NonNull Predicate p @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable onErrorResumeNext(@NonNull Function> fallbackSupplier) { + public final Flowable onErrorResumeNext(@NonNull Function> fallbackSupplier) { Objects.requireNonNull(fallbackSupplier, "fallbackSupplier is null"); return RxJavaPlugins.onAssembly(new FlowableOnErrorNext<>(this, fallbackSupplier)); } @@ -12923,7 +12923,7 @@ public final Flowable onErrorResumeNext(@NonNull Function onErrorResumeWith(@NonNull Publisher<@NonNull ? extends T> fallback) { + public final Flowable onErrorResumeWith(@NonNull Publisher fallback) { Objects.requireNonNull(fallback, "fallback is null"); return onErrorResumeNext(Functions.justFunction(fallback)); } @@ -13183,7 +13183,7 @@ public final ConnectableFlowable publish() { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable publish(@NonNull Function, ? extends Publisher> selector) { + public final <@NonNull R> Flowable publish(@NonNull Function, @NonNull ? extends Publisher> selector) { return publish(selector, bufferSize()); } @@ -13220,7 +13220,7 @@ public final Flowable publish(@NonNull Function, ? ex @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable publish(@NonNull Function, ? extends Publisher<@NonNull ? extends R>> selector, int prefetch) { + public final <@NonNull R> Flowable publish(@NonNull Function, @NonNull ? extends Publisher> selector, int prefetch) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowablePublishMulticast<>(this, selector, prefetch, false)); @@ -13546,7 +13546,7 @@ public final Flowable repeatUntil(@NonNull BooleanSupplier stop) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable repeatWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Flowable repeatWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { Objects.requireNonNull(handler, "handler is null"); return RxJavaPlugins.onAssembly(new FlowableRepeatWhen<>(this, handler)); } @@ -13605,7 +13605,7 @@ public final ConnectableFlowable replay() { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector) { Objects.requireNonNull(selector, "selector is null"); return FlowableReplay.multicastSelector(FlowableInternalHelper.replaySupplier(this), selector); } @@ -13645,7 +13645,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, int bufferSize) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, int bufferSize) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return FlowableReplay.multicastSelector(FlowableInternalHelper.replaySupplier(this, bufferSize, false), selector); @@ -13688,7 +13688,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, int bufferSize, boolean eagerTruncate) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, int bufferSize, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return FlowableReplay.multicastSelector(FlowableInternalHelper.replaySupplier(this, bufferSize, eagerTruncate), selector); @@ -13732,7 +13732,7 @@ public final Flowable replay(@NonNull Function, ? ext @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.COMPUTATION) @NonNull - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit) { return replay(selector, bufferSize, time, unit, Schedulers.computation()); } @@ -13778,7 +13778,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); @@ -13831,7 +13831,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); @@ -13872,7 +13872,7 @@ public final Flowable replay(@NonNull Function, ? ext @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.COMPUTATION) @NonNull - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, long time, @NonNull TimeUnit unit) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, long time, @NonNull TimeUnit unit) { return replay(selector, time, unit, Schedulers.computation()); } @@ -13911,7 +13911,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -13955,7 +13955,7 @@ public final Flowable replay(@NonNull Function, ? ext @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Flowable replay(@NonNull Function, ? extends Publisher> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { + public final <@NonNull R> Flowable replay(@NonNull Function, @NonNull ? extends Publisher> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -14544,7 +14544,7 @@ public final Flowable retryUntil(@NonNull BooleanSupplier stop) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable retryWhen( - @NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + @NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { Objects.requireNonNull(handler, "handler is null"); return RxJavaPlugins.onAssembly(new FlowableRetryWhen<>(this, handler)); @@ -14566,10 +14566,10 @@ public final Flowable retryWhen( */ @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final void safeSubscribe(@NonNull Subscriber<@NonNull ? super T> subscriber) { + public final void safeSubscribe(@NonNull Subscriber subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); if (subscriber instanceof SafeSubscriber) { - subscribe((SafeSubscriber<@NonNull ? super T>)subscriber); + subscribe((SafeSubscriber)subscriber); } else { subscribe(new SafeSubscriber<>(subscriber)); } @@ -14742,7 +14742,7 @@ public final Flowable sample(long period, @NonNull TimeUnit unit, @NonNull Sc @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable sample(@NonNull Publisher sampler) { + public final <@NonNull U> Flowable sample(@NonNull Publisher sampler) { Objects.requireNonNull(sampler, "sampler is null"); return RxJavaPlugins.onAssembly(new FlowableSamplePublisher<>(this, sampler, false)); } @@ -14780,7 +14780,7 @@ public final Flowable sample(@NonNull Publisher sampler) { @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable sample(@NonNull Publisher sampler, boolean emitLast) { + public final <@NonNull U> Flowable sample(@NonNull Publisher sampler, boolean emitLast) { Objects.requireNonNull(sampler, "sampler is null"); return RxJavaPlugins.onAssembly(new FlowableSamplePublisher<>(this, sampler, emitLast)); } @@ -15390,7 +15390,7 @@ public final Flowable skipLast(long time, @NonNull TimeUnit unit, @NonNull Sc @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable skipUntil(@NonNull Publisher other) { + public final <@NonNull U> Flowable skipUntil(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new FlowableSkipUntil<>(this, other)); } @@ -15508,7 +15508,7 @@ public final Flowable sorted(@NonNull Comparator<@NonNull ? super T> comparat @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable startWithIterable(@NonNull Iterable<@NonNull ? extends T> items) { + public final Flowable startWithIterable(@NonNull Iterable items) { return concatArray(fromIterable(items), this); } @@ -15611,7 +15611,7 @@ public final Flowable startWith(@NonNull MaybeSource other) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable startWith(@NonNull Publisher<@NonNull ? extends T> other) { + public final Flowable startWith(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return concatArray(other, this); } @@ -15858,9 +15858,9 @@ public final Disposable subscribe( @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) @Override - public final void subscribe(@NonNull Subscriber<@NonNull ? super T> subscriber) { + public final void subscribe(@NonNull Subscriber subscriber) { if (subscriber instanceof FlowableSubscriber) { - subscribe((FlowableSubscriber<@NonNull ? super T>)subscriber); + subscribe((FlowableSubscriber)subscriber); } else { Objects.requireNonNull(subscriber, "subscriber is null"); subscribe(new StrictSubscriber<>(subscriber)); @@ -15907,10 +15907,10 @@ public final void subscribe(@NonNull Subscriber<@NonNull ? super T> subscriber) */ @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public final void subscribe(@NonNull FlowableSubscriber<@NonNull ? super T> subscriber) { + public final void subscribe(@NonNull FlowableSubscriber subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); try { - Subscriber<@NonNull ? super T> flowableSubscriber = RxJavaPlugins.onSubscribe(this, subscriber); + Subscriber flowableSubscriber = RxJavaPlugins.onSubscribe(this, subscriber); Objects.requireNonNull(flowableSubscriber, "The RxJavaPlugins.onSubscribe hook returned a null FlowableSubscriber. Please check the handler provided to RxJavaPlugins.setOnFlowableSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins"); @@ -15937,7 +15937,7 @@ public final void subscribe(@NonNull FlowableSubscriber<@NonNull ? super T> subs * applied by {@link #subscribe(Subscriber)} before this method gets called. * @param subscriber the incoming {@code Subscriber}, never {@code null} */ - protected abstract void subscribeActual(@NonNull Subscriber<@NonNull ? super T> subscriber); + protected abstract void subscribeActual(@NonNull Subscriber subscriber); /** * Subscribes a given {@link Subscriber} (subclass) to this {@code Flowable} and returns the given @@ -15970,7 +15970,7 @@ public final void subscribe(@NonNull FlowableSubscriber<@NonNull ? super T> subs @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull E extends Subscriber<@NonNull ? super T>> E subscribeWith(E subscriber) { + public final <@NonNull E extends Subscriber> E subscribeWith(E subscriber) { subscribe(subscriber); return subscriber; } @@ -16073,7 +16073,7 @@ public final Flowable subscribeOn(@NonNull Scheduler scheduler, boolean reque @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable switchIfEmpty(@NonNull Publisher<@NonNull ? extends T> other) { + public final Flowable switchIfEmpty(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchIfEmpty<>(this, other)); } @@ -16110,7 +16110,7 @@ public final Flowable switchIfEmpty(@NonNull Publisher<@NonNull ? extends T> @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable switchMap(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMap(@NonNull Function> mapper) { return switchMap(mapper, bufferSize()); } @@ -16149,7 +16149,7 @@ public final Flowable switchMap(@NonNull Function Flowable switchMap(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Flowable switchMap(@NonNull Function> mapper, int bufferSize) { return switchMap0(mapper, bufferSize, false); } @@ -16282,7 +16282,7 @@ public final Completable switchMapCompletableDelayError(@NonNull Function Flowable switchMapDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMapDelayError(@NonNull Function> mapper) { return switchMapDelayError(mapper, bufferSize()); } @@ -16323,11 +16323,11 @@ public final Flowable switchMapDelayError(@NonNull Function Flowable switchMapDelayError(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Flowable switchMapDelayError(@NonNull Function> mapper, int bufferSize) { return switchMap0(mapper, bufferSize, true); } - Flowable switchMap0(Function> mapper, int bufferSize, boolean delayError) { + Flowable switchMap0(Function> mapper, int bufferSize, boolean delayError) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarSupplier) { @@ -16378,7 +16378,7 @@ Flowable switchMap0(Function Flowable switchMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMapMaybe(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapMaybe<>(this, mapper, false)); } @@ -16410,7 +16410,7 @@ public final Flowable switchMapMaybe(@NonNull Function Flowable switchMapMaybeDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMapMaybeDelayError(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapMaybe<>(this, mapper, true)); } @@ -16452,7 +16452,7 @@ public final Flowable switchMapMaybeDelayError(@NonNull Function Flowable switchMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMapSingle(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapSingle<>(this, mapper, false)); } @@ -16484,7 +16484,7 @@ public final Flowable switchMapSingle(@NonNull Function Flowable switchMapSingleDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Flowable switchMapSingleDelayError(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapSingle<>(this, mapper, true)); } @@ -16996,7 +16996,7 @@ public final Flowable takeUntil(@NonNull Predicate stopPredicate) @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable takeUntil(@NonNull Publisher other) { + public final <@NonNull U> Flowable takeUntil(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new FlowableTakeUntil<>(this, other)); } @@ -17548,7 +17548,7 @@ public final Flowable> timeInterval(@NonNull TimeUnit unit, @NonNull Sc @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable timeout(@NonNull Function> itemTimeoutIndicator) { + public final <@NonNull V> Flowable timeout(@NonNull Function> itemTimeoutIndicator) { return timeout0(null, itemTimeoutIndicator, null); } @@ -17586,7 +17586,7 @@ public final Flowable timeout(@NonNull Function Flowable timeout(@NonNull Function> itemTimeoutIndicator, @NonNull Publisher<@NonNull ? extends T> fallback) { + public final <@NonNull V> Flowable timeout(@NonNull Function> itemTimeoutIndicator, @NonNull Publisher fallback) { Objects.requireNonNull(fallback, "fallback is null"); return timeout0(null, itemTimeoutIndicator, fallback); } @@ -17651,7 +17651,7 @@ public final Flowable timeout(long timeout, @NonNull TimeUnit unit) { @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.COMPUTATION) - public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Publisher<@NonNull ? extends T> fallback) { + public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Publisher fallback) { Objects.requireNonNull(fallback, "fallback is null"); return timeout0(timeout, unit, fallback, Schedulers.computation()); } @@ -17689,7 +17689,7 @@ public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) - public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Publisher<@NonNull ? extends T> fallback) { + public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, @NonNull Publisher fallback) { Objects.requireNonNull(fallback, "fallback is null"); return timeout0(timeout, unit, fallback, scheduler); } @@ -17761,8 +17761,8 @@ public final Flowable timeout(long timeout, @NonNull TimeUnit unit, @NonNull @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable timeout(@NonNull Publisher firstTimeoutIndicator, - @NonNull Function> itemTimeoutIndicator) { + public final <@NonNull U, @NonNull V> Flowable timeout(@NonNull Publisher firstTimeoutIndicator, + @NonNull Function> itemTimeoutIndicator) { Objects.requireNonNull(firstTimeoutIndicator, "firstTimeoutIndicator is null"); return timeout0(firstTimeoutIndicator, itemTimeoutIndicator, null); } @@ -17804,26 +17804,26 @@ public final Flowable timeout(@NonNull Publisher firstTimeoutIndica @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable timeout( + public final <@NonNull U, @NonNull V> Flowable timeout( @NonNull Publisher firstTimeoutIndicator, - @NonNull Function> itemTimeoutIndicator, - @NonNull Publisher<@NonNull ? extends T> fallback) { + @NonNull Function> itemTimeoutIndicator, + @NonNull Publisher fallback) { Objects.requireNonNull(firstTimeoutIndicator, "firstTimeoutIndicator is null"); Objects.requireNonNull(fallback, "fallback is null"); return timeout0(firstTimeoutIndicator, itemTimeoutIndicator, fallback); } - private Flowable timeout0(long timeout, TimeUnit unit, Publisher<@NonNull ? extends T> fallback, + private Flowable timeout0(long timeout, TimeUnit unit, Publisher fallback, Scheduler scheduler) { Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); return RxJavaPlugins.onAssembly(new FlowableTimeoutTimed<>(this, timeout, unit, scheduler, fallback)); } - private Flowable timeout0( + private <@NonNull U, @NonNull V> Flowable timeout0( Publisher firstTimeoutIndicator, - Function> itemTimeoutIndicator, - Publisher<@NonNull ? extends T> fallback) { + Function> itemTimeoutIndicator, + Publisher fallback) { Objects.requireNonNull(itemTimeoutIndicator, "itemTimeoutIndicator is null"); return RxJavaPlugins.onAssembly(new FlowableTimeout<>(this, firstTimeoutIndicator, itemTimeoutIndicator, fallback)); } @@ -17959,7 +17959,7 @@ public final Flowable> timestamp(@NonNull TimeUnit unit, @NonNull Sched @CheckReturnValue @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public final R to(@NonNull FlowableConverter converter) { + public final <@NonNull R> R to(@NonNull FlowableConverter converter) { return Objects.requireNonNull(converter, "converter is null").apply(this); } @@ -18069,7 +18069,7 @@ public final Single> toList(int capacityHint) { @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Single toList(@NonNull Supplier collectionSupplier) { + public final <@NonNull U extends Collection> Single toList(@NonNull Supplier collectionSupplier) { Objects.requireNonNull(collectionSupplier, "collectionSupplier is null"); return RxJavaPlugins.onAssembly(new FlowableToListSingle<>(this, collectionSupplier)); } @@ -18104,7 +18104,7 @@ public final > Single toList(@NonNull Supplie @NonNull @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) - public final Single> toMap(@NonNull Function keySelector) { + public final <@NonNull K> Single> toMap(@NonNull Function keySelector) { Objects.requireNonNull(keySelector, "keySelector is null"); return collect(HashMapSupplier.asSupplier(), Functions.toMapKeySelector(keySelector)); } @@ -18143,7 +18143,7 @@ public final Single> toMap(@NonNull Function Single> toMap(@NonNull Function keySelector, @NonNull Function valueSelector) { + public final <@NonNull K, @NonNull V> Single> toMap(@NonNull Function keySelector, @NonNull Function valueSelector) { Objects.requireNonNull(keySelector, "keySelector is null"); Objects.requireNonNull(valueSelector, "valueSelector is null"); return collect(HashMapSupplier.asSupplier(), Functions.toMapKeyValueSelector(keySelector, valueSelector)); @@ -18182,7 +18182,7 @@ public final Single> toMap(@NonNull Function Single> toMap(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Single> toMap(@NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier> mapSupplier) { Objects.requireNonNull(keySelector, "keySelector is null"); @@ -18217,7 +18217,7 @@ public final Single> toMap(@NonNull Function Single>> toMultimap(@NonNull Function keySelector) { + public final <@NonNull K> Single>> toMultimap(@NonNull Function keySelector) { Function valueSelector = Functions.identity(); Supplier>> mapSupplier = HashMapSupplier.asSupplier(); Function> collectionFactory = ArrayListSupplier.asFunction(); @@ -18256,7 +18256,7 @@ public final Single>> toMultimap(@NonNull Function Single>> toMultimap(@NonNull Function keySelector, @NonNull Function valueSelector) { + public final <@NonNull K, @NonNull V> Single>> toMultimap(@NonNull Function keySelector, @NonNull Function valueSelector) { Supplier>> mapSupplier = HashMapSupplier.asSupplier(); Function> collectionFactory = ArrayListSupplier.asFunction(); return toMultimap(keySelector, valueSelector, mapSupplier, collectionFactory); @@ -18298,7 +18298,7 @@ public final Single>> toMultimap(@NonNull Function Single>> toMultimap( + public final <@NonNull K, @NonNull V> Single>> toMultimap( @NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier>> mapSupplier, @@ -18344,7 +18344,7 @@ public final Single>> toMultimap( @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single>> toMultimap( + public final <@NonNull K, @NonNull V> Single>> toMultimap( @NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier>> mapSupplier @@ -19143,7 +19143,7 @@ public final Flowable> window( @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> window(@NonNull Publisher boundaryIndicator) { + public final <@NonNull B> Flowable> window(@NonNull Publisher boundaryIndicator) { return window(boundaryIndicator, bufferSize()); } @@ -19181,7 +19181,7 @@ public final Flowable> window(@NonNull Publisher boundaryIndi @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable> window(@NonNull Publisher boundaryIndicator, int bufferSize) { + public final <@NonNull B> Flowable> window(@NonNull Publisher boundaryIndicator, int bufferSize) { Objects.requireNonNull(boundaryIndicator, "boundaryIndicator is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new FlowableWindowBoundary<>(this, boundaryIndicator, bufferSize)); @@ -19224,9 +19224,9 @@ public final Flowable> window(@NonNull Publisher boundaryIndi @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable> window( + public final <@NonNull U, @NonNull V> Flowable> window( @NonNull Publisher openingIndicator, - @NonNull Function> closingIndicator) { + @NonNull Function> closingIndicator) { return window(openingIndicator, closingIndicator, bufferSize()); } @@ -19270,9 +19270,9 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable> window( + public final <@NonNull U, @NonNull V> Flowable> window( @NonNull Publisher openingIndicator, - @NonNull Function> closingIndicator, int bufferSize) { + @NonNull Function> closingIndicator, int bufferSize) { Objects.requireNonNull(openingIndicator, "openingIndicator is null"); Objects.requireNonNull(closingIndicator, "closingIndicator is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); @@ -19317,7 +19317,7 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable withLatestFrom(@NonNull Publisher<@NonNull ? extends U> other, + public final <@NonNull U, @NonNull R> Flowable withLatestFrom(@NonNull Publisher other, @NonNull BiFunction combiner) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -19358,7 +19358,7 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable withLatestFrom(@NonNull Publisher source1, @NonNull Publisher source2, + public final <@NonNull T1, @NonNull T2, @NonNull R> Flowable withLatestFrom(@NonNull Publisher source1, @NonNull Publisher source2, @NonNull Function3 combiner) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -19402,7 +19402,7 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable withLatestFrom( + public final <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Flowable withLatestFrom( @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, @NonNull Function4 combiner) { @@ -19452,7 +19452,7 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable withLatestFrom( + public final <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Flowable withLatestFrom( @NonNull Publisher source1, @NonNull Publisher source2, @NonNull Publisher source3, @NonNull Publisher source4, @NonNull Function5 combiner) { @@ -19531,7 +19531,7 @@ public final Flowable> window( @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable withLatestFrom(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ?>> others, @NonNull Function combiner) { + public final <@NonNull R> Flowable withLatestFrom(@NonNull Iterable<@NonNull ? extends Publisher<@NonNull ?>> others, @NonNull Function combiner) { Objects.requireNonNull(others, "others is null"); Objects.requireNonNull(combiner, "combiner is null"); return RxJavaPlugins.onAssembly(new FlowableWithLatestFromMany<>(this, others, combiner)); @@ -19571,7 +19571,7 @@ public final Flowable withLatestFrom(@NonNull Iterable<@NonNull ? extends @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final <@NonNull U, R> Flowable zipWith(@NonNull Iterable other, @NonNull BiFunction zipper) { + public final <@NonNull U, @NonNull R> Flowable zipWith(@NonNull Iterable other, @NonNull BiFunction zipper) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(zipper, "zipper is null"); return RxJavaPlugins.onAssembly(new FlowableZipIterable<>(this, other, zipper)); @@ -19620,7 +19620,7 @@ public final Flowable withLatestFrom(@NonNull Iterable<@NonNull ? extends @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final Flowable zipWith(@NonNull Publisher<@NonNull ? extends U> other, @NonNull BiFunction zipper) { + public final <@NonNull U, @NonNull R> Flowable zipWith(@NonNull Publisher other, @NonNull BiFunction zipper) { Objects.requireNonNull(other, "other is null"); return zip(this, other, zipper); } @@ -19671,7 +19671,7 @@ public final Flowable zipWith(@NonNull Publisher<@NonNull ? extends U> @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable zipWith(@NonNull Publisher<@NonNull ? extends U> other, + public final <@NonNull U, @NonNull R> Flowable zipWith(@NonNull Publisher other, @NonNull BiFunction zipper, boolean delayError) { return zip(this, other, zipper, delayError); } @@ -19725,7 +19725,7 @@ public final Flowable zipWith(@NonNull Publisher<@NonNull ? extends U> @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable zipWith(@NonNull Publisher<@NonNull ? extends U> other, + public final <@NonNull U, @NonNull R> Flowable zipWith(@NonNull Publisher other, @NonNull BiFunction zipper, boolean delayError, int bufferSize) { return zip(this, other, zipper, delayError, bufferSize); } @@ -19840,7 +19840,7 @@ public final TestSubscriber test(long initialRequest, boolean cancel) { // No @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable<@NonNull T> fromOptional(@NonNull Optional optional) { + public static <@NonNull T> Flowable<@NonNull T> fromOptional(@NonNull Optional optional) { Objects.requireNonNull(optional, "optional is null"); return optional.map(Flowable::just).orElseGet(Flowable::empty); } @@ -19878,7 +19878,7 @@ public final TestSubscriber test(long initialRequest, boolean cancel) { // No @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { + public static <@NonNull T> Flowable<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { Objects.requireNonNull(stage, "stage is null"); return RxJavaPlugins.onAssembly(new FlowableFromCompletionStage<>(stage)); } @@ -19925,7 +19925,7 @@ public final TestSubscriber test(long initialRequest, boolean cancel) { // No @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable<@NonNull T> fromStream(@NonNull Stream stream) { + public static <@NonNull T> Flowable<@NonNull T> fromStream(@NonNull Stream stream) { Objects.requireNonNull(stream, "stream is null"); return RxJavaPlugins.onAssembly(new FlowableFromStream<>(stream)); } @@ -19986,7 +19986,7 @@ public final TestSubscriber test(long initialRequest, boolean cancel) { // No @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R, A> Single collect(@NonNull Collector collector) { + public final <@NonNull R, @NonNull A> Single collect(@NonNull Collector collector) { Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new FlowableCollectWithCollectorSingle<>(this, collector)); } @@ -20312,7 +20312,7 @@ public final Stream blockingStream(int prefetch) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Flowable concatMapStream(@NonNull Function> mapper) { + public final <@NonNull R> Flowable concatMapStream(@NonNull Function> mapper) { return flatMapStream(mapper, bufferSize()); } @@ -20367,7 +20367,7 @@ public final Stream blockingStream(int prefetch) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Flowable concatMapStream(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> Flowable concatMapStream(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableFlatMapStream<>(this, mapper, prefetch)); @@ -20423,7 +20423,7 @@ public final Stream blockingStream(int prefetch) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Flowable flatMapStream(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMapStream(@NonNull Function> mapper) { return flatMapStream(mapper, bufferSize()); } @@ -20478,7 +20478,7 @@ public final Stream blockingStream(int prefetch) { @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Flowable flatMapStream(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> Flowable flatMapStream(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableFlatMapStream<>(this, mapper, prefetch)); diff --git a/src/main/java/io/reactivex/rxjava3/core/Maybe.java b/src/main/java/io/reactivex/rxjava3/core/Maybe.java index 917a9838a4..bbb3a10d4b 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Maybe.java +++ b/src/main/java/io/reactivex/rxjava3/core/Maybe.java @@ -130,7 +130,7 @@ public abstract class Maybe implements MaybeSource { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe amb(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Maybe amb(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new MaybeAmb<>(null, sources)); } @@ -154,7 +154,7 @@ public static Maybe amb(@NonNull Iterable<@NonNull ? extends MaybeSource< @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Maybe ambArray(@NonNull MaybeSource... sources) { + public static <@NonNull T> Maybe ambArray(@NonNull MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -187,7 +187,7 @@ public static Maybe ambArray(@NonNull MaybeSource... sources @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concat(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new MaybeConcatIterable<>(sources)); } @@ -216,7 +216,7 @@ public static Flowable concat(@NonNull Iterable<@NonNull ? extends MaybeS @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { + public static <@NonNull T> Flowable concat(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return concatArray(source1, source2); @@ -248,7 +248,7 @@ public static Flowable concat(@NonNull MaybeSource source1, @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( + public static <@NonNull T> Flowable concat( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -284,7 +284,7 @@ public static Flowable concat( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( + public static <@NonNull T> Flowable concat( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -315,7 +315,7 @@ public static Flowable concat( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concat(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return concat(sources, 2); } @@ -343,7 +343,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Maybe @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int prefetch) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapMaybePublisher<>(sources, Functions.identity(), ErrorMode.IMMEDIATE, prefetch)); @@ -370,7 +370,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Maybe @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable concatArray(@NonNull MaybeSource... sources) { + public static <@NonNull T> Flowable concatArray(@NonNull MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return Flowable.empty(); @@ -404,7 +404,7 @@ public static Flowable concatArray(@NonNull MaybeSource... s @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable concatArrayDelayError(@NonNull MaybeSource... sources) { + public static <@NonNull T> Flowable concatArrayDelayError(@NonNull MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return Flowable.empty(); @@ -442,7 +442,7 @@ public static Flowable concatArrayDelayError(@NonNull MaybeSource Flowable concatArrayEager(@NonNull MaybeSource... sources) { + public static <@NonNull T> Flowable concatArrayEager(@NonNull MaybeSource... sources) { return Flowable.fromArray(sources).concatMapEager((Function)MaybeToPublisher.instance()); } /** @@ -471,7 +471,7 @@ public static Flowable concatArrayEager(@NonNull MaybeSource @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Flowable concatArrayEagerDelayError(@NonNull MaybeSource... sources) { + public static <@NonNull T> Flowable concatArrayEagerDelayError(@NonNull MaybeSource... sources) { return Flowable.fromArray(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), true); } @@ -497,7 +497,7 @@ public static Flowable concatArrayEagerDelayError(@NonNull MaybeSource Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { return Flowable.fromIterable(sources).concatMapMaybeDelayError(Functions.identity()); } @@ -523,7 +523,7 @@ public static Flowable concatDelayError(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return Flowable.fromPublisher(sources).concatMapMaybeDelayError(Functions.identity()); } /** @@ -554,7 +554,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int prefetch) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int prefetch) { return Flowable.fromPublisher(sources).concatMapMaybeDelayError(Functions.identity(), true, prefetch); } @@ -582,7 +582,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { return Flowable.fromIterable(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), false); } @@ -615,7 +615,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends M @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { return Flowable.fromIterable(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), false, maxConcurrency, 1); } @@ -645,7 +645,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends M @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return Flowable.fromPublisher(sources).concatMapEager((Function)MaybeToPublisher.instance()); } @@ -680,7 +680,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { return Flowable.fromPublisher(sources).concatMapEager((Function)MaybeToPublisher.instance(), maxConcurrency, 1); } @@ -710,7 +710,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { return Flowable.fromIterable(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), true); } @@ -744,7 +744,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { return Flowable.fromIterable(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), true, maxConcurrency, 1); } @@ -776,7 +776,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return Flowable.fromPublisher(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), true); } @@ -812,7 +812,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { return Flowable.fromPublisher(sources).concatMapEagerDelayError((Function)MaybeToPublisher.instance(), true, maxConcurrency, 1); } @@ -866,7 +866,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe create(@NonNull MaybeOnSubscribe onSubscribe) { + public static <@NonNull T> Maybe create(@NonNull MaybeOnSubscribe onSubscribe) { Objects.requireNonNull(onSubscribe, "onSubscribe is null"); return RxJavaPlugins.onAssembly(new MaybeCreate<>(onSubscribe)); } @@ -889,7 +889,7 @@ public static Maybe create(@NonNull MaybeOnSubscribe onSubscribe) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe defer(@NonNull Supplier> supplier) { + public static <@NonNull T> Maybe defer(@NonNull Supplier> supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new MaybeDefer<>(supplier)); } @@ -910,7 +910,7 @@ public static Maybe defer(@NonNull Supplier Maybe empty() { + public static <@NonNull T> Maybe empty() { return RxJavaPlugins.onAssembly((Maybe)MaybeEmpty.INSTANCE); } @@ -935,7 +935,7 @@ public static Maybe empty() { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe error(@NonNull Throwable throwable) { + public static <@NonNull T> Maybe error(@NonNull Throwable throwable) { Objects.requireNonNull(throwable, "throwable is null"); return RxJavaPlugins.onAssembly(new MaybeError<>(throwable)); } @@ -961,7 +961,7 @@ public static Maybe error(@NonNull Throwable throwable) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe error(@NonNull Supplier supplier) { + public static <@NonNull T> Maybe error(@NonNull Supplier supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new MaybeErrorCallable<>(supplier)); } @@ -990,7 +990,7 @@ public static Maybe error(@NonNull Supplier supplier @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe fromAction(@NonNull Action action) { + public static <@NonNull T> Maybe fromAction(@NonNull Action action) { Objects.requireNonNull(action, "action is null"); return RxJavaPlugins.onAssembly(new MaybeFromAction<>(action)); } @@ -1011,7 +1011,7 @@ public static Maybe fromAction(@NonNull Action action) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe fromCompletable(@NonNull CompletableSource completableSource) { + public static <@NonNull T> Maybe fromCompletable(@NonNull CompletableSource completableSource) { Objects.requireNonNull(completableSource, "completableSource is null"); return RxJavaPlugins.onAssembly(new MaybeFromCompletable<>(completableSource)); } @@ -1032,7 +1032,7 @@ public static Maybe fromCompletable(@NonNull CompletableSource completabl @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe fromSingle(@NonNull SingleSource single) { + public static <@NonNull T> Maybe fromSingle(@NonNull SingleSource single) { Objects.requireNonNull(single, "single is null"); return RxJavaPlugins.onAssembly(new MaybeFromSingle<>(single)); } @@ -1175,7 +1175,7 @@ public static Maybe fromSingle(@NonNull SingleSource single) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe fromObservable(@NonNull ObservableSource source) { + public static <@NonNull T> Maybe fromObservable(@NonNull ObservableSource source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new ObservableElementAtMaybe<>(source, 0L)); } @@ -1202,7 +1202,7 @@ public static Maybe fromObservable(@NonNull ObservableSource source) { @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) - public static Maybe fromPublisher(@NonNull Publisher source) { + public static <@NonNull T> Maybe fromPublisher(@NonNull Publisher source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new FlowableElementAtMaybePublisher<>(source, 0L)); } @@ -1237,7 +1237,7 @@ public static Maybe fromPublisher(@NonNull Publisher source) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe fromRunnable(@NonNull Runnable run) { + public static <@NonNull T> Maybe fromRunnable(@NonNull Runnable run) { Objects.requireNonNull(run, "run is null"); return RxJavaPlugins.onAssembly(new MaybeFromRunnable<>(run)); } @@ -1352,7 +1352,7 @@ public static Maybe fromRunnable(@NonNull Runnable run) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable merge(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { return Flowable.fromIterable(sources).flatMapMaybe(Functions.identity(), false, Integer.MAX_VALUE); } @@ -1390,7 +1390,7 @@ public static Flowable merge(@NonNull Iterable<@NonNull ? extends MaybeSo @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return merge(sources, Integer.MAX_VALUE); } @@ -1430,7 +1430,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeS @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new FlowableFlatMapMaybePublisher<>(sources, Functions.identity(), false, maxConcurrency)); @@ -1463,7 +1463,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends MaybeS @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) - public static Maybe merge(@NonNull MaybeSource> source) { + public static <@NonNull T> Maybe merge(@NonNull MaybeSource> source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new MaybeFlatten(source, Functions.identity())); } @@ -1509,7 +1509,7 @@ public static Maybe merge(@NonNull MaybeSource Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull MaybeSource source1, @NonNull MaybeSource source2 ) { Objects.requireNonNull(source1, "source1 is null"); @@ -1560,7 +1560,7 @@ public static Flowable merge( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3 ) { @@ -1615,7 +1615,7 @@ public static Flowable merge( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4 ) { @@ -1661,7 +1661,7 @@ public static Flowable merge( @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable mergeArray(MaybeSource... sources) { + public static <@NonNull T> Flowable mergeArray(MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return Flowable.empty(); @@ -1706,7 +1706,7 @@ public static Flowable mergeArray(MaybeSource... sources) { @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArrayDelayError(@NonNull MaybeSource... sources) { + public static <@NonNull T> Flowable mergeArrayDelayError(@NonNull MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); return Flowable.fromArray(sources).flatMapMaybe(Functions.identity(), true, Math.max(1, sources.length)); } @@ -1744,7 +1744,7 @@ public static Flowable mergeArrayDelayError(@NonNull MaybeSource Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends MaybeSource> sources) { return Flowable.fromIterable(sources).flatMapMaybe(Functions.identity(), true, Integer.MAX_VALUE); } @@ -1780,7 +1780,7 @@ public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? exten @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { return mergeDelayError(sources, Integer.MAX_VALUE); } @@ -1819,7 +1819,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources, int maxConcurrency) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new FlowableFlatMapMaybePublisher<>(sources, Functions.identity(), true, maxConcurrency)); @@ -1858,7 +1858,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return mergeArrayDelayError(source1, source2); @@ -1900,7 +1900,7 @@ public static Flowable mergeDelayError(@NonNull MaybeSource @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull MaybeSource source1, + public static <@NonNull T> Flowable mergeDelayError(@NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -1946,7 +1946,7 @@ public static Flowable mergeDelayError(@NonNull MaybeSource @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError( + public static <@NonNull T> Flowable mergeDelayError( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4) { Objects.requireNonNull(source1, "source1 is null"); @@ -1976,7 +1976,7 @@ public static Flowable mergeDelayError( @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") @NonNull - public static Maybe never() { + public static <@NonNull T> Maybe never() { return RxJavaPlugins.onAssembly((Maybe)MaybeNever.INSTANCE); } @@ -2003,7 +2003,7 @@ public static Maybe never() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { + public static <@NonNull T> Single sequenceEqual(@NonNull MaybeSource source1, @NonNull MaybeSource source2) { return sequenceEqual(source1, source2, ObjectHelper.equalsPredicate()); } @@ -2033,7 +2033,7 @@ public static Single sequenceEqual(@NonNull MaybeSource Single sequenceEqual(@NonNull MaybeSource source1, @NonNull MaybeSource source2, + public static <@NonNull T> Single sequenceEqual(@NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull BiPredicate isEqual) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -2070,7 +2070,7 @@ public static Single sequenceEqual(@NonNull MaybeSource Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapMaybePublisher<>(sources, Functions.identity(), false)); } @@ -2105,7 +2105,7 @@ public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { + public static <@NonNull T> Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends MaybeSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapMaybePublisher<>(sources, Functions.identity(), true)); } @@ -2181,7 +2181,7 @@ public static Maybe timer(long delay, @NonNull TimeUnit unit, @NonNull Sch @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe unsafeCreate(@NonNull MaybeSource onSubscribe) { + public static <@NonNull T> Maybe unsafeCreate(@NonNull MaybeSource onSubscribe) { if (onSubscribe instanceof Maybe) { throw new IllegalArgumentException("unsafeCreate(Maybe) should be upgraded"); } @@ -2214,7 +2214,7 @@ public static Maybe unsafeCreate(@NonNull MaybeSource onSubscribe) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Maybe using(@NonNull Supplier resourceSupplier, + public static <@NonNull T, @NonNull D> Maybe using(@NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup) { return using(resourceSupplier, sourceSupplier, resourceCleanup, true); @@ -2253,7 +2253,7 @@ public static Maybe using(@NonNull Supplier resourceSuppl @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe using(@NonNull Supplier resourceSupplier, + public static <@NonNull T, @NonNull D> Maybe using(@NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup, boolean eager) { Objects.requireNonNull(resourceSupplier, "resourceSupplier is null"); @@ -2279,7 +2279,7 @@ public static Maybe using(@NonNull Supplier resourceSuppl @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe wrap(@NonNull MaybeSource source) { + public static <@NonNull T> Maybe wrap(@NonNull MaybeSource source) { if (source instanceof Maybe) { return RxJavaPlugins.onAssembly((Maybe)source); } @@ -2318,7 +2318,7 @@ public static Maybe wrap(@NonNull MaybeSource source) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, @NonNull Function zipper) { + public static <@NonNull T, @NonNull R> Maybe zip(@NonNull Iterable<@NonNull ? extends MaybeSource> sources, @NonNull Function zipper) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new MaybeZipIterable<>(sources, zipper)); @@ -2354,7 +2354,7 @@ public static Maybe zip(@NonNull Iterable<@NonNull ? extends MaybeSour @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull BiFunction zipper) { Objects.requireNonNull(source1, "source1 is null"); @@ -2396,7 +2396,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull Function3 zipper) { Objects.requireNonNull(source1, "source1 is null"); @@ -2443,7 +2443,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull Function4 zipper) { @@ -2495,7 +2495,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull MaybeSource source5, @NonNull Function5 zipper) { @@ -2551,7 +2551,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull MaybeSource source5, @NonNull MaybeSource source6, @NonNull Function6 zipper) { @@ -2612,7 +2612,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull MaybeSource source5, @NonNull MaybeSource source6, @NonNull MaybeSource source7, @@ -2678,7 +2678,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull MaybeSource source5, @NonNull MaybeSource source6, @NonNull MaybeSource source7, @NonNull MaybeSource source8, @@ -2747,7 +2747,7 @@ public static Maybe zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Maybe zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Maybe zip( @NonNull MaybeSource source1, @NonNull MaybeSource source2, @NonNull MaybeSource source3, @NonNull MaybeSource source4, @NonNull MaybeSource source5, @NonNull MaybeSource source6, @NonNull MaybeSource source7, @NonNull MaybeSource source8, @NonNull MaybeSource source9, @@ -2798,7 +2798,7 @@ public static Maybe zip( @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Maybe zipArray(@NonNull Function zipper, + public static <@NonNull T, @NonNull R> Maybe zipArray(@NonNull Function zipper, @NonNull MaybeSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { @@ -3058,7 +3058,7 @@ public final Maybe cache() { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe cast(@NonNull Class clazz) { + public final <@NonNull U> Maybe cast(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return map(Functions.castFunction(clazz)); } @@ -3088,7 +3088,7 @@ public final Maybe cast(@NonNull Class clazz) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Maybe compose(@NonNull MaybeTransformer transformer) { + public final <@NonNull R> Maybe compose(@NonNull MaybeTransformer transformer) { return wrap(((MaybeTransformer) Objects.requireNonNull(transformer, "transformer is null")).apply(this)); } @@ -3113,7 +3113,7 @@ public final Maybe compose(@NonNull MaybeTransformer Maybe concatMap(@NonNull Function> mapper) { + public final <@NonNull R> Maybe concatMap(@NonNull Function> mapper) { return flatMap(mapper); } @@ -3169,7 +3169,7 @@ public final Completable concatMapCompletable(@NonNull Function Maybe concatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Maybe concatMapSingle(@NonNull Function> mapper) { return flatMapSingle(mapper); } @@ -3444,7 +3444,7 @@ public final Maybe delay(long time, @NonNull TimeUnit unit, @NonNull Schedule @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) - public final Maybe delay(@NonNull Publisher delayIndicator) { + public final <@NonNull U> Maybe delay(@NonNull Publisher delayIndicator) { Objects.requireNonNull(delayIndicator, "delayIndicator is null"); return RxJavaPlugins.onAssembly(new MaybeDelayOtherPublisher<>(this, delayIndicator)); } @@ -3471,7 +3471,7 @@ public final Maybe delay(@NonNull Publisher delayIndicator) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe delaySubscription(@NonNull Publisher subscriptionIndicator) { + public final <@NonNull U> Maybe delaySubscription(@NonNull Publisher subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new MaybeDelaySubscriptionOtherPublisher<>(this, subscriptionIndicator)); } @@ -3875,7 +3875,7 @@ public final Maybe filter(@NonNull Predicate predicate) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe flatMap(@NonNull Function> mapper) { + public final <@NonNull R> Maybe flatMap(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatten<>(this, mapper)); } @@ -3905,7 +3905,7 @@ public final Maybe flatMap(@NonNull Function Maybe flatMap( + public final <@NonNull R> Maybe flatMap( @NonNull Function> onSuccessMapper, @NonNull Function> onErrorMapper, @NonNull Supplier> onCompleteSupplier) { @@ -3941,7 +3941,7 @@ public final Maybe flatMap( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Maybe flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -3974,7 +3974,7 @@ public final Maybe flatMap(@NonNull Function Flowable flattenAsFlowable(@NonNull Function> mapper) { + public final <@NonNull U> Flowable flattenAsFlowable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatMapIterableFlowable<>(this, mapper)); } @@ -4001,7 +4001,7 @@ public final Flowable flattenAsFlowable(@NonNull Function Observable flattenAsObservable(@NonNull Function> mapper) { + public final <@NonNull U> Observable flattenAsObservable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatMapIterableObservable<>(this, mapper)); } @@ -4026,7 +4026,7 @@ public final Observable flattenAsObservable(@NonNull Function Observable flatMapObservable(@NonNull Function> mapper) { + public final <@NonNull R> Observable flatMapObservable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatMapObservable<>(this, mapper)); } @@ -4055,7 +4055,7 @@ public final Observable flatMapObservable(@NonNull Function Flowable flatMapPublisher(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMapPublisher(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatMapPublisher<>(this, mapper)); } @@ -4084,7 +4084,7 @@ public final Flowable flatMapPublisher(@NonNull Function Maybe flatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Maybe flatMapSingle(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlatMapSingle<>(this, mapper)); } @@ -4324,7 +4324,7 @@ public final Single isEmpty() { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe lift(@NonNull MaybeOperator lift) { + public final <@NonNull R> Maybe lift(@NonNull MaybeOperator lift) { Objects.requireNonNull(lift, "lift is null"); return RxJavaPlugins.onAssembly(new MaybeLift<>(this, lift)); } @@ -4349,7 +4349,7 @@ public final Maybe lift(@NonNull MaybeOperator li @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe map(@NonNull Function mapper) { + public final <@NonNull R> Maybe map(@NonNull Function mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeMap<>(this, mapper)); } @@ -4451,7 +4451,7 @@ public final Maybe observeOn(@NonNull Scheduler scheduler) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe ofType(@NonNull Class clazz) { + public final <@NonNull U> Maybe ofType(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return filter(Functions.isInstanceOf(clazz)).cast(clazz); } @@ -4843,7 +4843,7 @@ public final Flowable repeatUntil(@NonNull BooleanSupplier stop) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable repeatWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Flowable repeatWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return toFlowable().repeatWhen(handler); } @@ -5061,7 +5061,7 @@ public final Maybe retryUntil(@NonNull BooleanSupplier stop) { @SchedulerSupport(SchedulerSupport.NONE) @NonNull public final Maybe retryWhen( - @NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + @NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return toFlowable().retryWhen(handler).singleElement(); } @@ -5517,7 +5517,7 @@ public final Single switchIfEmpty(@NonNull SingleSource other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe takeUntil(@NonNull MaybeSource other) { + public final <@NonNull U> Maybe takeUntil(@NonNull MaybeSource other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new MaybeTakeUntilMaybe<>(this, other)); } @@ -5548,7 +5548,7 @@ public final Maybe takeUntil(@NonNull MaybeSource other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe takeUntil(@NonNull Publisher other) { + public final <@NonNull U> Maybe takeUntil(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new MaybeTakeUntilPublisher<>(this, other)); } @@ -5913,7 +5913,7 @@ public final Maybe timeout(long timeout, @NonNull TimeUnit unit, @NonNull Sch @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe timeout(@NonNull MaybeSource timeoutIndicator) { + public final <@NonNull U> Maybe timeout(@NonNull MaybeSource timeoutIndicator) { Objects.requireNonNull(timeoutIndicator, "timeoutIndicator is null"); return RxJavaPlugins.onAssembly(new MaybeTimeoutMaybe<>(this, timeoutIndicator, null)); } @@ -5938,7 +5938,7 @@ public final Maybe timeout(@NonNull MaybeSource timeoutIndicator) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe timeout(@NonNull MaybeSource timeoutIndicator, @NonNull MaybeSource fallback) { + public final <@NonNull U> Maybe timeout(@NonNull MaybeSource timeoutIndicator, @NonNull MaybeSource fallback) { Objects.requireNonNull(timeoutIndicator, "timeoutIndicator is null"); Objects.requireNonNull(fallback, "fallback is null"); return RxJavaPlugins.onAssembly(new MaybeTimeoutMaybe<>(this, timeoutIndicator, fallback)); @@ -5966,7 +5966,7 @@ public final Maybe timeout(@NonNull MaybeSource timeoutIndicator, @Non @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe timeout(@NonNull Publisher timeoutIndicator) { + public final <@NonNull U> Maybe timeout(@NonNull Publisher timeoutIndicator) { Objects.requireNonNull(timeoutIndicator, "timeoutIndicator is null"); return RxJavaPlugins.onAssembly(new MaybeTimeoutPublisher<>(this, timeoutIndicator, null)); } @@ -5995,7 +5995,7 @@ public final Maybe timeout(@NonNull Publisher timeoutIndicator) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe timeout(@NonNull Publisher timeoutIndicator, @NonNull MaybeSource fallback) { + public final <@NonNull U> Maybe timeout(@NonNull Publisher timeoutIndicator, @NonNull MaybeSource fallback) { Objects.requireNonNull(timeoutIndicator, "timeoutIndicator is null"); Objects.requireNonNull(fallback, "fallback is null"); return RxJavaPlugins.onAssembly(new MaybeTimeoutPublisher<>(this, timeoutIndicator, fallback)); @@ -6052,7 +6052,7 @@ public final Maybe unsubscribeOn(@NonNull Scheduler scheduler) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe zipWith(@NonNull MaybeSource other, @NonNull BiFunction zipper) { + public final <@NonNull U, @NonNull R> Maybe zipWith(@NonNull MaybeSource other, @NonNull BiFunction zipper) { Objects.requireNonNull(other, "other is null"); return zip(this, other, zipper); } @@ -6134,7 +6134,7 @@ public final TestObserver test(boolean dispose) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Maybe<@NonNull T> fromOptional(@NonNull Optional optional) { + public static <@NonNull T> Maybe<@NonNull T> fromOptional(@NonNull Optional optional) { Objects.requireNonNull(optional, "optional is null"); return optional.map(Maybe::just).orElseGet(Maybe::empty); } @@ -6168,7 +6168,7 @@ public final TestObserver test(boolean dispose) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Maybe<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { + public static <@NonNull T> Maybe<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { Objects.requireNonNull(stage, "stage is null"); return RxJavaPlugins.onAssembly(new MaybeFromCompletionStage<>(stage)); } @@ -6304,7 +6304,7 @@ public final CompletionStage toCompletionStage(@Nullable T defaultItem) { @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) @NonNull - public final Flowable flattenStreamAsFlowable(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flattenStreamAsFlowable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlattenStreamAsFlowable<>(this, mapper)); } @@ -6344,7 +6344,7 @@ public final Flowable flattenStreamAsFlowable(@NonNull Function Observable flattenStreamAsObservable(@NonNull Function> mapper) { + public final <@NonNull R> Observable flattenStreamAsObservable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new MaybeFlattenStreamAsObservable<>(this, mapper)); } diff --git a/src/main/java/io/reactivex/rxjava3/core/Observable.java b/src/main/java/io/reactivex/rxjava3/core/Observable.java index 9869276b12..be33a95e3f 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Observable.java +++ b/src/main/java/io/reactivex/rxjava3/core/Observable.java @@ -130,7 +130,7 @@ public abstract class Observable<@NonNull T> implements ObservableSource { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable amb(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable amb(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableAmb<>(null, sources)); } @@ -166,7 +166,7 @@ public static Observable amb(@NonNull Iterable<@NonNull ? extends Observa @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Observable ambArray(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable ambArray(@NonNull ObservableSource... sources) { Objects.requireNonNull(sources, "sources is null"); int len = sources.length; if (len == 0) { @@ -228,7 +228,7 @@ public static int bufferSize() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable combineLatest( + public static <@NonNull T, @NonNull R> Observable combineLatest( @NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function combiner) { return combineLatest(sources, combiner, bufferSize()); @@ -275,7 +275,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T, @NonNull R> Observable combineLatest( @NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); @@ -325,7 +325,7 @@ public static Observable combineLatest( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable combineLatestArray( + public static <@NonNull T, @NonNull R> Observable combineLatestArray( @NonNull ObservableSource[] sources, @NonNull Function combiner) { return combineLatestArray(sources, combiner, bufferSize()); @@ -372,7 +372,7 @@ public static Observable combineLatestArray( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatestArray( + public static <@NonNull T, @NonNull R> Observable combineLatestArray( @NonNull ObservableSource[] sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); @@ -419,7 +419,7 @@ public static Observable combineLatestArray( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiFunction combiner) { Objects.requireNonNull(source1, "source1 is null"); @@ -463,7 +463,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull Function3 combiner) { @@ -513,7 +513,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull Function4 combiner) { @@ -567,7 +567,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @@ -626,7 +626,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @@ -690,7 +690,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @@ -759,7 +759,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @@ -832,7 +832,7 @@ public static Observable combineLatest( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatest( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Observable combineLatest( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @@ -890,7 +890,7 @@ public static Observable combineLates @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable combineLatestArrayDelayError( + public static <@NonNull T, @NonNull R> Observable combineLatestArrayDelayError( @NonNull ObservableSource[] sources, @NonNull Function combiner) { return combineLatestArrayDelayError(sources, combiner, bufferSize()); @@ -938,7 +938,7 @@ public static Observable combineLatestArrayDelayError( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatestArrayDelayError(@NonNull ObservableSource[] sources, + public static <@NonNull T, @NonNull R> Observable combineLatestArrayDelayError(@NonNull ObservableSource[] sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -990,7 +990,7 @@ public static Observable combineLatestArrayDelayError(@NonNull Observa @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, + public static <@NonNull T, @NonNull R> Observable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function combiner) { return combineLatestDelayError(sources, combiner, bufferSize()); } @@ -1037,7 +1037,7 @@ public static Observable combineLatestDelayError(@NonNull Iterable<@No @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, + public static <@NonNull T, @NonNull R> Observable combineLatestDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function combiner, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -1066,7 +1066,7 @@ public static Observable combineLatestDelayError(@NonNull Iterable<@No @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable concat(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable concat(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return fromIterable(sources).concatMapDelayError((Function)Functions.identity(), false, bufferSize()); } @@ -1091,7 +1091,7 @@ public static Observable concat(@NonNull Iterable<@NonNull ? extends Obse @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concat(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable concat(@NonNull ObservableSource> sources) { return concat(sources, bufferSize()); } @@ -1119,7 +1119,7 @@ public static Observable concat(@NonNull ObservableSource Observable concat(@NonNull ObservableSource> sources, int bufferSize) { + public static <@NonNull T> Observable concat(@NonNull ObservableSource> sources, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableConcatMap(sources, Functions.identity(), bufferSize, ErrorMode.IMMEDIATE)); @@ -1147,7 +1147,7 @@ public static Observable concat(@NonNull ObservableSource Observable concat(@NonNull ObservableSource source1, ObservableSource source2) { + public static <@NonNull T> Observable concat(@NonNull ObservableSource source1, ObservableSource source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return concatArray(source1, source2); @@ -1177,7 +1177,7 @@ public static Observable concat(@NonNull ObservableSource so @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable concat( + public static <@NonNull T> Observable concat( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3) { Objects.requireNonNull(source1, "source1 is null"); @@ -1212,7 +1212,7 @@ public static Observable concat( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable concat( + public static <@NonNull T> Observable concat( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4) { Objects.requireNonNull(source1, "source1 is null"); @@ -1242,7 +1242,7 @@ public static Observable concat( @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable concatArray(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArray(@NonNull ObservableSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -1271,7 +1271,7 @@ public static Observable concatArray(@NonNull ObservableSource Observable concatArrayDelayError(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArrayDelayError(@NonNull ObservableSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return empty(); @@ -1306,7 +1306,7 @@ public static Observable concatArrayDelayError(@NonNull ObservableSource< @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Observable concatArrayEager(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArrayEager(@NonNull ObservableSource... sources) { return concatArrayEager(bufferSize(), bufferSize(), sources); } @@ -1337,7 +1337,7 @@ public static Observable concatArrayEager(@NonNull ObservableSource Observable concatArrayEager(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArrayEager(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { return fromArray(sources).concatMapEagerDelayError((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -1364,7 +1364,7 @@ public static Observable concatArrayEager(int maxConcurrency, int bufferS @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Observable concatArrayEagerDelayError(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArrayEagerDelayError(@NonNull ObservableSource... sources) { return concatArrayEagerDelayError(bufferSize(), bufferSize(), sources); } @@ -1396,7 +1396,7 @@ public static Observable concatArrayEagerDelayError(@NonNull ObservableSo @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable concatArrayEagerDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { + public static <@NonNull T> Observable concatArrayEagerDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { return fromArray(sources).concatMapEagerDelayError((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -1419,7 +1419,7 @@ public static Observable concatArrayEagerDelayError(int maxConcurrency, i @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable concatDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable concatDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return concatDelayError(fromIterable(sources)); } @@ -1443,7 +1443,7 @@ public static Observable concatDelayError(@NonNull Iterable<@NonNull ? ex @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatDelayError(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable concatDelayError(@NonNull ObservableSource> sources) { return concatDelayError(sources, bufferSize(), true); } @@ -1470,7 +1470,7 @@ public static Observable concatDelayError(@NonNull ObservableSource Observable concatDelayError(@NonNull ObservableSource> sources, int bufferSize, boolean tillTheEnd) { + public static <@NonNull T> Observable concatDelayError(@NonNull ObservableSource> sources, int bufferSize, boolean tillTheEnd) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize is null"); return RxJavaPlugins.onAssembly(new ObservableConcatMap(sources, Functions.identity(), bufferSize, tillTheEnd ? ErrorMode.END : ErrorMode.BOUNDARY)); @@ -1497,7 +1497,7 @@ public static Observable concatDelayError(@NonNull ObservableSource Observable concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { return concatEager(sources, bufferSize(), bufferSize()); } @@ -1528,7 +1528,7 @@ public static Observable concatEager(@NonNull Iterable<@NonNull ? extends @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable concatEager(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).concatMapEagerDelayError((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -1553,7 +1553,7 @@ public static Observable concatEager(@NonNull Iterable<@NonNull ? extends @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatEager(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable concatEager(@NonNull ObservableSource> sources) { return concatEager(sources, bufferSize(), bufferSize()); } @@ -1585,7 +1585,7 @@ public static Observable concatEager(@NonNull ObservableSource Observable concatEager(@NonNull ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable concatEager(@NonNull ObservableSource> sources, int maxConcurrency, int bufferSize) { return wrap(sources).concatMapEager((Function)Functions.identity(), maxConcurrency, bufferSize); } @@ -1611,7 +1611,7 @@ public static Observable concatEager(@NonNull ObservableSource Observable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { return concatEagerDelayError(sources, bufferSize(), bufferSize()); } @@ -1643,7 +1643,7 @@ public static Observable concatEagerDelayError(@NonNull Iterable<@NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).concatMapEagerDelayError((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -1669,7 +1669,7 @@ public static Observable concatEagerDelayError(@NonNull Iterable<@NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatEagerDelayError(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable concatEagerDelayError(@NonNull ObservableSource> sources) { return concatEagerDelayError(sources, bufferSize(), bufferSize()); } @@ -1700,7 +1700,7 @@ public static Observable concatEagerDelayError(@NonNull ObservableSource< @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable concatEagerDelayError(@NonNull ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable concatEagerDelayError(@NonNull ObservableSource> sources, int maxConcurrency, int bufferSize) { return wrap(sources).concatMapEagerDelayError((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -1758,7 +1758,7 @@ public static Observable concatEagerDelayError(@NonNull ObservableSource< @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable create(@NonNull ObservableOnSubscribe source) { + public static <@NonNull T> Observable create(@NonNull ObservableOnSubscribe source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new ObservableCreate<>(source)); } @@ -1790,7 +1790,7 @@ public static Observable create(@NonNull ObservableOnSubscribe source) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable defer(@NonNull Supplier> supplier) { + public static <@NonNull T> Observable defer(@NonNull Supplier> supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new ObservableDefer<>(supplier)); } @@ -1814,7 +1814,7 @@ public static Observable defer(@NonNull Supplier Observable empty() { + public static <@NonNull T> Observable empty() { return RxJavaPlugins.onAssembly((Observable) ObservableEmpty.INSTANCE); } @@ -1839,7 +1839,7 @@ public static Observable empty() { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable error(@NonNull Supplier supplier) { + public static <@NonNull T> Observable error(@NonNull Supplier supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new ObservableError<>(supplier)); } @@ -1865,7 +1865,7 @@ public static Observable error(@NonNull Supplier sup @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable error(@NonNull Throwable throwable) { + public static <@NonNull T> Observable error(@NonNull Throwable throwable) { Objects.requireNonNull(throwable, "throwable is null"); return error(Functions.justSupplier(throwable)); } @@ -1895,7 +1895,7 @@ public static Observable error(@NonNull Throwable throwable) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromAction(@NonNull Action action) { + public static <@NonNull T> Observable fromAction(@NonNull Action action) { Objects.requireNonNull(action, "action is null"); return RxJavaPlugins.onAssembly(new ObservableFromAction<>(action)); } @@ -1921,7 +1921,7 @@ public static Observable fromAction(@NonNull Action action) { @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable fromArray(@NonNull T... items) { + public static <@NonNull T> Observable fromArray(@NonNull T... items) { Objects.requireNonNull(items, "items is null"); if (items.length == 0) { return empty(); @@ -1965,7 +1965,7 @@ public static Observable fromArray(@NonNull T... items) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromCallable(@NonNull Callable callable) { + public static <@NonNull T> Observable fromCallable(@NonNull Callable callable) { Objects.requireNonNull(callable, "callable is null"); return RxJavaPlugins.onAssembly(new ObservableFromCallable<>(callable)); } @@ -1986,7 +1986,7 @@ public static Observable fromCallable(@NonNull Callable call @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromCompletable(@NonNull CompletableSource completableSource) { + public static <@NonNull T> Observable fromCompletable(@NonNull CompletableSource completableSource) { Objects.requireNonNull(completableSource, "completableSource is null"); return RxJavaPlugins.onAssembly(new ObservableFromCompletable<>(completableSource)); } @@ -2024,7 +2024,7 @@ public static Observable fromCompletable(@NonNull CompletableSource compl @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromFuture(@NonNull Future future) { + public static <@NonNull T> Observable fromFuture(@NonNull Future future) { Objects.requireNonNull(future, "future is null"); return RxJavaPlugins.onAssembly(new ObservableFromFuture<>(future, 0L, null)); } @@ -2066,7 +2066,7 @@ public static Observable fromFuture(@NonNull Future future) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromFuture(@NonNull Future future, long timeout, @NonNull TimeUnit unit) { + public static <@NonNull T> Observable fromFuture(@NonNull Future future, long timeout, @NonNull TimeUnit unit) { Objects.requireNonNull(future, "future is null"); Objects.requireNonNull(unit, "unit is null"); return RxJavaPlugins.onAssembly(new ObservableFromFuture<>(future, timeout, unit)); @@ -2094,7 +2094,7 @@ public static Observable fromFuture(@NonNull Future future, @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromIterable(@NonNull Iterable<@NonNull ? extends T> source) { + public static <@NonNull T> Observable fromIterable(@NonNull Iterable source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new ObservableFromIterable<>(source)); } @@ -2118,7 +2118,7 @@ public static Observable fromIterable(@NonNull Iterable<@NonNull ? extend @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromMaybe(@NonNull MaybeSource maybe) { + public static <@NonNull T> Observable fromMaybe(@NonNull MaybeSource maybe) { Objects.requireNonNull(maybe, "maybe is null"); return RxJavaPlugins.onAssembly(new MaybeToObservable<>(maybe)); } @@ -2155,7 +2155,7 @@ public static Observable fromMaybe(@NonNull MaybeSource maybe) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromPublisher(@NonNull Publisher<@NonNull ? extends T> publisher) { + public static <@NonNull T> Observable fromPublisher(@NonNull Publisher publisher) { Objects.requireNonNull(publisher, "publisher is null"); return RxJavaPlugins.onAssembly(new ObservableFromPublisher<>(publisher)); } @@ -2191,7 +2191,7 @@ public static Observable fromPublisher(@NonNull Publisher<@NonNull ? exte @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromRunnable(@NonNull Runnable run) { + public static <@NonNull T> Observable fromRunnable(@NonNull Runnable run) { Objects.requireNonNull(run, "run is null"); return RxJavaPlugins.onAssembly(new ObservableFromRunnable<>(run)); } @@ -2214,7 +2214,7 @@ public static Observable fromRunnable(@NonNull Runnable run) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromSingle(@NonNull SingleSource source) { + public static <@NonNull T> Observable fromSingle(@NonNull SingleSource source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new SingleToObservable<>(source)); } @@ -2252,7 +2252,7 @@ public static Observable fromSingle(@NonNull SingleSource source) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable fromSupplier(@NonNull Supplier supplier) { + public static <@NonNull T> Observable fromSupplier(@NonNull Supplier supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new ObservableFromSupplier<>(supplier)); } @@ -2282,7 +2282,7 @@ public static Observable fromSupplier(@NonNull Supplier supp @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable generate(@NonNull Consumer> generator) { + public static <@NonNull T> Observable generate(@NonNull Consumer> generator) { Objects.requireNonNull(generator, "generator is null"); return generate(Functions.nullSupplier(), ObservableInternalHelper.simpleGenerator(generator), Functions.emptyConsumer()); @@ -2315,7 +2315,7 @@ public static Observable generate(@NonNull Consumer> generator @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator) { + public static <@NonNull T, @NonNull S> Observable generate(@NonNull Supplier initialState, @NonNull BiConsumer> generator) { Objects.requireNonNull(generator, "generator is null"); return generate(initialState, ObservableInternalHelper.simpleBiGenerator(generator), Functions.emptyConsumer()); } @@ -2349,7 +2349,7 @@ public static Observable generate(@NonNull Supplier initialState, @ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable generate( + public static <@NonNull T, @NonNull S> Observable generate( @NonNull Supplier initialState, @NonNull BiConsumer> generator, @NonNull Consumer disposeState) { @@ -2385,7 +2385,7 @@ public static Observable generate( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator) { + public static <@NonNull T, @NonNull S> Observable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator) { return generate(initialState, generator, Functions.emptyConsumer()); } @@ -2419,7 +2419,7 @@ public static Observable generate(@NonNull Supplier initialState, @ @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator, + public static <@NonNull T, @NonNull S> Observable generate(@NonNull Supplier initialState, @NonNull BiFunction, S> generator, @NonNull Consumer disposeState) { Objects.requireNonNull(initialState, "initialState is null"); Objects.requireNonNull(generator, "generator is null"); @@ -2643,7 +2643,7 @@ public static Observable intervalRange(long start, long count, long initia @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item) { + public static <@NonNull T> Observable just(@NonNull T item) { Objects.requireNonNull(item, "item is null"); return RxJavaPlugins.onAssembly(new ObservableJust<>(item)); } @@ -2670,7 +2670,7 @@ public static Observable just(@NonNull T item) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); @@ -2701,7 +2701,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2735,7 +2735,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2773,7 +2773,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2814,7 +2814,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2859,7 +2859,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2907,7 +2907,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -2958,7 +2958,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -3013,7 +3013,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9, @NonNull T item10) { + public static <@NonNull T> Observable just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9, @NonNull T item10) { Objects.requireNonNull(item1, "item1 is null"); Objects.requireNonNull(item2, "item2 is null"); Objects.requireNonNull(item3, "item3 is null"); @@ -3072,7 +3072,7 @@ public static Observable just(@NonNull T item1, @NonNull T item2, @NonNul @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).flatMap((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -3121,7 +3121,7 @@ public static Observable merge(@NonNull Iterable<@NonNull ? extends Obser @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable mergeArray(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { + public static <@NonNull T> Observable mergeArray(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), false, maxConcurrency, bufferSize); } @@ -3162,7 +3162,7 @@ public static Observable mergeArray(int maxConcurrency, int bufferSize, @ @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { return fromIterable(sources).flatMap((Function)Functions.identity()); } @@ -3208,7 +3208,7 @@ public static Observable merge(@NonNull Iterable<@NonNull ? extends Obser @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency) { + public static <@NonNull T> Observable merge(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency) { return fromIterable(sources).flatMap((Function)Functions.identity(), maxConcurrency); } @@ -3250,7 +3250,7 @@ public static Observable merge(@NonNull Iterable<@NonNull ? extends Obser @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) @NonNull - public static Observable merge(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable merge(@NonNull ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableFlatMap(sources, Functions.identity(), false, Integer.MAX_VALUE, bufferSize())); } @@ -3299,7 +3299,7 @@ public static Observable merge(@NonNull ObservableSource Observable merge(@NonNull ObservableSource> sources, int maxConcurrency) { + public static <@NonNull T> Observable merge(@NonNull ObservableSource> sources, int maxConcurrency) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new ObservableFlatMap(sources, Functions.identity(), false, maxConcurrency, bufferSize())); @@ -3344,7 +3344,7 @@ public static Observable merge(@NonNull ObservableSource Observable merge(@NonNull ObservableSource source1, @NonNull ObservableSource source2) { + public static <@NonNull T> Observable merge(@NonNull ObservableSource source1, @NonNull ObservableSource source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return fromArray(source1, source2).flatMap((Function)Functions.identity(), false, 2); @@ -3391,7 +3391,7 @@ public static Observable merge(@NonNull ObservableSource sou @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable merge( + public static <@NonNull T> Observable merge( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3) { Objects.requireNonNull(source1, "source1 is null"); @@ -3443,7 +3443,7 @@ public static Observable merge( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable merge( + public static <@NonNull T> Observable merge( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4) { Objects.requireNonNull(source1, "source1 is null"); @@ -3491,7 +3491,7 @@ public static Observable merge( @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable mergeArray(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable mergeArray(@NonNull ObservableSource... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), sources.length); } @@ -3524,7 +3524,7 @@ public static Observable mergeArray(@NonNull ObservableSource Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { + public static <@NonNull T> Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources) { return fromIterable(sources).flatMap((Function)Functions.identity(), true); } @@ -3562,7 +3562,7 @@ public static Observable mergeDelayError(@NonNull Iterable<@NonNull ? ext @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { + public static <@NonNull T> Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency, int bufferSize) { return fromIterable(sources).flatMap((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -3601,7 +3601,7 @@ public static Observable mergeDelayError(@NonNull Iterable<@NonNull ? ext @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable mergeArrayDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { + public static <@NonNull T> Observable mergeArrayDelayError(int maxConcurrency, int bufferSize, @NonNull ObservableSource... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), true, maxConcurrency, bufferSize); } @@ -3637,7 +3637,7 @@ public static Observable mergeArrayDelayError(int maxConcurrency, int buf @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency) { + public static <@NonNull T> Observable mergeDelayError(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, int maxConcurrency) { return fromIterable(sources).flatMap((Function)Functions.identity(), true, maxConcurrency); } @@ -3670,7 +3670,7 @@ public static Observable mergeDelayError(@NonNull Iterable<@NonNull ? ext @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) @NonNull - public static Observable mergeDelayError(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable mergeDelayError(@NonNull ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableFlatMap(sources, Functions.identity(), true, Integer.MAX_VALUE, bufferSize())); } @@ -3709,7 +3709,7 @@ public static Observable mergeDelayError(@NonNull ObservableSource Observable mergeDelayError(@NonNull ObservableSource> sources, int maxConcurrency) { + public static <@NonNull T> Observable mergeDelayError(@NonNull ObservableSource> sources, int maxConcurrency) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new ObservableFlatMap(sources, Functions.identity(), true, maxConcurrency, bufferSize())); @@ -3746,7 +3746,7 @@ public static Observable mergeDelayError(@NonNull ObservableSource Observable mergeDelayError( + public static <@NonNull T> Observable mergeDelayError( @NonNull ObservableSource source1, @NonNull ObservableSource source2) { Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); @@ -3787,7 +3787,7 @@ public static Observable mergeDelayError( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable mergeDelayError( + public static <@NonNull T> Observable mergeDelayError( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3) { Objects.requireNonNull(source1, "source1 is null"); @@ -3832,7 +3832,7 @@ public static Observable mergeDelayError( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable mergeDelayError( + public static <@NonNull T> Observable mergeDelayError( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4) { Objects.requireNonNull(source1, "source1 is null"); @@ -3872,7 +3872,7 @@ public static Observable mergeDelayError( @SchedulerSupport(SchedulerSupport.NONE) @NonNull @SafeVarargs - public static Observable mergeArrayDelayError(@NonNull ObservableSource... sources) { + public static <@NonNull T> Observable mergeArrayDelayError(@NonNull ObservableSource... sources) { return fromArray(sources).flatMap((Function)Functions.identity(), true, sources.length); } @@ -3896,7 +3896,7 @@ public static Observable mergeArrayDelayError(@NonNull ObservableSource Observable never() { + public static <@NonNull T> Observable never() { return RxJavaPlugins.onAssembly((Observable) ObservableNever.INSTANCE); } @@ -4007,7 +4007,7 @@ public static Observable rangeLong(long start, long count) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull ObservableSource source1, @NonNull ObservableSource source2) { + public static <@NonNull T> Single sequenceEqual(@NonNull ObservableSource source1, @NonNull ObservableSource source2) { return sequenceEqual(source1, source2, ObjectHelper.equalsPredicate(), bufferSize()); } @@ -4037,7 +4037,7 @@ public static Single sequenceEqual(@NonNull ObservableSource Single sequenceEqual( + public static <@NonNull T> Single sequenceEqual( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiPredicate isEqual) { return sequenceEqual(source1, source2, isEqual, bufferSize()); @@ -4072,7 +4072,7 @@ public static Single sequenceEqual( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual( + public static <@NonNull T> Single sequenceEqual( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiPredicate isEqual, int bufferSize) { Objects.requireNonNull(source1, "source1 is null"); @@ -4108,7 +4108,7 @@ public static Single sequenceEqual( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single sequenceEqual(@NonNull ObservableSource source1, @NonNull ObservableSource source2, + public static <@NonNull T> Single sequenceEqual(@NonNull ObservableSource source1, @NonNull ObservableSource source2, int bufferSize) { return sequenceEqual(source1, source2, ObjectHelper.equalsPredicate(), bufferSize); } @@ -4145,7 +4145,7 @@ public static Single sequenceEqual(@NonNull ObservableSource Observable switchOnNext(@NonNull ObservableSource> sources, int bufferSize) { + public static <@NonNull T> Observable switchOnNext(@NonNull ObservableSource> sources, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableSwitchMap(sources, Functions.identity(), bufferSize, false)); @@ -4179,7 +4179,7 @@ public static Observable switchOnNext(@NonNull ObservableSource Observable switchOnNext(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable switchOnNext(@NonNull ObservableSource> sources) { return switchOnNext(sources, bufferSize()); } @@ -4213,7 +4213,7 @@ public static Observable switchOnNext(@NonNull ObservableSource Observable switchOnNextDelayError(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable switchOnNextDelayError(@NonNull ObservableSource> sources) { return switchOnNextDelayError(sources, bufferSize()); } @@ -4251,7 +4251,7 @@ public static Observable switchOnNextDelayError(@NonNull ObservableSource @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable switchOnNextDelayError(@NonNull ObservableSource> sources, int bufferSize) { + public static <@NonNull T> Observable switchOnNextDelayError(@NonNull ObservableSource> sources, int bufferSize) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableSwitchMap(sources, Functions.identity(), bufferSize, true)); @@ -4331,7 +4331,7 @@ public static Observable timer(long delay, @NonNull TimeUnit unit, @NonNul @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable unsafeCreate(@NonNull ObservableSource onSubscribe) { + public static <@NonNull T> Observable unsafeCreate(@NonNull ObservableSource onSubscribe) { Objects.requireNonNull(onSubscribe, "onSubscribe is null"); if (onSubscribe instanceof Observable) { throw new IllegalArgumentException("unsafeCreate(Observable) should be upgraded"); @@ -4365,7 +4365,7 @@ public static Observable unsafeCreate(@NonNull ObservableSource onSubs @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable using( + public static <@NonNull T, @NonNull D> Observable using( @NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup) { @@ -4404,7 +4404,7 @@ public static Observable using( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable using( + public static <@NonNull T, @NonNull D> Observable using( @NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup, boolean eager) { @@ -4430,7 +4430,7 @@ public static Observable using( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable wrap(@NonNull ObservableSource source) { + public static <@NonNull T> Observable wrap(@NonNull ObservableSource source) { Objects.requireNonNull(source, "source is null"); if (source instanceof Observable) { return RxJavaPlugins.onAssembly((Observable)source); @@ -4487,7 +4487,7 @@ public static Observable wrap(@NonNull ObservableSource source) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function zipper) { + public static <@NonNull T, @NonNull R> Observable zip(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function zipper) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableZip<>(null, sources, zipper, bufferSize(), false)); @@ -4548,7 +4548,7 @@ public static Observable zip(@NonNull Iterable<@NonNull ? extends Obse @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, + public static <@NonNull T, @NonNull R> Observable zip(@NonNull Iterable<@NonNull ? extends ObservableSource> sources, @NonNull Function zipper, boolean delayError, int bufferSize) { Objects.requireNonNull(zipper, "zipper is null"); @@ -4605,7 +4605,7 @@ public static Observable zip(@NonNull Iterable<@NonNull ? extends Obse @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiFunction zipper) { Objects.requireNonNull(source1, "source1 is null"); @@ -4663,7 +4663,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiFunction zipper, boolean delayError) { Objects.requireNonNull(source1, "source1 is null"); @@ -4723,7 +4723,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull BiFunction zipper, boolean delayError, int bufferSize) { Objects.requireNonNull(source1, "source1 is null"); @@ -4784,7 +4784,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull Function3 zipper) { @@ -4851,7 +4851,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull Function4 zipper) { @@ -4922,7 +4922,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull Function5 zipper) { @@ -4996,7 +4996,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @NonNull Function6 zipper) { @@ -5075,7 +5075,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @NonNull ObservableSource source7, @@ -5159,7 +5159,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @NonNull ObservableSource source7, @NonNull ObservableSource source8, @@ -5247,7 +5247,7 @@ public static Observable zip( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Observable zip( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull ObservableSource source5, @NonNull ObservableSource source6, @NonNull ObservableSource source7, @NonNull ObservableSource source8, @NonNull ObservableSource source9, @@ -5321,7 +5321,7 @@ public static Observable zip( @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Observable zipArray( + public static <@NonNull T, @NonNull R> Observable zipArray( @NonNull Function zipper, boolean delayError, int bufferSize, @NonNull ObservableSource... sources) { @@ -6046,7 +6046,7 @@ public final void blockingSubscribe(@NonNull Observer observer) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Observable buffer(int count, int skip, @NonNull Supplier bufferSupplier) { + public final <@NonNull U extends Collection> Observable buffer(int count, int skip, @NonNull Supplier bufferSupplier) { ObjectHelper.verifyPositive(count, "count"); ObjectHelper.verifyPositive(skip, "skip"); Objects.requireNonNull(bufferSupplier, "bufferSupplier is null"); @@ -6399,7 +6399,7 @@ public final > Observable buffer(int count, i @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable<@NonNull List> buffer( + public final <@NonNull TOpening, @NonNull TClosing> Observable<@NonNull List> buffer( @NonNull ObservableSource openingIndicator, @NonNull Function> closingIndicator) { return buffer(openingIndicator, closingIndicator, ArrayListSupplier.asSupplier()); @@ -6436,7 +6436,7 @@ public final > Observable buffer(int count, i @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Observable buffer( + public final <@NonNull TOpening, @NonNull TClosing, @NonNull U extends Collection> Observable buffer( @NonNull ObservableSource openingIndicator, @NonNull Function> closingIndicator, @NonNull Supplier bufferSupplier) { @@ -6473,7 +6473,7 @@ public final > Observable buffer(int count, i @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable<@NonNull List> buffer(@NonNull ObservableSource boundaryIndicator) { + public final <@NonNull B> Observable<@NonNull List> buffer(@NonNull ObservableSource boundaryIndicator) { return buffer(boundaryIndicator, ArrayListSupplier.asSupplier()); } @@ -6507,7 +6507,7 @@ public final > Observable buffer(int count, i @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable<@NonNull List> buffer(@NonNull ObservableSource boundaryIndicator, int initialCapacity) { + public final <@NonNull B> Observable<@NonNull List> buffer(@NonNull ObservableSource boundaryIndicator, int initialCapacity) { ObjectHelper.verifyPositive(initialCapacity, "initialCapacity"); return buffer(boundaryIndicator, Functions.createArrayList(initialCapacity)); } @@ -6543,7 +6543,7 @@ public final > Observable buffer(int count, i @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final > Observable buffer(@NonNull ObservableSource boundaryIndicator, @NonNull Supplier bufferSupplier) { + public final <@NonNull B, @NonNull U extends Collection> Observable buffer(@NonNull ObservableSource boundaryIndicator, @NonNull Supplier bufferSupplier) { Objects.requireNonNull(boundaryIndicator, "boundaryIndicator is null"); Objects.requireNonNull(bufferSupplier, "bufferSupplier is null"); return RxJavaPlugins.onAssembly(new ObservableBufferExactBoundary<>(this, boundaryIndicator, bufferSupplier)); @@ -6688,7 +6688,7 @@ public final Observable cacheWithInitialCapacity(int initialCapacity) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable cast(@NonNull Class clazz) { + public final <@NonNull U> Observable cast(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return map(Functions.castFunction(clazz)); } @@ -6722,7 +6722,7 @@ public final Observable cast(@NonNull Class clazz) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single collect(@NonNull Supplier initialItemSupplier, @NonNull BiConsumer collector) { + public final <@NonNull U> Single collect(@NonNull Supplier initialItemSupplier, @NonNull BiConsumer collector) { Objects.requireNonNull(initialItemSupplier, "initialItemSupplier is null"); Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new ObservableCollectSingle<>(this, initialItemSupplier, collector)); @@ -6757,7 +6757,7 @@ public final Single collect(@NonNull Supplier initialItemSup @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single collectInto(@NonNull U initialItem, @NonNull BiConsumer collector) { + public final <@NonNull U> Single collectInto(@NonNull U initialItem, @NonNull BiConsumer collector) { Objects.requireNonNull(initialItem, "initialItem is null"); return collect(Functions.justSupplier(initialItem), collector); } @@ -6786,7 +6786,7 @@ public final Single collectInto(@NonNull U initialItem, @NonNull BiConsum @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable compose(@NonNull ObservableTransformer composer) { + public final <@NonNull R> Observable compose(@NonNull ObservableTransformer composer) { return wrap(((ObservableTransformer) Objects.requireNonNull(composer, "composer is null")).apply(this)); } @@ -6817,7 +6817,7 @@ public final Observable compose(@NonNull ObservableTransformer Observable concatMap(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMap(@NonNull Function> mapper) { return concatMap(mapper, 2); } @@ -6851,7 +6851,7 @@ public final Observable concatMap(@NonNull Function Observable concatMap(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Observable concatMap(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarSupplier) { @@ -6896,7 +6896,7 @@ public final Observable concatMap(@NonNull Function Observable concatMap(@NonNull Function> mapper, int bufferSize, @NonNull Scheduler scheduler) { + public final <@NonNull R> Observable concatMap(@NonNull Function> mapper, int bufferSize, @NonNull Scheduler scheduler) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -6928,7 +6928,7 @@ public final Observable concatMap(@NonNull Function Observable concatMapDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapDelayError(@NonNull Function> mapper) { return concatMapDelayError(mapper, true, bufferSize()); } @@ -6963,7 +6963,7 @@ public final Observable concatMapDelayError(@NonNull Function Observable concatMapDelayError(@NonNull Function> mapper, + public final <@NonNull R> Observable concatMapDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); @@ -7008,7 +7008,7 @@ public final Observable concatMapDelayError(@NonNull Function Observable concatMapDelayError(@NonNull Function> mapper, + public final <@NonNull R> Observable concatMapDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize, @NonNull Scheduler scheduler) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); @@ -7039,7 +7039,7 @@ public final Observable concatMapDelayError(@NonNull Function Observable concatMapEager(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapEager(@NonNull Function> mapper) { return concatMapEager(mapper, Integer.MAX_VALUE, bufferSize()); } @@ -7069,7 +7069,7 @@ public final Observable concatMapEager(@NonNull Function Observable concatMapEager(@NonNull Function> mapper, + public final <@NonNull R> Observable concatMapEager(@NonNull Function> mapper, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -7103,7 +7103,7 @@ public final Observable concatMapEager(@NonNull Function Observable concatMapEagerDelayError(@NonNull Function> mapper, + public final <@NonNull R> Observable concatMapEagerDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapEagerDelayError(mapper, tillTheEnd, Integer.MAX_VALUE, bufferSize()); } @@ -7139,7 +7139,7 @@ public final Observable concatMapEagerDelayError(@NonNull Function Observable concatMapEagerDelayError(@NonNull Function> mapper, + public final <@NonNull R> Observable concatMapEagerDelayError(@NonNull Function> mapper, boolean tillTheEnd, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -7318,7 +7318,7 @@ public final Completable concatMapCompletableDelayError(@NonNull Function Observable concatMapIterable(@NonNull Function> mapper) { + public final <@NonNull U> Observable concatMapIterable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableFlattenIterable<>(this, mapper)); } @@ -7347,7 +7347,7 @@ public final Observable concatMapIterable(@NonNull Function Observable concatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapMaybe(@NonNull Function> mapper) { return concatMapMaybe(mapper, 2); } @@ -7378,7 +7378,7 @@ public final Observable concatMapMaybe(@NonNull Function Observable concatMapMaybe(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Observable concatMapMaybe(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableConcatMapMaybe<>(this, mapper, ErrorMode.IMMEDIATE, bufferSize)); @@ -7408,7 +7408,7 @@ public final Observable concatMapMaybe(@NonNull Function Observable concatMapMaybeDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapMaybeDelayError(@NonNull Function> mapper) { return concatMapMaybeDelayError(mapper, true, 2); } @@ -7442,7 +7442,7 @@ public final Observable concatMapMaybeDelayError(@NonNull Function Observable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd) { + public final <@NonNull R> Observable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapMaybeDelayError(mapper, tillTheEnd, 2); } @@ -7478,7 +7478,7 @@ public final Observable concatMapMaybeDelayError(@NonNull Function Observable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize) { + public final <@NonNull R> Observable concatMapMaybeDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableConcatMapMaybe<>(this, mapper, tillTheEnd ? ErrorMode.END : ErrorMode.BOUNDARY, bufferSize)); @@ -7508,7 +7508,7 @@ public final Observable concatMapMaybeDelayError(@NonNull Function Observable concatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapSingle(@NonNull Function> mapper) { return concatMapSingle(mapper, 2); } @@ -7539,7 +7539,7 @@ public final Observable concatMapSingle(@NonNull Function Observable concatMapSingle(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Observable concatMapSingle(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableConcatMapSingle<>(this, mapper, ErrorMode.IMMEDIATE, bufferSize)); @@ -7569,7 +7569,7 @@ public final Observable concatMapSingle(@NonNull Function Observable concatMapSingleDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapSingleDelayError(@NonNull Function> mapper) { return concatMapSingleDelayError(mapper, true, 2); } @@ -7603,7 +7603,7 @@ public final Observable concatMapSingleDelayError(@NonNull Function Observable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd) { + public final <@NonNull R> Observable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd) { return concatMapSingleDelayError(mapper, tillTheEnd, 2); } @@ -7639,7 +7639,7 @@ public final Observable concatMapSingleDelayError(@NonNull Function Observable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize) { + public final <@NonNull R> Observable concatMapSingleDelayError(@NonNull Function> mapper, boolean tillTheEnd, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableConcatMapSingle<>(this, mapper, tillTheEnd ? ErrorMode.END : ErrorMode.BOUNDARY, bufferSize)); @@ -7812,7 +7812,7 @@ public final Single count() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable debounce(@NonNull Function> debounceIndicator) { + public final <@NonNull U> Observable debounce(@NonNull Function> debounceIndicator) { Objects.requireNonNull(debounceIndicator, "debounceIndicator is null"); return RxJavaPlugins.onAssembly(new ObservableDebounce<>(this, debounceIndicator)); } @@ -7949,7 +7949,7 @@ public final Observable defaultIfEmpty(@NonNull T defaultItem) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable delay(@NonNull Function> itemDelayIndicator) { + public final <@NonNull U> Observable delay(@NonNull Function> itemDelayIndicator) { Objects.requireNonNull(itemDelayIndicator, "itemDelayIndicator is null"); return flatMap(ObservableInternalHelper.itemDelay(itemDelayIndicator)); } @@ -8101,7 +8101,7 @@ public final Observable delay(long time, @NonNull TimeUnit unit, @NonNull Sch @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable delay(@NonNull ObservableSource subscriptionIndicator, + public final <@NonNull U, @NonNull V> Observable delay(@NonNull ObservableSource subscriptionIndicator, @NonNull Function> itemDelayIndicator) { return delaySubscription(subscriptionIndicator).delay(itemDelayIndicator); } @@ -8126,7 +8126,7 @@ public final Observable delay(@NonNull ObservableSource subscriptio @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable delaySubscription(@NonNull ObservableSource subscriptionIndicator) { + public final <@NonNull U> Observable delaySubscription(@NonNull ObservableSource subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new ObservableDelaySubscriptionOther<>(this, subscriptionIndicator)); } @@ -8232,7 +8232,7 @@ public final Observable delaySubscription(long time, @NonNull TimeUnit unit, @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable dematerialize(@NonNull Function> selector) { + public final <@NonNull R> Observable dematerialize(@NonNull Function> selector) { Objects.requireNonNull(selector, "selector is null"); return RxJavaPlugins.onAssembly(new ObservableDematerialize<>(this, selector)); } @@ -8312,7 +8312,7 @@ public final Observable distinct() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable distinct(@NonNull Function keySelector) { + public final <@NonNull K> Observable distinct(@NonNull Function keySelector) { return distinct(keySelector, Functions.createHashSet()); } @@ -8345,7 +8345,7 @@ public final Observable distinct(@NonNull Function keySelec @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable distinct(@NonNull Function keySelector, @NonNull Supplier> collectionSupplier) { + public final <@NonNull K> Observable distinct(@NonNull Function keySelector, @NonNull Supplier> collectionSupplier) { Objects.requireNonNull(keySelector, "keySelector is null"); Objects.requireNonNull(collectionSupplier, "collectionSupplier is null"); return RxJavaPlugins.onAssembly(new ObservableDistinct<>(this, keySelector, collectionSupplier)); @@ -8427,7 +8427,7 @@ public final Observable distinctUntilChanged() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable distinctUntilChanged(@NonNull Function keySelector) { + public final <@NonNull K> Observable distinctUntilChanged(@NonNull Function keySelector) { Objects.requireNonNull(keySelector, "keySelector is null"); return RxJavaPlugins.onAssembly(new ObservableDistinctUntilChanged<>(this, keySelector, ObjectHelper.equalsPredicate())); } @@ -9014,7 +9014,7 @@ public final Single firstOrError() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable flatMap(@NonNull Function> mapper) { + public final <@NonNull R> Observable flatMap(@NonNull Function> mapper) { return flatMap(mapper, false); } @@ -9043,7 +9043,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, boolean delayErrors) { + public final <@NonNull R> Observable flatMap(@NonNull Function> mapper, boolean delayErrors) { return flatMap(mapper, delayErrors, Integer.MAX_VALUE); } @@ -9077,7 +9077,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { + public final <@NonNull R> Observable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency) { return flatMap(mapper, delayErrors, maxConcurrency, bufferSize()); } @@ -9113,7 +9113,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull R> Observable flatMap(@NonNull Function> mapper, boolean delayErrors, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -9156,7 +9156,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap( + public final <@NonNull R> Observable flatMap( @NonNull Function> onNextMapper, @NonNull Function> onErrorMapper, @NonNull Supplier> onCompleteSupplier) { @@ -9198,7 +9198,7 @@ public final Observable flatMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable flatMap( + public final <@NonNull R> Observable flatMap( @NonNull Function> onNextMapper, @NonNull Function> onErrorMapper, @NonNull Supplier> onCompleteSupplier, @@ -9236,7 +9236,7 @@ public final Observable flatMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable flatMap(@NonNull Function> mapper, int maxConcurrency) { + public final <@NonNull R> Observable flatMap(@NonNull Function> mapper, int maxConcurrency) { return flatMap(mapper, false, maxConcurrency, bufferSize()); } @@ -9266,7 +9266,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Observable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner) { return flatMap(mapper, combiner, false, bufferSize(), bufferSize()); } @@ -9300,7 +9300,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Observable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors) { return flatMap(mapper, combiner, delayErrors, bufferSize(), bufferSize()); } @@ -9339,7 +9339,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Observable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors, int maxConcurrency) { return flatMap(mapper, combiner, delayErrors, maxConcurrency, bufferSize()); } @@ -9380,7 +9380,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Observable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, boolean delayErrors, int maxConcurrency, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -9418,7 +9418,7 @@ public final Observable flatMap(@NonNull Function Observable flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Observable flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner, int maxConcurrency) { return flatMap(mapper, combiner, false, maxConcurrency, bufferSize()); } @@ -9488,7 +9488,7 @@ public final Completable flatMapCompletable(@NonNull Function Observable flatMapIterable(@NonNull Function> mapper) { + public final <@NonNull U> Observable flatMapIterable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableFlattenIterable<>(this, mapper)); } @@ -9522,7 +9522,7 @@ public final Observable flatMapIterable(@NonNull Function Observable flatMapIterable(@NonNull Function> mapper, + public final <@NonNull U, @NonNull V> Observable flatMapIterable(@NonNull Function> mapper, @NonNull BiFunction combiner) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -9546,7 +9546,7 @@ public final Observable flatMapIterable(@NonNull Function Observable flatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Observable flatMapMaybe(@NonNull Function> mapper) { return flatMapMaybe(mapper, false); } @@ -9570,7 +9570,7 @@ public final Observable flatMapMaybe(@NonNull Function Observable flatMapMaybe(@NonNull Function> mapper, boolean delayErrors) { + public final <@NonNull R> Observable flatMapMaybe(@NonNull Function> mapper, boolean delayErrors) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableFlatMapMaybe<>(this, mapper, delayErrors)); } @@ -9592,7 +9592,7 @@ public final Observable flatMapMaybe(@NonNull Function Observable flatMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Observable flatMapSingle(@NonNull Function> mapper) { return flatMapSingle(mapper, false); } @@ -9616,7 +9616,7 @@ public final Observable flatMapSingle(@NonNull Function Observable flatMapSingle(@NonNull Function> mapper, boolean delayErrors) { + public final <@NonNull R> Observable flatMapSingle(@NonNull Function> mapper, boolean delayErrors) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableFlatMapSingle<>(this, mapper, delayErrors)); } @@ -9775,7 +9775,7 @@ public final Disposable forEachWhile(@NonNull Predicate onNext, @NonN @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> groupBy(@NonNull Function keySelector) { + public final <@NonNull K> Observable> groupBy(@NonNull Function keySelector) { return groupBy(keySelector, (Function)Functions.identity(), false, bufferSize()); } @@ -9820,7 +9820,7 @@ public final Observable> groupBy(@NonNull Function Observable> groupBy(@NonNull Function keySelector, boolean delayError) { + public final <@NonNull K> Observable> groupBy(@NonNull Function keySelector, boolean delayError) { return groupBy(keySelector, (Function)Functions.identity(), delayError, bufferSize()); } @@ -9865,7 +9865,7 @@ public final Observable> groupBy(@NonNull Function Observable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Observable> groupBy(@NonNull Function keySelector, Function valueSelector) { return groupBy(keySelector, valueSelector, false, bufferSize()); } @@ -9914,7 +9914,7 @@ public final Observable> groupBy(@NonNull Functio @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Observable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector, boolean delayError) { return groupBy(keySelector, valueSelector, delayError, bufferSize()); } @@ -9966,7 +9966,7 @@ public final Observable> groupBy(@NonNull Functio @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> groupBy(@NonNull Function keySelector, + public final <@NonNull K, @NonNull V> Observable> groupBy(@NonNull Function keySelector, @NonNull Function valueSelector, boolean delayError, int bufferSize) { Objects.requireNonNull(keySelector, "keySelector is null"); @@ -10010,7 +10010,7 @@ public final Observable> groupBy(@NonNull Functio @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable groupJoin( + public final <@NonNull TRight, @NonNull TLeftEnd, @NonNull TRightEnd, @NonNull R> Observable groupJoin( @NonNull ObservableSource other, @NonNull Function> leftEnd, @NonNull Function> rightEnd, @@ -10122,7 +10122,7 @@ public final Single isEmpty() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable join( + public final <@NonNull TRight, @NonNull TLeftEnd, @NonNull TRightEnd, @NonNull R> Observable join( @NonNull ObservableSource other, @NonNull Function> leftEnd, @NonNull Function> rightEnd, @@ -10346,7 +10346,7 @@ public final Single lastOrError() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable lift(@NonNull ObservableOperator lifter) { + public final <@NonNull R> Observable lift(@NonNull ObservableOperator lifter) { Objects.requireNonNull(lifter, "lifter is null"); return RxJavaPlugins.onAssembly(new ObservableLift<>(this, lifter)); } @@ -10636,7 +10636,7 @@ public final Observable observeOn(@NonNull Scheduler scheduler, boolean delay @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable ofType(@NonNull Class clazz) { + public final <@NonNull U> Observable ofType(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return filter(Functions.isInstanceOf(clazz)).cast(clazz); } @@ -10893,7 +10893,7 @@ public final ConnectableObservable publish() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable publish(@NonNull Function, ? extends ObservableSource> selector) { + public final <@NonNull R> Observable publish(@NonNull Function, ? extends ObservableSource> selector) { Objects.requireNonNull(selector, "selector is null"); return RxJavaPlugins.onAssembly(new ObservablePublishSelector<>(this, selector)); } @@ -11183,7 +11183,7 @@ public final ConnectableObservable replay() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector) { Objects.requireNonNull(selector, "selector is null"); return ObservableReplay.multicastSelector(ObservableInternalHelper.replaySupplier(this), selector); } @@ -11218,7 +11218,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return ObservableReplay.multicastSelector(ObservableInternalHelper.replaySupplier(this, bufferSize, false), selector); @@ -11256,7 +11256,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, boolean eagerTruncate) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return ObservableReplay.multicastSelector(ObservableInternalHelper.replaySupplier(this, bufferSize, eagerTruncate), selector); @@ -11295,7 +11295,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit) { return replay(selector, bufferSize, time, unit, Schedulers.computation()); } @@ -11337,7 +11337,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); Objects.requireNonNull(unit, "unit is null"); @@ -11385,7 +11385,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, int bufferSize, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); Objects.requireNonNull(unit, "unit is null"); @@ -11421,7 +11421,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit) { return replay(selector, time, unit, Schedulers.computation()); } @@ -11455,7 +11455,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -11494,7 +11494,7 @@ public final Observable replay(@NonNull Function, ? @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull - public final Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { + public final <@NonNull R> Observable replay(@NonNull Function, ? extends ObservableSource> selector, long time, @NonNull TimeUnit unit, @NonNull Scheduler scheduler, boolean eagerTruncate) { Objects.requireNonNull(selector, "selector is null"); Objects.requireNonNull(unit, "unit is null"); Objects.requireNonNull(scheduler, "scheduler is null"); @@ -12192,7 +12192,7 @@ public final Observable sample(long period, @NonNull TimeUnit unit, @NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable sample(@NonNull ObservableSource sampler) { + public final <@NonNull U> Observable sample(@NonNull ObservableSource sampler) { Objects.requireNonNull(sampler, "sampler is null"); return RxJavaPlugins.onAssembly(new ObservableSampleWithObservable<>(this, sampler, false)); } @@ -12225,7 +12225,7 @@ public final Observable sample(@NonNull ObservableSource sampler) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable sample(@NonNull ObservableSource sampler, boolean emitLast) { + public final <@NonNull U> Observable sample(@NonNull ObservableSource sampler, boolean emitLast) { Objects.requireNonNull(sampler, "sampler is null"); return RxJavaPlugins.onAssembly(new ObservableSampleWithObservable<>(this, sampler, emitLast)); } @@ -12303,7 +12303,7 @@ public final Observable scan(@NonNull BiFunction accumulator) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable scan(@NonNull R initialValue, @NonNull BiFunction accumulator) { + public final <@NonNull R> Observable scan(@NonNull R initialValue, @NonNull BiFunction accumulator) { Objects.requireNonNull(initialValue, "initialValue is null"); return scanWith(Functions.justSupplier(initialValue), accumulator); } @@ -12338,7 +12338,7 @@ public final Observable scan(@NonNull R initialValue, @NonNull BiFunction @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable scanWith(@NonNull Supplier seedSupplier, @NonNull BiFunction accumulator) { + public final <@NonNull R> Observable scanWith(@NonNull Supplier seedSupplier, @NonNull BiFunction accumulator) { Objects.requireNonNull(seedSupplier, "seedSupplier is null"); Objects.requireNonNull(accumulator, "accumulator is null"); return RxJavaPlugins.onAssembly(new ObservableScanSeed<>(this, seedSupplier, accumulator)); @@ -12758,7 +12758,7 @@ public final Observable skipLast(long time, @NonNull TimeUnit unit, @NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable skipUntil(@NonNull ObservableSource other) { + public final <@NonNull U> Observable skipUntil(@NonNull ObservableSource other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new ObservableSkipUntil<>(this, other)); } @@ -12862,7 +12862,7 @@ public final Observable sorted(@NonNull Comparator comparator) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable startWithIterable(@NonNull Iterable<@NonNull ? extends T> items) { + public final Observable startWithIterable(@NonNull Iterable items) { return concatArray(fromIterable(items), this); } @@ -13305,7 +13305,7 @@ public final Observable switchIfEmpty(@NonNull ObservableSource @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable switchMap(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMap(@NonNull Function> mapper) { return switchMap(mapper, bufferSize()); } @@ -13338,7 +13338,7 @@ public final Observable switchMap(@NonNull Function Observable switchMap(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Observable switchMap(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarSupplier) { @@ -13472,7 +13472,7 @@ public final Completable switchMapCompletableDelayError(@NonNull Function Observable switchMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMapMaybe(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableSwitchMapMaybe<>(this, mapper, false)); } @@ -13500,7 +13500,7 @@ public final Observable switchMapMaybe(@NonNull Function Observable switchMapMaybeDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMapMaybeDelayError(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableSwitchMapMaybe<>(this, mapper, true)); } @@ -13532,7 +13532,7 @@ public final Observable switchMapMaybeDelayError(@NonNull Function Observable switchMapSingle(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMapSingle(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableSwitchMapSingle<>(this, mapper, false)); } @@ -13565,7 +13565,7 @@ public final Observable switchMapSingle(@NonNull Function Observable switchMapSingleDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMapSingleDelayError(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableSwitchMapSingle<>(this, mapper, true)); } @@ -13598,7 +13598,7 @@ public final Observable switchMapSingleDelayError(@NonNull Function Observable switchMapDelayError(@NonNull Function> mapper) { + public final <@NonNull R> Observable switchMapDelayError(@NonNull Function> mapper) { return switchMapDelayError(mapper, bufferSize()); } @@ -13633,7 +13633,7 @@ public final Observable switchMapDelayError(@NonNull Function Observable switchMapDelayError(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull R> Observable switchMapDelayError(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarSupplier) { @@ -14048,7 +14048,7 @@ public final Observable takeLast(long time, @NonNull TimeUnit unit, @NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable takeUntil(@NonNull ObservableSource other) { + public final <@NonNull U> Observable takeUntil(@NonNull ObservableSource other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new ObservableTakeUntil<>(this, other)); } @@ -14556,7 +14556,7 @@ public final Observable> timeInterval(@NonNull TimeUnit unit, @NonNull @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable timeout(@NonNull Function> itemTimeoutIndicator) { + public final <@NonNull V> Observable timeout(@NonNull Function> itemTimeoutIndicator) { return timeout0(null, itemTimeoutIndicator, null); } @@ -14588,7 +14588,7 @@ public final Observable timeout(@NonNull Function Observable timeout(@NonNull Function> itemTimeoutIndicator, + public final <@NonNull V> Observable timeout(@NonNull Function> itemTimeoutIndicator, @NonNull ObservableSource fallback) { Objects.requireNonNull(fallback, "fallback is null"); return timeout0(null, itemTimeoutIndicator, fallback); @@ -14740,7 +14740,7 @@ public final Observable timeout(long timeout, @NonNull TimeUnit unit, @NonNul @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable timeout(@NonNull ObservableSource firstTimeoutIndicator, + public final <@NonNull U, @NonNull V> Observable timeout(@NonNull ObservableSource firstTimeoutIndicator, @NonNull Function> itemTimeoutIndicator) { Objects.requireNonNull(firstTimeoutIndicator, "firstTimeoutIndicator is null"); return timeout0(firstTimeoutIndicator, itemTimeoutIndicator, null); @@ -14778,7 +14778,7 @@ public final Observable timeout(@NonNull ObservableSource firstTime @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable timeout( + public final <@NonNull U, @NonNull V> Observable timeout( @NonNull ObservableSource firstTimeoutIndicator, @NonNull Function> itemTimeoutIndicator, @NonNull ObservableSource fallback) { @@ -14918,7 +14918,7 @@ public final Observable> timestamp(@NonNull TimeUnit unit, @NonNull Sch @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final R to(@NonNull ObservableConverter converter) { + public final <@NonNull R> R to(@NonNull ObservableConverter converter) { return Objects.requireNonNull(converter, "converter is null").apply(this); } @@ -15048,7 +15048,7 @@ public final R to(@NonNull ObservableConverter converter) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single<@NonNull Map> toMap(@NonNull Function keySelector) { + public final <@NonNull K> Single<@NonNull Map> toMap(@NonNull Function keySelector) { Objects.requireNonNull(keySelector, "keySelector is null"); return collect(HashMapSupplier.asSupplier(), Functions.toMapKeySelector(keySelector)); } @@ -15083,7 +15083,7 @@ public final R to(@NonNull ObservableConverter converter) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single> toMap( + public final <@NonNull K, @NonNull V> Single> toMap( @NonNull Function keySelector, @NonNull Function valueSelector) { Objects.requireNonNull(keySelector, "keySelector is null"); @@ -15120,7 +15120,7 @@ public final Single> toMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single> toMap( + public final <@NonNull K, @NonNull V> Single> toMap( @NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier> mapSupplier) { @@ -15154,7 +15154,7 @@ public final Single> toMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single<@NonNull Map>> toMultimap(@NonNull Function keySelector) { + public final <@NonNull K> Single<@NonNull Map>> toMultimap(@NonNull Function keySelector) { Function valueSelector = Functions.identity(); Supplier>> mapSupplier = HashMapSupplier.asSupplier(); Function> collectionFactory = ArrayListSupplier.asFunction(); @@ -15189,7 +15189,7 @@ public final Single> toMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single<@NonNull Map>> toMultimap(@NonNull Function keySelector, Function valueSelector) { + public final <@NonNull K, @NonNull V> Single<@NonNull Map>> toMultimap(@NonNull Function keySelector, Function valueSelector) { Supplier>> mapSupplier = HashMapSupplier.asSupplier(); Function> collectionFactory = ArrayListSupplier.asFunction(); return toMultimap(keySelector, valueSelector, mapSupplier, collectionFactory); @@ -15227,7 +15227,7 @@ public final Single> toMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single<@NonNull Map>> toMultimap( + public final <@NonNull K, @NonNull V> Single<@NonNull Map>> toMultimap( @NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier>> mapSupplier, @@ -15269,7 +15269,7 @@ public final Single> toMap( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single<@NonNull Map>> toMultimap( + public final <@NonNull K, @NonNull V> Single<@NonNull Map>> toMultimap( @NonNull Function keySelector, @NonNull Function valueSelector, @NonNull Supplier>> mapSupplier @@ -15996,7 +15996,7 @@ public final Observable> window( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> window(@NonNull ObservableSource boundaryIndicator) { + public final <@NonNull B> Observable> window(@NonNull ObservableSource boundaryIndicator) { return window(boundaryIndicator, bufferSize()); } @@ -16030,7 +16030,7 @@ public final Observable> window(@NonNull ObservableSource b @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> window(@NonNull ObservableSource boundaryIndicator, int bufferSize) { + public final <@NonNull B> Observable> window(@NonNull ObservableSource boundaryIndicator, int bufferSize) { Objects.requireNonNull(boundaryIndicator, "boundaryIndicator is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ObservableWindowBoundary<>(this, boundaryIndicator, bufferSize)); @@ -16067,7 +16067,7 @@ public final Observable> window(@NonNull ObservableSource b @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> window( + public final <@NonNull U, @NonNull V> Observable> window( @NonNull ObservableSource openingIndicator, @NonNull Function> closingIndicator) { return window(openingIndicator, closingIndicator, bufferSize()); @@ -16107,7 +16107,7 @@ public final Observable> window( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable> window( + public final <@NonNull U, @NonNull V> Observable> window( @NonNull ObservableSource openingIndicator, @NonNull Function> closingIndicator, int bufferSize) { Objects.requireNonNull(openingIndicator, "openingIndicator is null"); @@ -16149,7 +16149,7 @@ public final Observable> window( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable withLatestFrom(@NonNull ObservableSource other, @NonNull BiFunction combiner) { + public final <@NonNull U, @NonNull R> Observable withLatestFrom(@NonNull ObservableSource other, @NonNull BiFunction combiner) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -16186,7 +16186,7 @@ public final Observable withLatestFrom(@NonNull ObservableSource Observable withLatestFrom( + public final <@NonNull T1, @NonNull T2, @NonNull R> Observable withLatestFrom( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull Function3 combiner) { Objects.requireNonNull(source1, "source1 is null"); @@ -16228,7 +16228,7 @@ public final Observable withLatestFrom( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable withLatestFrom( + public final <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Observable withLatestFrom( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull Function4 combiner) { @@ -16275,7 +16275,7 @@ public final Observable withLatestFrom( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable withLatestFrom( + public final <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Observable withLatestFrom( @NonNull ObservableSource source1, @NonNull ObservableSource source2, @NonNull ObservableSource source3, @NonNull ObservableSource source4, @NonNull Function5 combiner) { @@ -16315,7 +16315,7 @@ public final Observable withLatestFrom( @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable withLatestFrom(@NonNull ObservableSource[] others, @NonNull Function combiner) { + public final <@NonNull R> Observable withLatestFrom(@NonNull ObservableSource[] others, @NonNull Function combiner) { Objects.requireNonNull(others, "others is null"); Objects.requireNonNull(combiner, "combiner is null"); return RxJavaPlugins.onAssembly(new ObservableWithLatestFromMany<>(this, others, combiner)); @@ -16348,7 +16348,7 @@ public final Observable withLatestFrom(@NonNull ObservableSource[] oth @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable withLatestFrom(@NonNull Iterable<@NonNull ? extends ObservableSource> others, @NonNull Function combiner) { + public final <@NonNull R> Observable withLatestFrom(@NonNull Iterable<@NonNull ? extends ObservableSource> others, @NonNull Function combiner) { Objects.requireNonNull(others, "others is null"); Objects.requireNonNull(combiner, "combiner is null"); return RxJavaPlugins.onAssembly(new ObservableWithLatestFromMany<>(this, others, combiner)); @@ -16383,7 +16383,7 @@ public final Observable withLatestFrom(@NonNull Iterable<@NonNull ? exten @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull U, R> Observable zipWith(@NonNull Iterable other, @NonNull BiFunction zipper) { + public final <@NonNull U, @NonNull R> Observable zipWith(@NonNull Iterable other, @NonNull BiFunction zipper) { Objects.requireNonNull(other, "other is null"); Objects.requireNonNull(zipper, "zipper is null"); return RxJavaPlugins.onAssembly(new ObservableZipIterable<>(this, other, zipper)); @@ -16427,7 +16427,7 @@ public final Observable withLatestFrom(@NonNull Iterable<@NonNull ? exten @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable zipWith(@NonNull ObservableSource other, + public final <@NonNull U, @NonNull R> Observable zipWith(@NonNull ObservableSource other, @NonNull BiFunction zipper) { Objects.requireNonNull(other, "other is null"); return zip(this, other, zipper); @@ -16474,7 +16474,7 @@ public final Observable zipWith(@NonNull ObservableSource @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable zipWith(@NonNull ObservableSource other, + public final <@NonNull U, @NonNull R> Observable zipWith(@NonNull ObservableSource other, @NonNull BiFunction zipper, boolean delayError) { return zip(this, other, zipper, delayError); } @@ -16523,7 +16523,7 @@ public final Observable zipWith(@NonNull ObservableSource @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Observable zipWith(@NonNull ObservableSource other, + public final <@NonNull U, @NonNull R> Observable zipWith(@NonNull ObservableSource other, @NonNull BiFunction zipper, boolean delayError, int bufferSize) { return zip(this, other, zipper, delayError, bufferSize); } @@ -16605,7 +16605,7 @@ public final TestObserver test(boolean dispose) { // NoPMD @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable<@NonNull T> fromOptional(@NonNull Optional optional) { + public static <@NonNull T> Observable<@NonNull T> fromOptional(@NonNull Optional optional) { Objects.requireNonNull(optional, "optional is null"); return optional.map(Observable::just).orElseGet(Observable::empty); } @@ -16639,7 +16639,7 @@ public final TestObserver test(boolean dispose) { // NoPMD @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { + public static <@NonNull T> Observable<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { Objects.requireNonNull(stage, "stage is null"); return RxJavaPlugins.onAssembly(new ObservableFromCompletionStage<>(stage)); } @@ -16682,7 +16682,7 @@ public final TestObserver test(boolean dispose) { // NoPMD @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Observable<@NonNull T> fromStream(@NonNull Stream stream) { + public static <@NonNull T> Observable<@NonNull T> fromStream(@NonNull Stream stream) { Objects.requireNonNull(stream, "stream is null"); return RxJavaPlugins.onAssembly(new ObservableFromStream<>(stream)); } @@ -16736,7 +16736,7 @@ public final TestObserver test(boolean dispose) { // NoPMD @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R, A> Single collect(@NonNull Collector collector) { + public final <@NonNull R, @NonNull A> Single collect(@NonNull Collector collector) { Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new ObservableCollectWithCollectorSingle<>(this, collector)); } @@ -17034,7 +17034,7 @@ public final Stream blockingStream(int capacityHint) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Observable concatMapStream(@NonNull Function> mapper) { + public final <@NonNull R> Observable concatMapStream(@NonNull Function> mapper) { return flatMapStream(mapper); } @@ -17081,7 +17081,7 @@ public final Stream blockingStream(int capacityHint) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final <@NonNull R> Observable flatMapStream(@NonNull Function> mapper) { + public final <@NonNull R> Observable flatMapStream(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ObservableFlatMapStream<>(this, mapper)); } diff --git a/src/main/java/io/reactivex/rxjava3/core/Single.java b/src/main/java/io/reactivex/rxjava3/core/Single.java index 66e1ffd3d5..eb590aa428 100644 --- a/src/main/java/io/reactivex/rxjava3/core/Single.java +++ b/src/main/java/io/reactivex/rxjava3/core/Single.java @@ -134,7 +134,7 @@ public abstract class Single<@NonNull T> implements SingleSource { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single amb(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Single amb(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new SingleAmb<>(null, sources)); } @@ -159,7 +159,7 @@ public static Single amb(@NonNull Iterable<@NonNull ? extends SingleSourc @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Single ambArray(@NonNull SingleSource... sources) { + public static <@NonNull T> Single ambArray(@NonNull SingleSource... sources) { Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return error(SingleInternalHelper.emptyThrower()); @@ -193,7 +193,7 @@ public static Single ambArray(@NonNull SingleSource... sourc @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static Flowable concat(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concat(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).concatMapSingleDelayError(Functions.identity(), false); } @@ -215,7 +215,7 @@ public static Flowable concat(@NonNull Iterable<@NonNull ? extends Single @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Observable concat(@NonNull ObservableSource> sources) { + public static <@NonNull T> Observable concat(@NonNull ObservableSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableConcatMapSingle<>(sources, Functions.identity(), ErrorMode.IMMEDIATE, 2)); } @@ -242,7 +242,7 @@ public static Observable concat(@NonNull ObservableSource Flowable concat(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { return concat(sources, 2); } @@ -270,7 +270,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Singl @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int prefetch) { + public static <@NonNull T> Flowable concat(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int prefetch) { Objects.requireNonNull(sources, "sources is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapSinglePublisher<>(sources, Functions.identity(), ErrorMode.IMMEDIATE, prefetch)); @@ -300,7 +300,7 @@ public static Flowable concat(@NonNull Publisher<@NonNull ? extends Singl @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( + public static <@NonNull T> Flowable concat( @NonNull SingleSource source1, @NonNull SingleSource source2 ) { Objects.requireNonNull(source1, "source1 is null"); @@ -334,7 +334,7 @@ public static Flowable concat( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( + public static <@NonNull T> Flowable concat( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3 ) { @@ -372,7 +372,7 @@ public static Flowable concat( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concat( + public static <@NonNull T> Flowable concat( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4 ) { @@ -405,7 +405,7 @@ public static Flowable concat( @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable concatArray(@NonNull SingleSource... sources) { + public static <@NonNull T> Flowable concatArray(@NonNull SingleSource... sources) { return Flowable.fromArray(sources).concatMapSingleDelayError(Functions.identity(), false); } @@ -431,7 +431,7 @@ public static Flowable concatArray(@NonNull SingleSource... @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable concatArrayDelayError(@NonNull SingleSource... sources) { + public static <@NonNull T> Flowable concatArrayDelayError(@NonNull SingleSource... sources) { return Flowable.fromArray(sources).concatMapSingleDelayError(Functions.identity(), true); } @@ -459,7 +459,7 @@ public static Flowable concatArrayDelayError(@NonNull SingleSource Flowable concatArrayEager(@NonNull SingleSource... sources) { + public static <@NonNull T> Flowable concatArrayEager(@NonNull SingleSource... sources) { return Flowable.fromArray(sources).concatMapEager(SingleInternalHelper.toFlowable()); } @@ -488,7 +488,7 @@ public static Flowable concatArrayEager(@NonNull SingleSource Flowable concatArrayEagerDelayError(@NonNull SingleSource... sources) { + public static <@NonNull T> Flowable concatArrayEagerDelayError(@NonNull SingleSource... sources) { return Flowable.fromArray(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), true); } @@ -515,7 +515,7 @@ public static Flowable concatArrayEagerDelayError(@NonNull SingleSource Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).concatMapSingleDelayError(Functions.identity()); } @@ -542,7 +542,7 @@ public static Flowable concatDelayError(@NonNull Iterable<@NonNull ? exte @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { return Flowable.fromPublisher(sources).concatMapSingleDelayError(Functions.identity()); } @@ -574,7 +574,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int prefetch) { + public static <@NonNull T> Flowable concatDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int prefetch) { return Flowable.fromPublisher(sources).concatMapSingleDelayError(Functions.identity(), true, prefetch); } @@ -601,7 +601,7 @@ public static Flowable concatDelayError(@NonNull Publisher<@NonNull ? ext @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), false); } @@ -633,7 +633,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends S @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends SingleSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEager(@NonNull Iterable<@NonNull ? extends SingleSource> sources, int maxConcurrency) { return Flowable.fromIterable(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), false, maxConcurrency, 1); } @@ -662,7 +662,7 @@ public static Flowable concatEager(@NonNull Iterable<@NonNull ? extends S @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { return Flowable.fromPublisher(sources).concatMapEager(SingleInternalHelper.toFlowable()); } @@ -696,7 +696,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEager(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int maxConcurrency) { return Flowable.fromPublisher(sources).concatMapEager(SingleInternalHelper.toFlowable(), maxConcurrency, 1); } @@ -725,7 +725,7 @@ public static Flowable concatEager(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), true); } @@ -757,7 +757,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources, int maxConcurrency) { return Flowable.fromIterable(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), true, maxConcurrency, 1); } @@ -788,7 +788,7 @@ public static Flowable concatEagerDelayError(@NonNull Iterable<@NonNull ? @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { return Flowable.fromPublisher(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), true); } @@ -822,7 +822,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int maxConcurrency) { + public static <@NonNull T> Flowable concatEagerDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources, int maxConcurrency) { return Flowable.fromPublisher(sources).concatMapEagerDelayError(SingleInternalHelper.toFlowable(), true, maxConcurrency, 1); } @@ -895,7 +895,7 @@ public static Flowable concatEagerDelayError(@NonNull Publisher<@NonNull @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single defer(@NonNull Supplier> supplier) { + public static <@NonNull T> Single defer(@NonNull Supplier> supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new SingleDefer<>(supplier)); } @@ -917,7 +917,7 @@ public static Single defer(@NonNull Supplier Single error(@NonNull Supplier supplier) { + public static <@NonNull T> Single error(@NonNull Supplier supplier) { Objects.requireNonNull(supplier, "supplier is null"); return RxJavaPlugins.onAssembly(new SingleError<>(supplier)); } @@ -944,7 +944,7 @@ public static Single error(@NonNull Supplier supplie @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single error(@NonNull Throwable throwable) { + public static <@NonNull T> Single error(@NonNull Throwable throwable) { Objects.requireNonNull(throwable, "throwable is null"); return error(Functions.justSupplier(throwable)); } @@ -1080,7 +1080,7 @@ public static Single error(@NonNull Throwable throwable) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single fromMaybe(@NonNull MaybeSource maybe) { + public static <@NonNull T> Single fromMaybe(@NonNull MaybeSource maybe) { Objects.requireNonNull(maybe, "maybe is null"); return RxJavaPlugins.onAssembly(new MaybeToSingle<>(maybe, null)); } @@ -1105,7 +1105,7 @@ public static Single fromMaybe(@NonNull MaybeSource maybe) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single fromMaybe(@NonNull MaybeSource maybe, @NonNull T defaultItem) { + public static <@NonNull T> Single fromMaybe(@NonNull MaybeSource maybe, @NonNull T defaultItem) { Objects.requireNonNull(maybe, "maybe is null"); Objects.requireNonNull(defaultItem, "defaultItem is null"); return RxJavaPlugins.onAssembly(new MaybeToSingle<>(maybe, defaultItem)); @@ -1146,7 +1146,7 @@ public static Single fromMaybe(@NonNull MaybeSource maybe, @NonNull T @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single fromPublisher(@NonNull Publisher<@NonNull ? extends T> publisher) { + public static <@NonNull T> Single fromPublisher(@NonNull Publisher publisher) { Objects.requireNonNull(publisher, "publisher is null"); return RxJavaPlugins.onAssembly(new SingleFromPublisher<>(publisher)); } @@ -1172,7 +1172,7 @@ public static Single fromPublisher(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single fromObservable(@NonNull ObservableSource observable) { + public static <@NonNull T> Single fromObservable(@NonNull ObservableSource observable) { Objects.requireNonNull(observable, "observable is null"); return RxJavaPlugins.onAssembly(new ObservableSingleSingle<>(observable, null)); } @@ -1279,7 +1279,7 @@ public static Single fromObservable(@NonNull ObservableSource Flowable merge(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable merge(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).flatMapSingle(Functions.identity()); } @@ -1318,7 +1318,7 @@ public static Flowable merge(@NonNull Iterable<@NonNull ? extends SingleS @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable merge(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableFlatMapSinglePublisher<>(sources, Functions.identity(), false, Integer.MAX_VALUE)); } @@ -1349,7 +1349,7 @@ public static Flowable merge(@NonNull Publisher<@NonNull ? extends Single @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single merge(@NonNull SingleSource> source) { + public static <@NonNull T> Single merge(@NonNull SingleSource> source) { Objects.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new SingleFlatMap, T>(source, Functions.identity())); } @@ -1395,7 +1395,7 @@ public static Single merge(@NonNull SingleSource Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull SingleSource source1, @NonNull SingleSource source2 ) { Objects.requireNonNull(source1, "source1 is null"); @@ -1446,7 +1446,7 @@ public static Flowable merge( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3 ) { @@ -1501,7 +1501,7 @@ public static Flowable merge( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable merge( + public static <@NonNull T> Flowable merge( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4 ) { @@ -1547,7 +1547,7 @@ public static Flowable merge( @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Flowable mergeArray(SingleSource... sources) { + public static <@NonNull T> Flowable mergeArray(SingleSource... sources) { return Flowable.fromArray(sources).flatMapSingle(Functions.identity(), false, Math.max(1, sources.length)); } @@ -1583,7 +1583,7 @@ public static Flowable mergeArray(SingleSource... sources) { @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs @NonNull - public static Flowable mergeArrayDelayError(@NonNull SingleSource... sources) { + public static <@NonNull T> Flowable mergeArrayDelayError(@NonNull SingleSource... sources) { return Flowable.fromArray(sources).flatMapSingle(Functions.identity(), true, Math.max(1, sources.length)); } @@ -1610,7 +1610,7 @@ public static Flowable mergeArrayDelayError(@NonNull SingleSource Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Iterable<@NonNull ? extends SingleSource> sources) { return Flowable.fromIterable(sources).flatMapSingle(Functions.identity(), true, Integer.MAX_VALUE); } @@ -1637,7 +1637,7 @@ public static Flowable mergeDelayError(@NonNull Iterable<@NonNull ? exten @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable mergeDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableFlatMapSinglePublisher<>(sources, Functions.identity(), true, Integer.MAX_VALUE)); } @@ -1672,7 +1672,7 @@ public static Flowable mergeDelayError(@NonNull Publisher<@NonNull ? exte @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError( + public static <@NonNull T> Flowable mergeDelayError( @NonNull SingleSource source1, @NonNull SingleSource source2 ) { Objects.requireNonNull(source1, "source1 is null"); @@ -1712,7 +1712,7 @@ public static Flowable mergeDelayError( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError( + public static <@NonNull T> Flowable mergeDelayError( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3 ) { @@ -1756,7 +1756,7 @@ public static Flowable mergeDelayError( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable mergeDelayError( + public static <@NonNull T> Flowable mergeDelayError( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4 ) { @@ -1783,7 +1783,7 @@ public static Flowable mergeDelayError( @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") @NonNull - public static Single never() { + public static <@NonNull T> Single never() { return RxJavaPlugins.onAssembly((Single) SingleNever.INSTANCE); } @@ -1853,7 +1853,7 @@ public static Single timer(long delay, @NonNull TimeUnit unit, @NonNull Sc @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single sequenceEqual(@NonNull SingleSource source1, @NonNull SingleSource source2) { // NOPMD + public static <@NonNull T> Single sequenceEqual(@NonNull SingleSource source1, @NonNull SingleSource source2) { // NOPMD Objects.requireNonNull(source1, "source1 is null"); Objects.requireNonNull(source2, "source2 is null"); return RxJavaPlugins.onAssembly(new SingleEquals<>(source1, source2)); @@ -1888,7 +1888,7 @@ public static Single sequenceEqual(@NonNull SingleSource Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapSinglePublisher<>(sources, Functions.identity(), false)); } @@ -1923,7 +1923,7 @@ public static Flowable switchOnNext(@NonNull Publisher<@NonNull ? extends @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { + public static <@NonNull T> Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull ? extends SingleSource> sources) { Objects.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new FlowableSwitchMapSinglePublisher<>(sources, Functions.identity(), true)); } @@ -1949,7 +1949,7 @@ public static Flowable switchOnNextDelayError(@NonNull Publisher<@NonNull @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single unsafeCreate(@NonNull SingleSource onSubscribe) { + public static <@NonNull T> Single unsafeCreate(@NonNull SingleSource onSubscribe) { Objects.requireNonNull(onSubscribe, "onSubscribe is null"); if (onSubscribe instanceof Single) { throw new IllegalArgumentException("unsafeCreate(Single) should be upgraded"); @@ -1982,7 +1982,7 @@ public static Single unsafeCreate(@NonNull SingleSource onSubscribe) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single using(@NonNull Supplier resourceSupplier, + public static <@NonNull T, @NonNull U> Single using(@NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup) { return using(resourceSupplier, sourceSupplier, resourceCleanup, true); @@ -2018,7 +2018,7 @@ public static Single using(@NonNull Supplier resourceSupplier, @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single using( + public static <@NonNull T, @NonNull U> Single using( @NonNull Supplier resourceSupplier, @NonNull Function> sourceSupplier, @NonNull Consumer resourceCleanup, @@ -2047,7 +2047,7 @@ public static Single using( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single wrap(@NonNull SingleSource source) { + public static <@NonNull T> Single wrap(@NonNull SingleSource source) { Objects.requireNonNull(source, "source is null"); if (source instanceof Single) { return RxJavaPlugins.onAssembly((Single)source); @@ -2088,7 +2088,7 @@ public static Single wrap(@NonNull SingleSource source) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip(@NonNull Iterable<@NonNull ? extends SingleSource> sources, + public static <@NonNull T, @NonNull R> Single zip(@NonNull Iterable<@NonNull ? extends SingleSource> sources, @NonNull Function zipper) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); @@ -2122,7 +2122,7 @@ public static Single zip(@NonNull Iterable<@NonNull ? extends SingleSo @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull BiFunction zipper ) { @@ -2162,7 +2162,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull Function3 zipper @@ -2207,7 +2207,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull Function4 zipper @@ -2257,7 +2257,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull SingleSource source5, @@ -2312,7 +2312,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull SingleSource source5, @NonNull SingleSource source6, @@ -2371,7 +2371,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull SingleSource source5, @NonNull SingleSource source6, @@ -2435,7 +2435,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull SingleSource source5, @NonNull SingleSource source6, @@ -2504,7 +2504,7 @@ public static Single zip( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public static Single zip( + public static <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull T4, @NonNull T5, @NonNull T6, @NonNull T7, @NonNull T8, @NonNull T9, @NonNull R> Single zip( @NonNull SingleSource source1, @NonNull SingleSource source2, @NonNull SingleSource source3, @NonNull SingleSource source4, @NonNull SingleSource source5, @NonNull SingleSource source6, @@ -2558,7 +2558,7 @@ public static Single zip( @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SafeVarargs - public static Single zipArray(@NonNull Function zipper, @NonNull SingleSource... sources) { + public static <@NonNull T, @NonNull R> Single zipArray(@NonNull Function zipper, @NonNull SingleSource... sources) { Objects.requireNonNull(zipper, "zipper is null"); Objects.requireNonNull(sources, "sources is null"); if (sources.length == 0) { @@ -2633,7 +2633,7 @@ public final Single hide() { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single compose(@NonNull SingleTransformer transformer) { + public final <@NonNull R> Single compose(@NonNull SingleTransformer transformer) { return wrap(((SingleTransformer) Objects.requireNonNull(transformer, "transformer is null")).apply(this)); } @@ -2676,7 +2676,7 @@ public final Single cache() { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single cast(@NonNull Class clazz) { + public final <@NonNull U> Single cast(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return map(Functions.castFunction(clazz)); } @@ -2704,7 +2704,7 @@ public final Single cast(@NonNull Class clazz) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single concatMap(@NonNull Function> mapper) { + public final <@NonNull R> Single concatMap(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMap<>(this, mapper)); } @@ -2759,7 +2759,7 @@ public final Completable concatMapCompletable(@NonNull Function Maybe concatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Maybe concatMapMaybe(@NonNull Function> mapper) { return flatMapMaybe(mapper); } @@ -2938,7 +2938,7 @@ public final Single delaySubscription(@NonNull CompletableSource subscription @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single delaySubscription(@NonNull SingleSource subscriptionIndicator) { + public final <@NonNull U> Single delaySubscription(@NonNull SingleSource subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new SingleDelayWithSingle<>(this, subscriptionIndicator)); } @@ -2964,7 +2964,7 @@ public final Single delaySubscription(@NonNull SingleSource subscripti @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single delaySubscription(@NonNull ObservableSource subscriptionIndicator) { + public final <@NonNull U> Single delaySubscription(@NonNull ObservableSource subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new SingleDelayWithObservable<>(this, subscriptionIndicator)); } @@ -2995,7 +2995,7 @@ public final Single delaySubscription(@NonNull ObservableSource subscr @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single delaySubscription(@NonNull Publisher subscriptionIndicator) { + public final <@NonNull U> Single delaySubscription(@NonNull Publisher subscriptionIndicator) { Objects.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugins.onAssembly(new SingleDelayWithPublisher<>(this, subscriptionIndicator)); } @@ -3385,7 +3385,7 @@ public final Maybe filter(@NonNull Predicate predicate) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single flatMap(@NonNull Function> mapper) { + public final <@NonNull R> Single flatMap(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMap<>(this, mapper)); } @@ -3417,7 +3417,7 @@ public final Single flatMap(@NonNull Function Single flatMap(@NonNull Function> mapper, + public final <@NonNull U, @NonNull R> Single flatMap(@NonNull Function> mapper, @NonNull BiFunction combiner) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(combiner, "combiner is null"); @@ -3448,7 +3448,7 @@ public final Single flatMap(@NonNull Function Single flatMap( + public final <@NonNull R> Single flatMap( @NonNull Function> onSuccessMapper, @NonNull Function> onErrorMapper) { Objects.requireNonNull(onSuccessMapper, "onSuccessMapper is null"); @@ -3476,7 +3476,7 @@ public final Single flatMap( @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe flatMapMaybe(@NonNull Function> mapper) { + public final <@NonNull R> Maybe flatMapMaybe(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMapMaybe<>(this, mapper)); } @@ -3506,7 +3506,7 @@ public final Maybe flatMapMaybe(@NonNull Function Flowable flatMapPublisher(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flatMapPublisher(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMapPublisher<>(this, mapper)); } @@ -3537,7 +3537,7 @@ public final Flowable flatMapPublisher(@NonNull Function Flowable flattenAsFlowable(@NonNull Function> mapper) { + public final <@NonNull U> Flowable flattenAsFlowable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMapIterableFlowable<>(this, mapper)); } @@ -3565,7 +3565,7 @@ public final Flowable flattenAsFlowable(@NonNull Function Observable flattenAsObservable(@NonNull Function<@NonNull ? super T, @NonNull ? extends Iterable<@NonNull ? extends U>> mapper) { + public final <@NonNull U> Observable flattenAsObservable(@NonNull Function<@NonNull ? super T, @NonNull ? extends Iterable> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlatMapIterableObservable<>(this, mapper)); } @@ -3892,7 +3892,7 @@ public final void blockingSubscribe(@NonNull SingleObserver observer) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single lift(@NonNull SingleOperator lift) { + public final <@NonNull R> Single lift(@NonNull SingleOperator lift) { Objects.requireNonNull(lift, "lift is null"); return RxJavaPlugins.onAssembly(new SingleLift<>(this, lift)); } @@ -4039,7 +4039,7 @@ public final Flowable mergeWith(@NonNull SingleSource other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe ofType(@NonNull Class clazz) { + public final <@NonNull U> Maybe ofType(@NonNull Class clazz) { Objects.requireNonNull(clazz, "clazz is null"); return filter(Functions.isInstanceOf(clazz)).cast(clazz); } @@ -4333,7 +4333,7 @@ public final Flowable repeat(long times) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Flowable repeatWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Flowable repeatWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return toFlowable().repeatWhen(handler); } @@ -4538,7 +4538,7 @@ public final Single retryUntil(@NonNull BooleanSupplier stop) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single retryWhen(@NonNull Function, ? extends Publisher<@NonNull ?>> handler) { + public final Single retryWhen(@NonNull Function, @NonNull ? extends Publisher<@NonNull ?>> handler) { return toSingle(toFlowable().retryWhen(handler)); } @@ -5211,7 +5211,7 @@ public final Single takeUntil(@NonNull CompletableSource other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single takeUntil(@NonNull Publisher other) { + public final <@NonNull E> Single takeUntil(@NonNull Publisher other) { Objects.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new SingleTakeUntil<>(this, other)); } @@ -5239,7 +5239,7 @@ public final Single takeUntil(@NonNull Publisher other) { @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) - public final Single takeUntil(@NonNull SingleSource other) { + public final <@NonNull E> Single takeUntil(@NonNull SingleSource other) { Objects.requireNonNull(other, "other is null"); return takeUntil(new SingleToFlowable(other)); } @@ -5529,7 +5529,7 @@ public final Single unsubscribeOn(@NonNull Scheduler scheduler) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final Single zipWith(@NonNull SingleSource other, @NonNull BiFunction zipper) { + public final <@NonNull U, @NonNull R> Single zipWith(@NonNull SingleSource other, @NonNull BiFunction zipper) { return zip(this, other, zipper); } @@ -5622,7 +5622,7 @@ private static Single toSingle(@NonNull Flowable source) { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public static Single<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { + public static <@NonNull T> Single<@NonNull T> fromCompletionStage(@NonNull CompletionStage stage) { Objects.requireNonNull(stage, "stage is null"); return RxJavaPlugins.onAssembly(new SingleFromCompletionStage<>(stage)); } @@ -5716,7 +5716,7 @@ public final CompletionStage toCompletionStage() { @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) @NonNull - public final Flowable flattenStreamAsFlowable(@NonNull Function> mapper) { + public final <@NonNull R> Flowable flattenStreamAsFlowable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlattenStreamAsFlowable<>(this, mapper)); } @@ -5757,7 +5757,7 @@ public final Flowable flattenStreamAsFlowable(@NonNull Function Observable flattenStreamAsObservable(@NonNull Function> mapper) { + public final <@NonNull R> Observable flattenStreamAsObservable(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new SingleFlattenStreamAsObservable<>(this, mapper)); } diff --git a/src/main/java/io/reactivex/rxjava3/internal/subscriptions/BasicIntQueueSubscription.java b/src/main/java/io/reactivex/rxjava3/internal/subscriptions/BasicIntQueueSubscription.java index 1922562340..ab4a6e749b 100644 --- a/src/main/java/io/reactivex/rxjava3/internal/subscriptions/BasicIntQueueSubscription.java +++ b/src/main/java/io/reactivex/rxjava3/internal/subscriptions/BasicIntQueueSubscription.java @@ -15,6 +15,7 @@ import java.util.concurrent.atomic.AtomicInteger; +import io.reactivex.rxjava3.annotations.NonNull; import io.reactivex.rxjava3.internal.fuseable.QueueSubscription; /** @@ -22,7 +23,7 @@ * * @param the value type */ -public abstract class BasicIntQueueSubscription extends AtomicInteger implements QueueSubscription { +public abstract class BasicIntQueueSubscription<@NonNull T> extends AtomicInteger implements QueueSubscription { private static final long serialVersionUID = -6671519529404341862L; diff --git a/src/main/java/io/reactivex/rxjava3/internal/subscriptions/DeferredScalarSubscription.java b/src/main/java/io/reactivex/rxjava3/internal/subscriptions/DeferredScalarSubscription.java index e941867b99..544fac8b58 100644 --- a/src/main/java/io/reactivex/rxjava3/internal/subscriptions/DeferredScalarSubscription.java +++ b/src/main/java/io/reactivex/rxjava3/internal/subscriptions/DeferredScalarSubscription.java @@ -15,7 +15,7 @@ import org.reactivestreams.Subscriber; -import io.reactivex.rxjava3.annotations.Nullable; +import io.reactivex.rxjava3.annotations.*; /** * A subscription that signals a single value eventually. @@ -33,7 +33,7 @@ * Where exclusively set means any other bits are 0 when that bit is set. * @param the value type */ -public class DeferredScalarSubscription extends BasicIntQueueSubscription { +public class DeferredScalarSubscription<@NonNull T> extends BasicIntQueueSubscription { private static final long serialVersionUID = -2151279923272604993L; diff --git a/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowable.java b/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowable.java index 4a02e8416d..8d5414d27c 100644 --- a/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowable.java +++ b/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowable.java @@ -59,7 +59,7 @@ public abstract class ParallelFlowable<@NonNull T> { */ @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) - public abstract void subscribe(@NonNull Subscriber<@NonNull ? super T>[] subscribers); + public abstract void subscribe(@NonNull Subscriber[] subscribers); /** * Returns the number of expected parallel {@link Subscriber}s. @@ -110,7 +110,7 @@ protected final boolean validate(@NonNull Subscriber<@NonNull ?>[] subscribers) @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static <@NonNull T> ParallelFlowable from(@NonNull Publisher<@NonNull ? extends T> source) { + public static <@NonNull T> ParallelFlowable from(@NonNull Publisher source) { return from(source, Runtime.getRuntime().availableProcessors(), Flowable.bufferSize()); } @@ -135,7 +135,7 @@ protected final boolean validate(@NonNull Subscriber<@NonNull ?>[] subscribers) @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static <@NonNull T> ParallelFlowable from(@NonNull Publisher<@NonNull ? extends T> source, int parallelism) { + public static <@NonNull T> ParallelFlowable from(@NonNull Publisher source, int parallelism) { return from(source, parallelism, Flowable.bufferSize()); } @@ -164,7 +164,7 @@ protected final boolean validate(@NonNull Subscriber<@NonNull ?>[] subscribers) @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.FULL) - public static <@NonNull T> ParallelFlowable from(@NonNull Publisher<@NonNull ? extends T> source, + public static <@NonNull T> ParallelFlowable from(@NonNull Publisher source, int parallelism, int prefetch) { Objects.requireNonNull(source, "source is null"); ObjectHelper.verifyPositive(parallelism, "parallelism"); @@ -193,7 +193,7 @@ protected final boolean validate(@NonNull Subscriber<@NonNull ?>[] subscribers) @NonNull @SchedulerSupport(SchedulerSupport.NONE) @BackpressureSupport(BackpressureKind.PASS_THROUGH) - public final ParallelFlowable map(@NonNull Function mapper) { + public final <@NonNull R> ParallelFlowable map(@NonNull Function mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ParallelMap<>(this, mapper)); } @@ -223,7 +223,7 @@ public final ParallelFlowable map(@NonNull Function ParallelFlowable map(@NonNull Function mapper, @NonNull ParallelFailureHandling errorHandler) { + public final <@NonNull R> ParallelFlowable map(@NonNull Function mapper, @NonNull ParallelFailureHandling errorHandler) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onAssembly(new ParallelMapTry<>(this, mapper, errorHandler)); @@ -255,7 +255,7 @@ public final ParallelFlowable map(@NonNull Function ParallelFlowable map(@NonNull Function mapper, @NonNull BiFunction errorHandler) { + public final <@NonNull R> ParallelFlowable map(@NonNull Function mapper, @NonNull BiFunction errorHandler) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onAssembly(new ParallelMapTry<>(this, mapper, errorHandler)); @@ -473,7 +473,7 @@ public final Flowable reduce(@NonNull BiFunction reducer) { @NonNull @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable reduce(@NonNull Supplier initialSupplier, @NonNull BiFunction reducer) { + public final <@NonNull R> ParallelFlowable reduce(@NonNull Supplier initialSupplier, @NonNull BiFunction reducer) { Objects.requireNonNull(initialSupplier, "initialSupplier is null"); Objects.requireNonNull(reducer, "reducer is null"); return RxJavaPlugins.onAssembly(new ParallelReduce<>(this, initialSupplier, reducer)); @@ -1044,7 +1044,7 @@ public final ParallelFlowable doOnCancel(@NonNull Action onCancel) { @NonNull @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable collect(@NonNull Supplier collectionSupplier, @NonNull BiConsumer collector) { + public final <@NonNull C> ParallelFlowable collect(@NonNull Supplier collectionSupplier, @NonNull BiConsumer collector) { Objects.requireNonNull(collectionSupplier, "collectionSupplier is null"); Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new ParallelCollect<>(this, collectionSupplier, collector)); @@ -1126,7 +1126,7 @@ public final ParallelFlowable collect(@NonNull Supplier coll @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable compose(@NonNull ParallelTransformer composer) { + public final <@NonNull U> ParallelFlowable compose(@NonNull ParallelTransformer composer) { return RxJavaPlugins.onAssembly(Objects.requireNonNull(composer, "composer is null").apply(this)); } @@ -1154,7 +1154,7 @@ public final ParallelFlowable compose(@NonNull ParallelTransformer @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable flatMap(@NonNull Function> mapper) { + public final <@NonNull R> ParallelFlowable flatMap(@NonNull Function> mapper) { return flatMap(mapper, false, Flowable.bufferSize(), Flowable.bufferSize()); } @@ -1184,8 +1184,8 @@ public final ParallelFlowable flatMap(@NonNull Function ParallelFlowable flatMap( - @NonNull Function> mapper, boolean delayError) { + public final <@NonNull R> ParallelFlowable flatMap( + @NonNull Function> mapper, boolean delayError) { return flatMap(mapper, delayError, Flowable.bufferSize(), Flowable.bufferSize()); } @@ -1218,8 +1218,8 @@ public final ParallelFlowable flatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable flatMap( - @NonNull Function> mapper, boolean delayError, int maxConcurrency) { + public final <@NonNull R> ParallelFlowable flatMap( + @NonNull Function> mapper, boolean delayError, int maxConcurrency) { return flatMap(mapper, delayError, maxConcurrency, Flowable.bufferSize()); } @@ -1252,8 +1252,8 @@ public final ParallelFlowable flatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable flatMap( - @NonNull Function> mapper, + public final <@NonNull R> ParallelFlowable flatMap( + @NonNull Function> mapper, boolean delayError, int maxConcurrency, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); @@ -1284,8 +1284,8 @@ public final ParallelFlowable flatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable concatMap( - @NonNull Function> mapper) { + public final <@NonNull R> ParallelFlowable concatMap( + @NonNull Function> mapper) { return concatMap(mapper, 2); } @@ -1315,8 +1315,8 @@ public final ParallelFlowable concatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable concatMap( - @NonNull Function> mapper, + public final <@NonNull R> ParallelFlowable concatMap( + @NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1348,8 +1348,8 @@ public final ParallelFlowable concatMap( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable concatMapDelayError( - @NonNull Function> mapper, + public final <@NonNull R> ParallelFlowable concatMapDelayError( + @NonNull Function> mapper, boolean tillTheEnd) { return concatMapDelayError(mapper, 2, tillTheEnd); } @@ -1381,8 +1381,8 @@ public final ParallelFlowable concatMapDelayError( @NonNull @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) - public final ParallelFlowable concatMapDelayError( - @NonNull Function> mapper, + public final <@NonNull R> ParallelFlowable concatMapDelayError( + @NonNull Function> mapper, int prefetch, boolean tillTheEnd) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); @@ -1419,7 +1419,7 @@ public final ParallelFlowable concatMapDelayError( @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @NonNull - public final ParallelFlowable flatMapIterable(@NonNull Function> mapper) { + public final <@NonNull U> ParallelFlowable flatMapIterable(@NonNull Function> mapper) { return flatMapIterable(mapper, Flowable.bufferSize()); } @@ -1455,7 +1455,7 @@ public final ParallelFlowable flatMapIterable(@NonNull Function ParallelFlowable flatMapIterable(@NonNull Function> mapper, int bufferSize) { + public final <@NonNull U> ParallelFlowable flatMapIterable(@NonNull Function> mapper, int bufferSize) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); return RxJavaPlugins.onAssembly(new ParallelFlatMapIterable<>(this, mapper, bufferSize)); @@ -1486,7 +1486,7 @@ public final ParallelFlowable flatMapIterable(@NonNull Function ParallelFlowable mapOptional(@NonNull Function> mapper) { + public final <@NonNull R> ParallelFlowable mapOptional(@NonNull Function> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return RxJavaPlugins.onAssembly(new ParallelMapOptional<>(this, mapper)); } @@ -1516,7 +1516,7 @@ public final ParallelFlowable mapOptional(@NonNull Function ParallelFlowable mapOptional(@NonNull Function> mapper, @NonNull ParallelFailureHandling errorHandler) { + public final <@NonNull R> ParallelFlowable mapOptional(@NonNull Function> mapper, @NonNull ParallelFailureHandling errorHandler) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onAssembly(new ParallelMapTryOptional<>(this, mapper, errorHandler)); @@ -1548,7 +1548,7 @@ public final ParallelFlowable mapOptional(@NonNull Function ParallelFlowable mapOptional(@NonNull Function> mapper, @NonNull BiFunction errorHandler) { + public final <@NonNull R> ParallelFlowable mapOptional(@NonNull Function> mapper, @NonNull BiFunction errorHandler) { Objects.requireNonNull(mapper, "mapper is null"); Objects.requireNonNull(errorHandler, "errorHandler is null"); return RxJavaPlugins.onAssembly(new ParallelMapTryOptional<>(this, mapper, errorHandler)); @@ -1604,7 +1604,7 @@ public final ParallelFlowable mapOptional(@NonNull Function ParallelFlowable flatMapStream(@NonNull Function> mapper) { + public final <@NonNull R> ParallelFlowable flatMapStream(@NonNull Function> mapper) { return flatMapStream(mapper, Flowable.bufferSize()); } @@ -1658,7 +1658,7 @@ public final ParallelFlowable mapOptional(@NonNull Function ParallelFlowable flatMapStream(@NonNull Function> mapper, int prefetch) { + public final <@NonNull R> ParallelFlowable flatMapStream(@NonNull Function> mapper, int prefetch) { Objects.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new ParallelFlatMapStream<>(this, mapper, prefetch)); @@ -1688,7 +1688,7 @@ public final ParallelFlowable mapOptional(@NonNull Function Flowable collect(@NonNull Collector collector) { + public final <@NonNull A, @NonNull R> Flowable collect(@NonNull Collector collector) { Objects.requireNonNull(collector, "collector is null"); return RxJavaPlugins.onAssembly(new ParallelCollector<>(this, collector)); } diff --git a/src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java b/src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java index 58cb730bf6..506fb65c67 100644 --- a/src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java +++ b/src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java @@ -96,26 +96,26 @@ public final class RxJavaPlugins { @SuppressWarnings("rawtypes") @Nullable - static volatile BiFunction onFlowableSubscribe; + static volatile BiFunction onFlowableSubscribe; @SuppressWarnings("rawtypes") @Nullable - static volatile BiFunction onMaybeSubscribe; + static volatile BiFunction onMaybeSubscribe; @SuppressWarnings("rawtypes") @Nullable - static volatile BiFunction onObservableSubscribe; + static volatile BiFunction onObservableSubscribe; @SuppressWarnings("rawtypes") @Nullable - static volatile BiFunction onSingleSubscribe; + static volatile BiFunction onSingleSubscribe; @Nullable - static volatile BiFunction onCompletableSubscribe; + static volatile BiFunction onCompletableSubscribe; @SuppressWarnings("rawtypes") @Nullable - static volatile BiFunction onParallelSubscribe; + static volatile BiFunction onParallelSubscribe; @Nullable static volatile BooleanSupplier onBeforeBlocking; @@ -667,7 +667,7 @@ public static void setSingleSchedulerHandler(@Nullable Function getOnCompletableSubscribe() { + public static BiFunction getOnCompletableSubscribe() { return onCompletableSubscribe; } @@ -697,7 +697,7 @@ public static void setSingleSchedulerHandler(@Nullable Function getOnFlowableSubscribe() { + public static BiFunction getOnFlowableSubscribe() { return onFlowableSubscribe; } @@ -707,7 +707,7 @@ public static void setSingleSchedulerHandler(@Nullable Function getOnMaybeSubscribe() { + public static BiFunction getOnMaybeSubscribe() { return onMaybeSubscribe; } @@ -737,7 +737,7 @@ public static void setSingleSchedulerHandler(@Nullable Function getOnSingleSubscribe() { + public static BiFunction getOnSingleSubscribe() { return onSingleSubscribe; } @@ -767,7 +767,7 @@ public static void setSingleSchedulerHandler(@Nullable Function getOnObservableSubscribe() { + public static BiFunction getOnObservableSubscribe() { return onObservableSubscribe; } @@ -787,7 +787,7 @@ public static void setOnCompletableAssembly(@Nullable Function onCompletableSubscribe) { + @Nullable BiFunction onCompletableSubscribe) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -835,7 +835,7 @@ public static void setOnConnectableFlowableAssembly(@Nullable Function onFlowableSubscribe) { + public static void setOnFlowableSubscribe(@Nullable BiFunction onFlowableSubscribe) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -847,7 +847,7 @@ public static void setOnFlowableSubscribe(@Nullable BiFunction onMaybeSubscribe) { + public static void setOnMaybeSubscribe(@Nullable BiFunction onMaybeSubscribe) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -884,7 +884,7 @@ public static void setOnConnectableObservableAssembly(@Nullable Function onObservableSubscribe) { + @Nullable BiFunction onObservableSubscribe) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -908,7 +908,7 @@ public static void setOnSingleAssembly(@Nullable Function onSingleSubscribe) { + public static void setOnSingleSubscribe(@Nullable BiFunction onSingleSubscribe) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -924,8 +924,8 @@ public static void setOnSingleSubscribe(@Nullable BiFunction Subscriber<@NonNull ? super T> onSubscribe(@NonNull Flowable source, @NonNull Subscriber<@NonNull ? super T> subscriber) { - BiFunction f = onFlowableSubscribe; + public static <@NonNull T> Subscriber onSubscribe(@NonNull Flowable source, @NonNull Subscriber subscriber) { + BiFunction f = onFlowableSubscribe; if (f != null) { return apply(f, source, subscriber); } @@ -941,8 +941,8 @@ public static void setOnSingleSubscribe(@Nullable BiFunction Observer onSubscribe(@NonNull Observable source, @NonNull Observer observer) { - BiFunction f = onObservableSubscribe; + public static <@NonNull T> Observer onSubscribe(@NonNull Observable source, @NonNull Observer observer) { + BiFunction f = onObservableSubscribe; if (f != null) { return apply(f, source, observer); } @@ -958,8 +958,8 @@ public static Observer onSubscribe(@NonNull Observable source, */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static SingleObserver onSubscribe(@NonNull Single source, @NonNull SingleObserver observer) { - BiFunction f = onSingleSubscribe; + public static <@NonNull T> SingleObserver onSubscribe(@NonNull Single source, @NonNull SingleObserver observer) { + BiFunction f = onSingleSubscribe; if (f != null) { return apply(f, source, observer); } @@ -974,7 +974,7 @@ public static SingleObserver onSubscribe(@NonNull Single sourc */ @NonNull public static CompletableObserver onSubscribe(@NonNull Completable source, @NonNull CompletableObserver observer) { - BiFunction f = onCompletableSubscribe; + BiFunction f = onCompletableSubscribe; if (f != null) { return apply(f, source, observer); } @@ -990,8 +990,8 @@ public static CompletableObserver onSubscribe(@NonNull Completable source, @NonN */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static MaybeObserver onSubscribe(@NonNull Maybe source, @NonNull MaybeObserver observer) { - BiFunction f = onMaybeSubscribe; + public static <@NonNull T> MaybeObserver onSubscribe(@NonNull Maybe source, @NonNull MaybeObserver observer) { + BiFunction f = onMaybeSubscribe; if (f != null) { return apply(f, source, observer); } @@ -1007,8 +1007,8 @@ public static MaybeObserver onSubscribe(@NonNull Maybe source, */ @SuppressWarnings({ "rawtypes" }) @NonNull - public static Subscriber<@NonNull ? super T>[] onSubscribe(@NonNull ParallelFlowable source, @NonNull Subscriber<@NonNull ? super T>[] subscribers) { - BiFunction f = onParallelSubscribe; + public static <@NonNull T> Subscriber[] onSubscribe(@NonNull ParallelFlowable source, @NonNull Subscriber[] subscribers) { + BiFunction f = onParallelSubscribe; if (f != null) { return apply(f, source, subscribers); } @@ -1023,7 +1023,7 @@ public static MaybeObserver onSubscribe(@NonNull Maybe source, */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static Maybe onAssembly(@NonNull Maybe source) { + public static <@NonNull T> Maybe onAssembly(@NonNull Maybe source) { Function f = onMaybeAssembly; if (f != null) { return apply(f, source); @@ -1039,7 +1039,7 @@ public static Maybe onAssembly(@NonNull Maybe source) { */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static Flowable onAssembly(@NonNull Flowable source) { + public static <@NonNull T> Flowable onAssembly(@NonNull Flowable source) { Function f = onFlowableAssembly; if (f != null) { return apply(f, source); @@ -1055,7 +1055,7 @@ public static Flowable onAssembly(@NonNull Flowable source) { */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static ConnectableFlowable onAssembly(@NonNull ConnectableFlowable source) { + public static <@NonNull T> ConnectableFlowable onAssembly(@NonNull ConnectableFlowable source) { Function f = onConnectableFlowableAssembly; if (f != null) { return apply(f, source); @@ -1071,7 +1071,7 @@ public static ConnectableFlowable onAssembly(@NonNull ConnectableFlowable */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static Observable onAssembly(@NonNull Observable source) { + public static <@NonNull T> Observable onAssembly(@NonNull Observable source) { Function f = onObservableAssembly; if (f != null) { return apply(f, source); @@ -1087,7 +1087,7 @@ public static Observable onAssembly(@NonNull Observable source) { */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static ConnectableObservable onAssembly(@NonNull ConnectableObservable source) { + public static <@NonNull T> ConnectableObservable onAssembly(@NonNull ConnectableObservable source) { Function f = onConnectableObservableAssembly; if (f != null) { return apply(f, source); @@ -1103,7 +1103,7 @@ public static ConnectableObservable onAssembly(@NonNull ConnectableObserv */ @SuppressWarnings({ "rawtypes", "unchecked" }) @NonNull - public static Single onAssembly(@NonNull Single source) { + public static <@NonNull T> Single onAssembly(@NonNull Single source) { Function f = onSingleAssembly; if (f != null) { return apply(f, source); @@ -1158,7 +1158,7 @@ public static void setOnParallelAssembly(@Nullable Function handler) { + public static void setOnParallelSubscribe(@Nullable BiFunction handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } @@ -1173,7 +1173,7 @@ public static void setOnParallelSubscribe(@Nullable BiFunction getOnParallelSubscribe() { + public static BiFunction getOnParallelSubscribe() { return onParallelSubscribe; } @@ -1187,7 +1187,7 @@ public static void setOnParallelSubscribe(@Nullable BiFunction ParallelFlowable onAssembly(@NonNull ParallelFlowable source) { + public static <@NonNull T> ParallelFlowable onAssembly(@NonNull ParallelFlowable source) { Function f = onParallelAssembly; if (f != null) { return apply(f, source); @@ -1312,7 +1312,7 @@ public static Scheduler createSingleScheduler(@NonNull ThreadFactory threadFacto * @return the result of the function call */ @NonNull - static R apply(@NonNull Function f, @NonNull T t) { + static <@NonNull T, @NonNull R> R apply(@NonNull Function f, @NonNull T t) { try { return f.apply(t); } catch (Throwable ex) { @@ -1332,7 +1332,7 @@ static R apply(@NonNull Function f, @NonNull T t) { * @return the result of the function call */ @NonNull - static R apply(@NonNull BiFunction f, @NonNull T t, @NonNull U u) { + static <@NonNull T, @NonNull U, @NonNull R> R apply(@NonNull BiFunction f, @NonNull T t, @NonNull U u) { try { return f.apply(t, u); } catch (Throwable ex) { diff --git a/src/main/java/io/reactivex/rxjava3/processors/AsyncProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/AsyncProcessor.java index 12a96ad5ae..b20c8b23ae 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/AsyncProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/AsyncProcessor.java @@ -114,7 +114,7 @@ * * @param the value type */ -public final class AsyncProcessor extends FlowableProcessor { +public final class AsyncProcessor<@NonNull T> extends FlowableProcessor { @SuppressWarnings("rawtypes") static final AsyncSubscription[] EMPTY = new AsyncSubscription[0]; @@ -229,7 +229,7 @@ public Throwable getThrowable() { } @Override - protected void subscribeActual(@NonNull Subscriber<@NonNull ? super T> s) { + protected void subscribeActual(@NonNull Subscriber s) { AsyncSubscription as = new AsyncSubscription<>(s, this); s.onSubscribe(as); if (add(as)) { @@ -337,12 +337,12 @@ public T getValue() { return subscribers.get() == TERMINATED ? value : null; } - static final class AsyncSubscription extends DeferredScalarSubscription { + static final class AsyncSubscription<@NonNull T> extends DeferredScalarSubscription { private static final long serialVersionUID = 5629876084736248016L; final AsyncProcessor parent; - AsyncSubscription(Subscriber<@NonNull ? super T> actual, AsyncProcessor parent) { + AsyncSubscription(Subscriber actual, AsyncProcessor parent) { super(actual); this.parent = parent; } diff --git a/src/main/java/io/reactivex/rxjava3/processors/BehaviorProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/BehaviorProcessor.java index 681d605228..56c9d881f0 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/BehaviorProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/BehaviorProcessor.java @@ -160,7 +160,7 @@ * @param * the type of item expected to be observed and emitted by the Processor */ -public final class BehaviorProcessor extends FlowableProcessor { +public final class BehaviorProcessor<@NonNull T> extends FlowableProcessor { final AtomicReference[]> subscribers; static final Object[] EMPTY_ARRAY = new Object[0]; @@ -239,7 +239,7 @@ public static BehaviorProcessor create() { } @Override - protected void subscribeActual(@NonNull Subscriber<@NonNull ? super T> s) { + protected void subscribeActual(@NonNull Subscriber s) { BehaviorSubscription bs = new BehaviorSubscription<>(s, this); s.onSubscribe(bs); if (add(bs)) { @@ -472,7 +472,7 @@ static final class BehaviorSubscription<@NonNull T> extends AtomicLong implement private static final long serialVersionUID = 3293175281126227086L; - final Subscriber<@NonNull ? super T> downstream; + final Subscriber downstream; final BehaviorProcessor state; boolean next; @@ -485,7 +485,7 @@ static final class BehaviorSubscription<@NonNull T> extends AtomicLong implement long index; - BehaviorSubscription(Subscriber<@NonNull ? super T> actual, BehaviorProcessor state) { + BehaviorSubscription(Subscriber actual, BehaviorProcessor state) { this.downstream = actual; this.state = state; } diff --git a/src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java index 55e19f7d1e..a3200346d3 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/MulticastProcessor.java @@ -130,7 +130,7 @@ */ @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) -public final class MulticastProcessor extends FlowableProcessor { +public final class MulticastProcessor<@NonNull T> extends FlowableProcessor { final AtomicInteger wip; @@ -370,7 +370,7 @@ public Throwable getThrowable() { } @Override - protected void subscribeActual(@NonNull Subscriber<@NonNull ? super T> s) { + protected void subscribeActual(@NonNull Subscriber s) { MulticastSubscription ms = new MulticastSubscription<>(s, this); s.onSubscribe(ms); if (add(ms)) { @@ -584,17 +584,17 @@ void drain() { } } - static final class MulticastSubscription extends AtomicLong implements Subscription { + static final class MulticastSubscription<@NonNull T> extends AtomicLong implements Subscription { private static final long serialVersionUID = -363282618957264509L; - final Subscriber<@NonNull ? super T> downstream; + final Subscriber downstream; final MulticastProcessor parent; long emitted; - MulticastSubscription(Subscriber<@NonNull ? super T> actual, MulticastProcessor parent) { + MulticastSubscription(Subscriber actual, MulticastProcessor parent) { this.downstream = actual; this.parent = parent; } diff --git a/src/main/java/io/reactivex/rxjava3/processors/PublishProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/PublishProcessor.java index c02a0e937e..79f38a06ec 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/PublishProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/PublishProcessor.java @@ -107,7 +107,7 @@ * @param the value type multicasted to Subscribers. * @see MulticastProcessor */ -public final class PublishProcessor extends FlowableProcessor { +public final class PublishProcessor<@NonNull T> extends FlowableProcessor { /** The terminated indicator for the subscribers array. */ @SuppressWarnings("rawtypes") static final PublishSubscription[] TERMINATED = new PublishSubscription[0]; @@ -142,7 +142,7 @@ public static PublishProcessor create() { } @Override - protected void subscribeActual(@NonNull Subscriber<@NonNull ? super T> t) { + protected void subscribeActual(@NonNull Subscriber t) { PublishSubscription ps = new PublishSubscription<>(t, this); t.onSubscribe(ps); if (add(ps)) { @@ -341,7 +341,7 @@ static final class PublishSubscription<@NonNull T> extends AtomicLong implements private static final long serialVersionUID = 3562861878281475070L; /** The actual subscriber. */ - final Subscriber<@NonNull ? super T> downstream; + final Subscriber downstream; /** The parent processor servicing this subscriber. */ final PublishProcessor parent; @@ -350,7 +350,7 @@ static final class PublishSubscription<@NonNull T> extends AtomicLong implements * @param actual the actual subscriber * @param parent the parent PublishProcessor */ - PublishSubscription(Subscriber<@NonNull ? super T> actual, PublishProcessor parent) { + PublishSubscription(Subscriber actual, PublishProcessor parent) { this.downstream = actual; this.parent = parent; } diff --git a/src/main/java/io/reactivex/rxjava3/processors/ReplayProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/ReplayProcessor.java index 1a0fdfebfb..ae6a7d3960 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/ReplayProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/ReplayProcessor.java @@ -141,7 +141,7 @@ * * @param the value type */ -public final class ReplayProcessor extends FlowableProcessor { +public final class ReplayProcessor<@NonNull T> extends FlowableProcessor { /** An empty array to avoid allocation in getValues(). */ private static final Object[] EMPTY_ARRAY = new Object[0]; @@ -345,7 +345,7 @@ public static ReplayProcessor createWithTimeAndSize(long maxAge, @NonNull } @Override - protected void subscribeActual(Subscriber<@NonNull ? super T> s) { + protected void subscribeActual(Subscriber s) { ReplaySubscription rs = new ReplaySubscription<>(s, this); s.onSubscribe(rs); @@ -584,7 +584,7 @@ void remove(ReplaySubscription rs) { * * @param the value type */ - interface ReplayBuffer { + interface ReplayBuffer<@NonNull T> { void next(T value); @@ -612,10 +612,10 @@ interface ReplayBuffer { void trimHead(); } - static final class ReplaySubscription extends AtomicInteger implements Subscription { + static final class ReplaySubscription<@NonNull T> extends AtomicInteger implements Subscription { private static final long serialVersionUID = 466549804534799122L; - final Subscriber<@NonNull ? super T> downstream; + final Subscriber downstream; final ReplayProcessor state; Object index; @@ -626,7 +626,7 @@ static final class ReplaySubscription extends AtomicInteger implements Subscr long emitted; - ReplaySubscription(Subscriber<@NonNull ? super T> actual, ReplayProcessor state) { + ReplaySubscription(Subscriber actual, ReplayProcessor state) { this.downstream = actual; this.state = state; this.requested = new AtomicLong(); @@ -728,7 +728,7 @@ public void replay(ReplaySubscription rs) { int missed = 1; final List b = buffer; - final Subscriber<@NonNull ? super T> a = rs.downstream; + final Subscriber a = rs.downstream; Integer indexObject = (Integer)rs.index; int index; @@ -846,7 +846,7 @@ static final class TimedNode extends AtomicReference> { } } - static final class SizeBoundReplayBuffer + static final class SizeBoundReplayBuffer<@NonNull T> implements ReplayBuffer { final int maxSize; @@ -967,7 +967,7 @@ public void replay(ReplaySubscription rs) { } int missed = 1; - final Subscriber<@NonNull ? super T> a = rs.downstream; + final Subscriber a = rs.downstream; Node index = (Node)rs.index; if (index == null) { @@ -1253,7 +1253,7 @@ public void replay(ReplaySubscription rs) { } int missed = 1; - final Subscriber<@NonNull ? super T> a = rs.downstream; + final Subscriber a = rs.downstream; TimedNode index = (TimedNode)rs.index; if (index == null) { diff --git a/src/main/java/io/reactivex/rxjava3/processors/UnicastProcessor.java b/src/main/java/io/reactivex/rxjava3/processors/UnicastProcessor.java index 6ba938e9e4..60cc033bd6 100644 --- a/src/main/java/io/reactivex/rxjava3/processors/UnicastProcessor.java +++ b/src/main/java/io/reactivex/rxjava3/processors/UnicastProcessor.java @@ -147,7 +147,7 @@ * @param the value type received and emitted by this Processor subclass * @since 2.0 */ -public final class UnicastProcessor extends FlowableProcessor { +public final class UnicastProcessor<@NonNull T> extends FlowableProcessor { final SpscLinkedArrayQueue queue; @@ -159,7 +159,7 @@ public final class UnicastProcessor extends FlowableProcessor { Throwable error; - final AtomicReference> downstream; + final AtomicReference> downstream; volatile boolean cancelled; @@ -282,7 +282,7 @@ void doTerminate() { } } - void drainRegular(Subscriber<@NonNull ? super T> a) { + void drainRegular(Subscriber a) { int missed = 1; final SpscLinkedArrayQueue q = queue; @@ -326,7 +326,7 @@ void drainRegular(Subscriber<@NonNull ? super T> a) { } } - void drainFused(Subscriber<@NonNull ? super T> a) { + void drainFused(Subscriber a) { int missed = 1; final SpscLinkedArrayQueue q = queue; @@ -374,7 +374,7 @@ void drain() { int missed = 1; - Subscriber<@NonNull ? super T> a = downstream.get(); + Subscriber a = downstream.get(); for (;;) { if (a != null) { @@ -394,7 +394,7 @@ void drain() { } } - boolean checkTerminated(boolean failFast, boolean d, boolean empty, Subscriber<@NonNull ? super T> a, SpscLinkedArrayQueue q) { + boolean checkTerminated(boolean failFast, boolean d, boolean empty, Subscriber a, SpscLinkedArrayQueue q) { if (cancelled) { q.clear(); downstream.lazySet(null); @@ -475,7 +475,7 @@ public void onComplete() { } @Override - protected void subscribeActual(Subscriber<@NonNull ? super T> s) { + protected void subscribeActual(Subscriber s) { if (!once.get() && once.compareAndSet(false, true)) { s.onSubscribe(wip); diff --git a/src/main/java/io/reactivex/rxjava3/subscribers/SafeSubscriber.java b/src/main/java/io/reactivex/rxjava3/subscribers/SafeSubscriber.java index 8556d847ba..f66c34b9b9 100644 --- a/src/main/java/io/reactivex/rxjava3/subscribers/SafeSubscriber.java +++ b/src/main/java/io/reactivex/rxjava3/subscribers/SafeSubscriber.java @@ -28,7 +28,7 @@ * * @param the value type */ -public final class SafeSubscriber implements FlowableSubscriber, Subscription { +public final class SafeSubscriber<@NonNull T> implements FlowableSubscriber, Subscription { /** The actual Subscriber. */ final Subscriber downstream; /** The subscription. */ diff --git a/src/test/java/io/reactivex/rxjava3/validators/NonNullMethodTypeArgumentCheck.java b/src/test/java/io/reactivex/rxjava3/validators/NonNullMethodTypeArgumentCheck.java new file mode 100644 index 0000000000..f0abb5b23e --- /dev/null +++ b/src/test/java/io/reactivex/rxjava3/validators/NonNullMethodTypeArgumentCheck.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2016-present, RxJava Contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See + * the License for the specific language governing permissions and limitations under the License. + */ + +package io.reactivex.rxjava3.validators; + +import static org.junit.Assert.assertEquals; + +import java.io.*; +import java.nio.file.Files; +import java.util.*; + +import org.junit.Test; + +import io.reactivex.rxjava3.core.*; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.parallel.ParallelFlowable; +import io.reactivex.rxjava3.plugins.RxJavaPlugins; +import io.reactivex.rxjava3.testsupport.TestHelper; + +/** + * Verify static methods and final methods declaring type arguments + * declare {@code @NonNull} for said argument. + * + */ +public class NonNullMethodTypeArgumentCheck { + + static void process(Class clazz) { + + String className = clazz.getSimpleName(); + String parentPackage = clazz.getPackage().getName(); + + StringBuilder result = new StringBuilder(); + int count = 0; + + try { + File f = TestHelper.findSource(className, parentPackage); + + try (BufferedReader in = Files.newBufferedReader(f.toPath())) { + int lineCount = 1; + String line = null; + + while ((line = in.readLine()) != null) { + line = line.trim(); + + if (!line.contains(" to(")) { + if (line.startsWith("public static <") || line.startsWith("public final <")) { + + for (String ta : parseTypeArguments(line)) { + if (!ta.startsWith("@NonNull") && !ta.startsWith("@Nullable")) { + result.append("Missing annotation on argument ").append(ta).append("\r\nat ") + .append(parentPackage).append(".").append(className).append(".method(") + .append(className).append(".java:").append(lineCount).append(")\r\n"); + count++; + } + } + } + } + lineCount++; + } + } + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + if (count != 0) { + throw new IllegalArgumentException("Found " + count + " cases\r\n" + result.toString()); + } + } + + static List parseTypeArguments(String line) { + List result = new ArrayList<>(); + int offset = line.indexOf("<"); + int c = 1; + int i = offset + 1; + int j = i; + for (; i < line.length(); i++) { + if (line.charAt(i) == '<') { + c++; + } else + if (line.charAt(i) == '>') { + c--; + if (c == 0) { + break; + } + } else + if (line.charAt(i) == ',' && c == 1) { + result.add(line.substring(j, i).trim()); + j = i + 1; + } + } + result.add(line.substring(j, i).trim()); + return result; + } + + @Test + public void parseTypeArguments() { + assertEquals(new ArrayList<>(Arrays.asList("T")), parseTypeArguments("")); + assertEquals(new ArrayList<>(Arrays.asList("T", "U")), parseTypeArguments("")); + assertEquals(new ArrayList<>(Arrays.asList("T", "Flowable")), parseTypeArguments(">")); + assertEquals(new ArrayList<>(Arrays.asList("T", "Flowable")), parseTypeArguments(">")); + } + + @Test + public void flowable() { + process(Flowable.class); + } + + @Test + public void observable() { + process(Observable.class); + } + + @Test + public void maybe() { + process(Maybe.class); + } + + @Test + public void single() { + process(Single.class); + } + + @Test + public void completable() { + process(Completable.class); + } + + @Test + public void parallel() { + process(ParallelFlowable.class); + } + + @Test + public void plugins() { + process(RxJavaPlugins.class); + } +} diff --git a/src/test/java/io/reactivex/rxjava3/validators/SourceAnnotationCheck.java b/src/test/java/io/reactivex/rxjava3/validators/SourceAnnotationCheck.java index ee04efa28c..dfa4aea548 100644 --- a/src/test/java/io/reactivex/rxjava3/validators/SourceAnnotationCheck.java +++ b/src/test/java/io/reactivex/rxjava3/validators/SourceAnnotationCheck.java @@ -385,7 +385,9 @@ else if (skippingDepth == 0) { for (String typeName : TYPES_REQUIRING_NONNULL_TYPEARG) { String pattern = typeName + ".*"; + if (line.contains(pattern) && !line.matches(patternRegex)) { + errorCount++; errors.append("L") .append(j) @@ -402,6 +404,45 @@ else if (skippingDepth == 0) { ; } } + for (String typeName : TYPES_FORBIDDEN_NONNULL_TYPEARG) { + String patternRegex = ".*" + typeName + "\\<@NonNull (\\? (extends|super) )?" + COMMON_TYPE_ARG_NAMES + "\\>.*"; + + if (line.matches(patternRegex)) { + errorCount++; + errors.append("L") + .append(j) + .append(" : @NonNull type argument should be on the arg declaration ") + .append(typeName) + .append("\r\n") + .append(" at ") + .append(fullClassName) + .append(".method(") + .append(f.getName()) + .append(":") + .append(j + 1) + .append(")\r\n") + ; + } + } + + for (String typeName : TYPES_REQUIRING_NONNULL_TYPEARG_ON_FUNC) { + if (line.matches(".*Function[\\d]?\\<.*, (\\? (extends|super) )?" + typeName + ".*")) { + errorCount++; + errors.append("L") + .append(j) + .append(" : Missing @NonNull type argument annotation on Function argument ") + .append(typeName) + .append("\r\n") + .append(" at ") + .append(fullClassName) + .append(".method(") + .append(f.getName()) + .append(":") + .append(j + 1) + .append(")\r\n") + ; + } + } } if (errorCount != 0) { @@ -445,6 +486,16 @@ else if (skippingDepth == 0) { ); static final List TYPES_REQUIRING_NONNULL_TYPEARG = Arrays.asList( - "Iterable", "Stream", "Publisher", "Subscriber", "Processor" + "Iterable", "Stream", "Publisher", "Processor", "Subscriber", "Optional" ); + static final List TYPES_FORBIDDEN_NONNULL_TYPEARG = Arrays.asList( + "Iterable", "Stream", "Publisher", "Processor", "Subscriber", "Optional" + ); + + static final List TYPES_REQUIRING_NONNULL_TYPEARG_ON_FUNC = Arrays.asList( + "Iterable", "Stream", "Publisher", "Processor", "Subscriber", "Optional", + "Observer", "SingleObserver", "MaybeObserver", "CompletableObserver" + ); + + static final String COMMON_TYPE_ARG_NAMES = "([A-Z][0-9]?|TOpening|TClosing|TLeft|TLeftEnd|TRight|TRightEnd)"; }