diff --git a/src/main/java/io/reactivex/rxjava3/core/CompletableConverter.java b/src/main/java/io/reactivex/rxjava3/core/CompletableConverter.java index 6ef04e2608..c1229ff7a2 100644 --- a/src/main/java/io/reactivex/rxjava3/core/CompletableConverter.java +++ b/src/main/java/io/reactivex/rxjava3/core/CompletableConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link Completable#to} operator to turn a Completable into another * value fluently. @@ -22,7 +24,8 @@ * @param the output type * @since 2.2 */ -public interface CompletableConverter { +@FunctionalInterface +public interface CompletableConverter extends Function { /** * Applies a function to the upstream Completable and returns a converted value of type {@code R}. * @@ -30,5 +33,6 @@ public interface CompletableConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull Completable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/CompletableOnSubscribe.java b/src/main/java/io/reactivex/rxjava3/core/CompletableOnSubscribe.java index 8dc2531997..6aea056be7 100644 --- a/src/main/java/io/reactivex/rxjava3/core/CompletableOnSubscribe.java +++ b/src/main/java/io/reactivex/rxjava3/core/CompletableOnSubscribe.java @@ -19,6 +19,7 @@ * an instance of a {@link CompletableEmitter} instance that allows pushing * an event in a cancellation-safe manner. */ +@FunctionalInterface public interface CompletableOnSubscribe { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/CompletableOperator.java b/src/main/java/io/reactivex/rxjava3/core/CompletableOperator.java index 3a45c9085f..763cd670c6 100644 --- a/src/main/java/io/reactivex/rxjava3/core/CompletableOperator.java +++ b/src/main/java/io/reactivex/rxjava3/core/CompletableOperator.java @@ -18,6 +18,7 @@ /** * Interface to map/wrap a downstream observer to an upstream observer. */ +@FunctionalInterface public interface CompletableOperator { /** * Applies a function to the child CompletableObserver and returns a new parent CompletableObserver. diff --git a/src/main/java/io/reactivex/rxjava3/core/CompletableSource.java b/src/main/java/io/reactivex/rxjava3/core/CompletableSource.java index 390be60b2e..9b754a698a 100644 --- a/src/main/java/io/reactivex/rxjava3/core/CompletableSource.java +++ b/src/main/java/io/reactivex/rxjava3/core/CompletableSource.java @@ -20,6 +20,7 @@ * * @since 2.0 */ +@FunctionalInterface public interface CompletableSource { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/CompletableTransformer.java b/src/main/java/io/reactivex/rxjava3/core/CompletableTransformer.java index b6acc252b0..7eb4ee65de 100644 --- a/src/main/java/io/reactivex/rxjava3/core/CompletableTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/core/CompletableTransformer.java @@ -15,16 +15,20 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the compose operator to turn a Completable into another * Completable fluently. */ -public interface CompletableTransformer { +@FunctionalInterface +public interface CompletableTransformer extends Function { /** * Applies a function to the upstream Completable and returns a CompletableSource. * @param upstream the upstream Completable instance * @return the transformed CompletableSource instance */ @NonNull + @Override CompletableSource apply(@NonNull Completable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/FlowableConverter.java b/src/main/java/io/reactivex/rxjava3/core/FlowableConverter.java index 0736dc189d..a3907843dd 100644 --- a/src/main/java/io/reactivex/rxjava3/core/FlowableConverter.java +++ b/src/main/java/io/reactivex/rxjava3/core/FlowableConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link Flowable#to} operator to turn a Flowable into another * value fluently. @@ -23,7 +25,8 @@ * @param the output type * @since 2.2 */ -public interface FlowableConverter { +@FunctionalInterface +public interface FlowableConverter extends Function, R> { /** * Applies a function to the upstream Flowable and returns a converted value of type {@code R}. * @@ -31,5 +34,6 @@ public interface FlowableConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull Flowable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/FlowableOnSubscribe.java b/src/main/java/io/reactivex/rxjava3/core/FlowableOnSubscribe.java index 93d125de2f..2bbc8b57a3 100644 --- a/src/main/java/io/reactivex/rxjava3/core/FlowableOnSubscribe.java +++ b/src/main/java/io/reactivex/rxjava3/core/FlowableOnSubscribe.java @@ -21,6 +21,7 @@ * * @param the value type pushed */ +@FunctionalInterface public interface FlowableOnSubscribe { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/FlowableOperator.java b/src/main/java/io/reactivex/rxjava3/core/FlowableOperator.java index 8ce0ab8f7d..6d241f7498 100644 --- a/src/main/java/io/reactivex/rxjava3/core/FlowableOperator.java +++ b/src/main/java/io/reactivex/rxjava3/core/FlowableOperator.java @@ -23,6 +23,7 @@ * @param the value type of the downstream * @param the value type of the upstream */ +@FunctionalInterface public interface FlowableOperator { /** * Applies a function to the child Subscriber and returns a new parent Subscriber. diff --git a/src/main/java/io/reactivex/rxjava3/core/FlowableTransformer.java b/src/main/java/io/reactivex/rxjava3/core/FlowableTransformer.java index ecee751040..4eff5e8c9a 100644 --- a/src/main/java/io/reactivex/rxjava3/core/FlowableTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/core/FlowableTransformer.java @@ -17,13 +17,16 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Interface to compose Flowables. * * @param the upstream value type * @param the downstream value type */ -public interface FlowableTransformer { +@FunctionalInterface +public interface FlowableTransformer extends Function, Publisher> { /** * Applies a function to the upstream Flowable and returns a Publisher with * optionally different element type. @@ -31,5 +34,6 @@ public interface FlowableTransformer { * @return the transformed Publisher instance */ @NonNull + @Override Publisher apply(@NonNull Flowable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/MaybeConverter.java b/src/main/java/io/reactivex/rxjava3/core/MaybeConverter.java index de70b81814..fd79eb3afe 100644 --- a/src/main/java/io/reactivex/rxjava3/core/MaybeConverter.java +++ b/src/main/java/io/reactivex/rxjava3/core/MaybeConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link Maybe#to} operator to turn a Maybe into another * value fluently. @@ -23,7 +25,8 @@ * @param the output type * @since 2.2 */ -public interface MaybeConverter { +@FunctionalInterface +public interface MaybeConverter extends Function, R> { /** * Applies a function to the upstream Maybe and returns a converted value of type {@code R}. * @@ -31,5 +34,6 @@ public interface MaybeConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull Maybe upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/MaybeOnSubscribe.java b/src/main/java/io/reactivex/rxjava3/core/MaybeOnSubscribe.java index dbccf870f9..2dde118757 100644 --- a/src/main/java/io/reactivex/rxjava3/core/MaybeOnSubscribe.java +++ b/src/main/java/io/reactivex/rxjava3/core/MaybeOnSubscribe.java @@ -21,6 +21,7 @@ * * @param the value type pushed */ +@FunctionalInterface public interface MaybeOnSubscribe { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java b/src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java index b3173eb833..48039a9bd0 100644 --- a/src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java +++ b/src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java @@ -20,6 +20,7 @@ * @param the value type of the downstream * @param the value type of the upstream */ +@FunctionalInterface public interface MaybeOperator { /** * Applies a function to the child MaybeObserver and returns a new parent MaybeObserver. diff --git a/src/main/java/io/reactivex/rxjava3/core/MaybeSource.java b/src/main/java/io/reactivex/rxjava3/core/MaybeSource.java index dd037cc864..17e2b7f694 100644 --- a/src/main/java/io/reactivex/rxjava3/core/MaybeSource.java +++ b/src/main/java/io/reactivex/rxjava3/core/MaybeSource.java @@ -24,6 +24,7 @@ * @param the element type * @since 2.0 */ +@FunctionalInterface public interface MaybeSource { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/MaybeTransformer.java b/src/main/java/io/reactivex/rxjava3/core/MaybeTransformer.java index d53bfda71d..115386aaa7 100644 --- a/src/main/java/io/reactivex/rxjava3/core/MaybeTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/core/MaybeTransformer.java @@ -15,13 +15,16 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Interface to compose Maybes. * * @param the upstream value type * @param the downstream value type */ -public interface MaybeTransformer { +@FunctionalInterface +public interface MaybeTransformer extends Function, MaybeSource> { /** * Applies a function to the upstream Maybe and returns a MaybeSource with * optionally different element type. @@ -29,5 +32,6 @@ public interface MaybeTransformer { * @return the transformed MaybeSource instance */ @NonNull + @Override MaybeSource apply(@NonNull Maybe upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/ObservableConverter.java b/src/main/java/io/reactivex/rxjava3/core/ObservableConverter.java index 744c0ef48e..f52a1a086c 100644 --- a/src/main/java/io/reactivex/rxjava3/core/ObservableConverter.java +++ b/src/main/java/io/reactivex/rxjava3/core/ObservableConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link Observable#to} operator to turn an Observable into another * value fluently. @@ -23,7 +25,8 @@ * @param the output type * @since 2.2 */ -public interface ObservableConverter { +@FunctionalInterface +public interface ObservableConverter extends Function, R> { /** * Applies a function to the upstream Observable and returns a converted value of type {@code R}. * @@ -31,5 +34,6 @@ public interface ObservableConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull Observable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/ObservableOnSubscribe.java b/src/main/java/io/reactivex/rxjava3/core/ObservableOnSubscribe.java index 1f98911285..43d6252849 100644 --- a/src/main/java/io/reactivex/rxjava3/core/ObservableOnSubscribe.java +++ b/src/main/java/io/reactivex/rxjava3/core/ObservableOnSubscribe.java @@ -21,6 +21,7 @@ * * @param the value type pushed */ +@FunctionalInterface public interface ObservableOnSubscribe { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/ObservableOperator.java b/src/main/java/io/reactivex/rxjava3/core/ObservableOperator.java index f7335b6221..76ec06e295 100644 --- a/src/main/java/io/reactivex/rxjava3/core/ObservableOperator.java +++ b/src/main/java/io/reactivex/rxjava3/core/ObservableOperator.java @@ -21,6 +21,7 @@ * @param the value type of the downstream * @param the value type of the upstream */ +@FunctionalInterface public interface ObservableOperator { /** * Applies a function to the child Observer and returns a new parent Observer. diff --git a/src/main/java/io/reactivex/rxjava3/core/ObservableSource.java b/src/main/java/io/reactivex/rxjava3/core/ObservableSource.java index a48011e438..ad5d5c79c3 100644 --- a/src/main/java/io/reactivex/rxjava3/core/ObservableSource.java +++ b/src/main/java/io/reactivex/rxjava3/core/ObservableSource.java @@ -21,6 +21,7 @@ * @param the element type * @since 2.0 */ +@FunctionalInterface public interface ObservableSource { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/ObservableTransformer.java b/src/main/java/io/reactivex/rxjava3/core/ObservableTransformer.java index 63dc87ca8b..5144d16cf6 100644 --- a/src/main/java/io/reactivex/rxjava3/core/ObservableTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/core/ObservableTransformer.java @@ -15,13 +15,16 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Interface to compose Observables. * * @param the upstream value type * @param the downstream value type */ -public interface ObservableTransformer { +@FunctionalInterface +public interface ObservableTransformer extends Function, ObservableSource> { /** * Applies a function to the upstream Observable and returns an ObservableSource with * optionally different element type. @@ -29,5 +32,6 @@ public interface ObservableTransformer { * @return the transformed ObservableSource instance */ @NonNull + @Override ObservableSource apply(@NonNull Observable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/SingleConverter.java b/src/main/java/io/reactivex/rxjava3/core/SingleConverter.java index 5309dbc160..26de3e79ed 100644 --- a/src/main/java/io/reactivex/rxjava3/core/SingleConverter.java +++ b/src/main/java/io/reactivex/rxjava3/core/SingleConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link Single#to} operator to turn a Single into another * value fluently. @@ -23,7 +25,8 @@ * @param the output type * @since 2.2 */ -public interface SingleConverter { +@FunctionalInterface +public interface SingleConverter extends Function, R> { /** * Applies a function to the upstream Single and returns a converted value of type {@code R}. * @@ -31,5 +34,6 @@ public interface SingleConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull Single upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/core/SingleOnSubscribe.java b/src/main/java/io/reactivex/rxjava3/core/SingleOnSubscribe.java index 157a8e42dc..46cc6a6f56 100644 --- a/src/main/java/io/reactivex/rxjava3/core/SingleOnSubscribe.java +++ b/src/main/java/io/reactivex/rxjava3/core/SingleOnSubscribe.java @@ -21,6 +21,7 @@ * * @param the value type pushed */ +@FunctionalInterface public interface SingleOnSubscribe { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/SingleOperator.java b/src/main/java/io/reactivex/rxjava3/core/SingleOperator.java index 58ea9d338e..2fc2d80ab6 100644 --- a/src/main/java/io/reactivex/rxjava3/core/SingleOperator.java +++ b/src/main/java/io/reactivex/rxjava3/core/SingleOperator.java @@ -21,6 +21,7 @@ * @param the value type of the downstream * @param the value type of the upstream */ +@FunctionalInterface public interface SingleOperator { /** * Applies a function to the child SingleObserver and returns a new parent SingleObserver. diff --git a/src/main/java/io/reactivex/rxjava3/core/SingleSource.java b/src/main/java/io/reactivex/rxjava3/core/SingleSource.java index 1a3780c3f6..496462d0e1 100644 --- a/src/main/java/io/reactivex/rxjava3/core/SingleSource.java +++ b/src/main/java/io/reactivex/rxjava3/core/SingleSource.java @@ -24,6 +24,7 @@ * @param the element type * @since 2.0 */ +@FunctionalInterface public interface SingleSource { /** diff --git a/src/main/java/io/reactivex/rxjava3/core/SingleTransformer.java b/src/main/java/io/reactivex/rxjava3/core/SingleTransformer.java index 080a2d7af1..f693e36ad7 100644 --- a/src/main/java/io/reactivex/rxjava3/core/SingleTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/core/SingleTransformer.java @@ -15,13 +15,16 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Interface to compose Singles. * * @param the upstream value type * @param the downstream value type */ -public interface SingleTransformer { +@FunctionalInterface +public interface SingleTransformer extends Function, SingleSource> { /** * Applies a function to the upstream Single and returns a SingleSource with * optionally different element type. @@ -29,5 +32,6 @@ public interface SingleTransformer { * @return the transformed SingleSource instance */ @NonNull + @Override SingleSource apply(@NonNull Single upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/functions/Action.java b/src/main/java/io/reactivex/rxjava3/functions/Action.java index 153eff9375..da0e76e0a6 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Action.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Action.java @@ -16,6 +16,7 @@ /** * A functional interface similar to Runnable but allows throwing a checked exception. */ +@FunctionalInterface public interface Action { /** * Runs the action and optionally throws a checked exception. diff --git a/src/main/java/io/reactivex/rxjava3/functions/BiConsumer.java b/src/main/java/io/reactivex/rxjava3/functions/BiConsumer.java index c060c38331..7fa60ef4c7 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/BiConsumer.java +++ b/src/main/java/io/reactivex/rxjava3/functions/BiConsumer.java @@ -18,6 +18,7 @@ * @param the first value type * @param the second value type */ +@FunctionalInterface public interface BiConsumer { /** diff --git a/src/main/java/io/reactivex/rxjava3/functions/BiFunction.java b/src/main/java/io/reactivex/rxjava3/functions/BiFunction.java index f7e1174c6e..174cc3c6d9 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/BiFunction.java +++ b/src/main/java/io/reactivex/rxjava3/functions/BiFunction.java @@ -21,6 +21,7 @@ * @param the second value type * @param the result type */ +@FunctionalInterface public interface BiFunction { /** diff --git a/src/main/java/io/reactivex/rxjava3/functions/BiPredicate.java b/src/main/java/io/reactivex/rxjava3/functions/BiPredicate.java index 4793e1d086..fc41682ef5 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/BiPredicate.java +++ b/src/main/java/io/reactivex/rxjava3/functions/BiPredicate.java @@ -20,6 +20,7 @@ * @param the first value * @param the second value */ +@FunctionalInterface public interface BiPredicate { /** diff --git a/src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java b/src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java index dc801e5180..b30087fbd7 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java +++ b/src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java @@ -16,6 +16,7 @@ /** * A functional interface (callback) that returns a boolean value. */ +@FunctionalInterface public interface BooleanSupplier { /** * Returns a boolean value. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Cancellable.java b/src/main/java/io/reactivex/rxjava3/functions/Cancellable.java index 47683eafdc..b9f3420c1b 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Cancellable.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Cancellable.java @@ -17,6 +17,7 @@ * A functional interface that has a single cancel method * that can throw. */ +@FunctionalInterface public interface Cancellable { /** diff --git a/src/main/java/io/reactivex/rxjava3/functions/Consumer.java b/src/main/java/io/reactivex/rxjava3/functions/Consumer.java index 08d94eb928..788622c170 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Consumer.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Consumer.java @@ -17,6 +17,7 @@ * A functional interface (callback) that accepts a single value. * @param the value type */ +@FunctionalInterface public interface Consumer { /** * Consume the given value. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function.java b/src/main/java/io/reactivex/rxjava3/functions/Function.java index 23d06b041b..d81a2dec52 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function.java @@ -22,6 +22,7 @@ * @param the input value type * @param the output value type */ +@FunctionalInterface public interface Function { /** * Apply some calculation to the input value and return some other value. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function3.java b/src/main/java/io/reactivex/rxjava3/functions/Function3.java index bdc1b4af2b..cdc65112e7 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function3.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function3.java @@ -22,6 +22,7 @@ * @param the third value type * @param the result type */ +@FunctionalInterface public interface Function3 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function4.java b/src/main/java/io/reactivex/rxjava3/functions/Function4.java index 907f742907..84c3ab1449 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function4.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function4.java @@ -23,6 +23,7 @@ * @param the fourth value type * @param the result type */ +@FunctionalInterface public interface Function4 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function5.java b/src/main/java/io/reactivex/rxjava3/functions/Function5.java index a8468844b7..77f2ff7220 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function5.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function5.java @@ -24,6 +24,7 @@ * @param the fifth value type * @param the result type */ +@FunctionalInterface public interface Function5 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function6.java b/src/main/java/io/reactivex/rxjava3/functions/Function6.java index 6bc5caec1f..50c25f3df9 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function6.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function6.java @@ -25,6 +25,7 @@ * @param the sixth value type * @param the result type */ +@FunctionalInterface public interface Function6 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function7.java b/src/main/java/io/reactivex/rxjava3/functions/Function7.java index 32d5a08e41..613800a4c1 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function7.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function7.java @@ -26,6 +26,7 @@ * @param the seventh value type * @param the result type */ +@FunctionalInterface public interface Function7 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function8.java b/src/main/java/io/reactivex/rxjava3/functions/Function8.java index 8a7a88f9e8..2fda54ea40 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function8.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function8.java @@ -27,6 +27,7 @@ * @param the eighth value type * @param the result type */ +@FunctionalInterface public interface Function8 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Function9.java b/src/main/java/io/reactivex/rxjava3/functions/Function9.java index 28319eac14..3eb0779e30 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Function9.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Function9.java @@ -28,6 +28,7 @@ * @param the ninth value type * @param the result type */ +@FunctionalInterface public interface Function9 { /** * Calculate a value based on the input values. diff --git a/src/main/java/io/reactivex/rxjava3/functions/IntFunction.java b/src/main/java/io/reactivex/rxjava3/functions/IntFunction.java index 8a135ad491..e01cc13ab5 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/IntFunction.java +++ b/src/main/java/io/reactivex/rxjava3/functions/IntFunction.java @@ -18,6 +18,7 @@ * A functional interface (callback) that takes a primitive value and return value of type T. * @param the returned value type */ +@FunctionalInterface public interface IntFunction { /** * Calculates a value based on a primitive integer input. diff --git a/src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java b/src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java index 6b5b72101c..9af7de4f47 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java +++ b/src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java @@ -15,6 +15,7 @@ /** * A functional interface (callback) that consumes a primitive long value. */ +@FunctionalInterface public interface LongConsumer { /** * Consume a primitive long input. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Predicate.java b/src/main/java/io/reactivex/rxjava3/functions/Predicate.java index 3197114158..99450f865b 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Predicate.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Predicate.java @@ -19,6 +19,7 @@ * A functional interface (callback) that returns true or false for the given input value. * @param the first value */ +@FunctionalInterface public interface Predicate { /** * Test the given input value and return a boolean. diff --git a/src/main/java/io/reactivex/rxjava3/functions/Supplier.java b/src/main/java/io/reactivex/rxjava3/functions/Supplier.java index 95ef2e88a1..af5052ab83 100644 --- a/src/main/java/io/reactivex/rxjava3/functions/Supplier.java +++ b/src/main/java/io/reactivex/rxjava3/functions/Supplier.java @@ -22,6 +22,7 @@ * @param the value type returned * @since 3.0.0 */ +@FunctionalInterface public interface Supplier { /** diff --git a/src/main/java/io/reactivex/rxjava3/internal/fuseable/ScalarSupplier.java b/src/main/java/io/reactivex/rxjava3/internal/fuseable/ScalarSupplier.java index 039d730be6..fc0d12323f 100644 --- a/src/main/java/io/reactivex/rxjava3/internal/fuseable/ScalarSupplier.java +++ b/src/main/java/io/reactivex/rxjava3/internal/fuseable/ScalarSupplier.java @@ -29,6 +29,7 @@ *

