Skip to content

Commit 0fba7c5

Browse files
He-Pinakarnokd
authored andcommitted
Add FunctionalInterface annotations. (#6773)
1 parent 6ba932c commit 0fba7c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+46
-0
lines changed

Diff for: src/main/java/io/reactivex/rxjava3/core/CompletableConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @param <R> the output type
2323
* @since 2.2
2424
*/
25+
@FunctionalInterface
2526
public interface CompletableConverter<R> {
2627
/**
2728
* Applies a function to the upstream Completable and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/core/CompletableOnSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* an instance of a {@link CompletableEmitter} instance that allows pushing
2020
* an event in a cancellation-safe manner.
2121
*/
22+
@FunctionalInterface
2223
public interface CompletableOnSubscribe {
2324

2425
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/CompletableOperator.java

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/**
1919
* Interface to map/wrap a downstream observer to an upstream observer.
2020
*/
21+
@FunctionalInterface
2122
public interface CompletableOperator {
2223
/**
2324
* Applies a function to the child CompletableObserver and returns a new parent CompletableObserver.

Diff for: src/main/java/io/reactivex/rxjava3/core/CompletableSource.java

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*
2121
* @since 2.0
2222
*/
23+
@FunctionalInterface
2324
public interface CompletableSource {
2425

2526
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/CompletableTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Convenience interface and callback used by the compose operator to turn a Completable into another
2020
* Completable fluently.
2121
*/
22+
@FunctionalInterface
2223
public interface CompletableTransformer {
2324
/**
2425
* Applies a function to the upstream Completable and returns a CompletableSource.

Diff for: src/main/java/io/reactivex/rxjava3/core/FlowableConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <R> the output type
2424
* @since 2.2
2525
*/
26+
@FunctionalInterface
2627
public interface FlowableConverter<T, R> {
2728
/**
2829
* Applies a function to the upstream Flowable and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/core/FlowableOnSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* @param <T> the value type pushed
2323
*/
24+
@FunctionalInterface
2425
public interface FlowableOnSubscribe<T> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/FlowableOperator.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <Downstream> the value type of the downstream
2424
* @param <Upstream> the value type of the upstream
2525
*/
26+
@FunctionalInterface
2627
public interface FlowableOperator<Downstream, Upstream> {
2728
/**
2829
* Applies a function to the child Subscriber and returns a new parent Subscriber.

Diff for: src/main/java/io/reactivex/rxjava3/core/FlowableTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <Upstream> the upstream value type
2424
* @param <Downstream> the downstream value type
2525
*/
26+
@FunctionalInterface
2627
public interface FlowableTransformer<Upstream, Downstream> {
2728
/**
2829
* Applies a function to the upstream Flowable and returns a Publisher with

Diff for: src/main/java/io/reactivex/rxjava3/core/MaybeConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <R> the output type
2424
* @since 2.2
2525
*/
26+
@FunctionalInterface
2627
public interface MaybeConverter<T, R> {
2728
/**
2829
* Applies a function to the upstream Maybe and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/core/MaybeOnSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* @param <T> the value type pushed
2323
*/
24+
@FunctionalInterface
2425
public interface MaybeOnSubscribe<T> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @param <Downstream> the value type of the downstream
2121
* @param <Upstream> the value type of the upstream
2222
*/
23+
@FunctionalInterface
2324
public interface MaybeOperator<Downstream, Upstream> {
2425
/**
2526
* Applies a function to the child MaybeObserver and returns a new parent MaybeObserver.

Diff for: src/main/java/io/reactivex/rxjava3/core/MaybeSource.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @param <T> the element type
2525
* @since 2.0
2626
*/
27+
@FunctionalInterface
2728
public interface MaybeSource<T> {
2829

2930
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/MaybeTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <Upstream> the upstream value type
2222
* @param <Downstream> the downstream value type
2323
*/
24+
@FunctionalInterface
2425
public interface MaybeTransformer<Upstream, Downstream> {
2526
/**
2627
* Applies a function to the upstream Maybe and returns a MaybeSource with

Diff for: src/main/java/io/reactivex/rxjava3/core/ObservableConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <R> the output type
2424
* @since 2.2
2525
*/
26+
@FunctionalInterface
2627
public interface ObservableConverter<T, R> {
2728
/**
2829
* Applies a function to the upstream Observable and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/core/ObservableOnSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* @param <T> the value type pushed
2323
*/
24+
@FunctionalInterface
2425
public interface ObservableOnSubscribe<T> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/ObservableOperator.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <Downstream> the value type of the downstream
2222
* @param <Upstream> the value type of the upstream
2323
*/
24+
@FunctionalInterface
2425
public interface ObservableOperator<Downstream, Upstream> {
2526
/**
2627
* Applies a function to the child Observer and returns a new parent Observer.

Diff for: src/main/java/io/reactivex/rxjava3/core/ObservableSource.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <T> the element type
2222
* @since 2.0
2323
*/
24+
@FunctionalInterface
2425
public interface ObservableSource<T> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/ObservableTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <Upstream> the upstream value type
2222
* @param <Downstream> the downstream value type
2323
*/
24+
@FunctionalInterface
2425
public interface ObservableTransformer<Upstream, Downstream> {
2526
/**
2627
* Applies a function to the upstream Observable and returns an ObservableSource with

Diff for: src/main/java/io/reactivex/rxjava3/core/SingleConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <R> the output type
2424
* @since 2.2
2525
*/
26+
@FunctionalInterface
2627
public interface SingleConverter<T, R> {
2728
/**
2829
* Applies a function to the upstream Single and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/core/SingleOnSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* @param <T> the value type pushed
2323
*/
24+
@FunctionalInterface
2425
public interface SingleOnSubscribe<T> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/SingleOperator.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <Downstream> the value type of the downstream
2222
* @param <Upstream> the value type of the upstream
2323
*/
24+
@FunctionalInterface
2425
public interface SingleOperator<Downstream, Upstream> {
2526
/**
2627
* Applies a function to the child SingleObserver and returns a new parent SingleObserver.

Diff for: src/main/java/io/reactivex/rxjava3/core/SingleSource.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @param <T> the element type
2525
* @since 2.0
2626
*/
27+
@FunctionalInterface
2728
public interface SingleSource<T> {
2829

2930
/**

Diff for: src/main/java/io/reactivex/rxjava3/core/SingleTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <Upstream> the upstream value type
2222
* @param <Downstream> the downstream value type
2323
*/
24+
@FunctionalInterface
2425
public interface SingleTransformer<Upstream, Downstream> {
2526
/**
2627
* Applies a function to the upstream Single and returns a SingleSource with

Diff for: src/main/java/io/reactivex/rxjava3/functions/Action.java

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/**
1717
* A functional interface similar to Runnable but allows throwing a checked exception.
1818
*/
19+
@FunctionalInterface
1920
public interface Action {
2021
/**
2122
* Runs the action and optionally throws a checked exception.

Diff for: src/main/java/io/reactivex/rxjava3/functions/BiConsumer.java

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @param <T1> the first value type
1919
* @param <T2> the second value type
2020
*/
21+
@FunctionalInterface
2122
public interface BiConsumer<T1, T2> {
2223

2324
/**

Diff for: src/main/java/io/reactivex/rxjava3/functions/BiFunction.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @param <T2> the second value type
2222
* @param <R> the result type
2323
*/
24+
@FunctionalInterface
2425
public interface BiFunction<T1, T2, R> {
2526

2627
/**

Diff for: src/main/java/io/reactivex/rxjava3/functions/BiPredicate.java

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @param <T1> the first value
2121
* @param <T2> the second value
2222
*/
23+
@FunctionalInterface
2324
public interface BiPredicate<T1, T2> {
2425

2526
/**

Diff for: src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/**
1717
* A functional interface (callback) that returns a boolean value.
1818
*/
19+
@FunctionalInterface
1920
public interface BooleanSupplier {
2021
/**
2122
* Returns a boolean value.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Cancellable.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* A functional interface that has a single cancel method
1818
* that can throw.
1919
*/
20+
@FunctionalInterface
2021
public interface Cancellable {
2122

2223
/**

Diff for: src/main/java/io/reactivex/rxjava3/functions/Consumer.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* A functional interface (callback) that accepts a single value.
1818
* @param <T> the value type
1919
*/
20+
@FunctionalInterface
2021
public interface Consumer<T> {
2122
/**
2223
* Consume the given value.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @param <T> the input value type
2323
* @param <R> the output value type
2424
*/
25+
@FunctionalInterface
2526
public interface Function<T, R> {
2627
/**
2728
* Apply some calculation to the input value and return some other value.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function3.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @param <T3> the third value type
2323
* @param <R> the result type
2424
*/
25+
@FunctionalInterface
2526
public interface Function3<T1, T2, T3, R> {
2627
/**
2728
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function4.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <T4> the fourth value type
2424
* @param <R> the result type
2525
*/
26+
@FunctionalInterface
2627
public interface Function4<T1, T2, T3, T4, R> {
2728
/**
2829
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function5.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @param <T5> the fifth value type
2525
* @param <R> the result type
2626
*/
27+
@FunctionalInterface
2728
public interface Function5<T1, T2, T3, T4, T5, R> {
2829
/**
2930
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function6.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @param <T6> the sixth value type
2626
* @param <R> the result type
2727
*/
28+
@FunctionalInterface
2829
public interface Function6<T1, T2, T3, T4, T5, T6, R> {
2930
/**
3031
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function7.java

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @param <T7> the seventh value type
2727
* @param <R> the result type
2828
*/
29+
@FunctionalInterface
2930
public interface Function7<T1, T2, T3, T4, T5, T6, T7, R> {
3031
/**
3132
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function8.java

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @param <T8> the eighth value type
2828
* @param <R> the result type
2929
*/
30+
@FunctionalInterface
3031
public interface Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> {
3132
/**
3233
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Function9.java

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* @param <T9> the ninth value type
2929
* @param <R> the result type
3030
*/
31+
@FunctionalInterface
3132
public interface Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> {
3233
/**
3334
* Calculate a value based on the input values.

Diff for: src/main/java/io/reactivex/rxjava3/functions/IntFunction.java

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* A functional interface (callback) that takes a primitive value and return value of type T.
1919
* @param <T> the returned value type
2020
*/
21+
@FunctionalInterface
2122
public interface IntFunction<T> {
2223
/**
2324
* Calculates a value based on a primitive integer input.

Diff for: src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/**
1616
* A functional interface (callback) that consumes a primitive long value.
1717
*/
18+
@FunctionalInterface
1819
public interface LongConsumer {
1920
/**
2021
* Consume a primitive long input.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Predicate.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* A functional interface (callback) that returns true or false for the given input value.
2020
* @param <T> the first value
2121
*/
22+
@FunctionalInterface
2223
public interface Predicate<T> {
2324
/**
2425
* Test the given input value and return a boolean.

Diff for: src/main/java/io/reactivex/rxjava3/functions/Supplier.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @param <T> the value type returned
2323
* @since 3.0.0
2424
*/
25+
@FunctionalInterface
2526
public interface Supplier<T> {
2627

2728
/**

Diff for: src/main/java/io/reactivex/rxjava3/internal/fuseable/ScalarSupplier.java

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* <p>
3030
* @param <T> the scalar value type held by the implementing reactive type
3131
*/
32+
@FunctionalInterface
3233
public interface ScalarSupplier<T> extends Supplier<T> {
3334

3435
// overridden to remove the throws Throwable

Diff for: src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowableConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <R> the output type
2424
* @since 2.2
2525
*/
26+
@FunctionalInterface
2627
public interface ParallelFlowableConverter<T, R> {
2728
/**
2829
* Applies a function to the upstream ParallelFlowable and returns a converted value of type {@code R}.

Diff for: src/main/java/io/reactivex/rxjava3/parallel/ParallelTransformer.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* @param <Downstream> the downstream value type
2323
* @since 2.2
2424
*/
25+
@FunctionalInterface
2526
public interface ParallelTransformer<Upstream, Downstream> {
2627
/**
2728
* Applies a function to the upstream ParallelFlowable and returns a ParallelFlowable with

0 commit comments

Comments
 (0)