* @param the scalar value type held by the implementing reactive type */ +@FunctionalInterface public interface ScalarSupplier extends Supplier { // overridden to remove the throws Throwable diff --git a/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowableConverter.java b/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowableConverter.java index ea2d07502a..f6ce1ddde0 100644 --- a/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowableConverter.java +++ b/src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowableConverter.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Convenience interface and callback used by the {@link ParallelFlowable#to} operator to turn a ParallelFlowable into * another value fluently. @@ -23,7 +25,8 @@ * @param the output type * @since 2.2 */ -public interface ParallelFlowableConverter { +@FunctionalInterface +public interface ParallelFlowableConverter extends Function, R> { /** * Applies a function to the upstream ParallelFlowable and returns a converted value of type {@code R}. * @@ -31,5 +34,6 @@ public interface ParallelFlowableConverter { * @return the converted value */ @NonNull + @Override R apply(@NonNull ParallelFlowable upstream); } diff --git a/src/main/java/io/reactivex/rxjava3/parallel/ParallelTransformer.java b/src/main/java/io/reactivex/rxjava3/parallel/ParallelTransformer.java index 1a918f0835..2a069b8070 100644 --- a/src/main/java/io/reactivex/rxjava3/parallel/ParallelTransformer.java +++ b/src/main/java/io/reactivex/rxjava3/parallel/ParallelTransformer.java @@ -15,6 +15,8 @@ import io.reactivex.rxjava3.annotations.NonNull; +import java.util.function.Function; + /** * Interface to compose ParallelFlowable. *

History: 2.0.8 - experimental @@ -22,7 +24,8 @@ * @param the downstream value type * @since 2.2 */ -public interface ParallelTransformer { +@FunctionalInterface +public interface ParallelTransformer extends Function, ParallelFlowable> { /** * Applies a function to the upstream ParallelFlowable and returns a ParallelFlowable with * optionally different element type. @@ -30,5 +33,6 @@ public interface ParallelTransformer { * @return the transformed ParallelFlowable instance */ @NonNull + @Override ParallelFlowable apply(@NonNull ParallelFlowable upstream); } \ No newline at end of file