Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FunctionalInterface annotations. #6773

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface CompletableConverter<R> {
/**
* Applies a function to the upstream Completable and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
* @since 2.0
*/
@FunctionalInterface
public interface CompletableSource {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Convenience interface and callback used by the compose operator to turn a Completable into another
* Completable fluently.
*/
@FunctionalInterface
public interface CompletableTransformer {
/**
* Applies a function to the upstream Completable and returns a CompletableSource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface FlowableConverter<T, R> {
/**
* Applies a function to the upstream Flowable and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @param <T> the value type pushed
*/
@FunctionalInterface
public interface FlowableOnSubscribe<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <Downstream> the value type of the downstream
* @param <Upstream> the value type of the upstream
*/
@FunctionalInterface
public interface FlowableOperator<Downstream, Upstream> {
/**
* Applies a function to the child Subscriber and returns a new parent Subscriber.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <Upstream> the upstream value type
* @param <Downstream> the downstream value type
*/
@FunctionalInterface
public interface FlowableTransformer<Upstream, Downstream> {
/**
* Applies a function to the upstream Flowable and returns a Publisher with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface MaybeConverter<T, R> {
/**
* Applies a function to the upstream Maybe and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @param <T> the value type pushed
*/
@FunctionalInterface
public interface MaybeOnSubscribe<T> {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/core/MaybeOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @param <Downstream> the value type of the downstream
* @param <Upstream> the value type of the upstream
*/
@FunctionalInterface
public interface MaybeOperator<Downstream, Upstream> {
/**
* Applies a function to the child MaybeObserver and returns a new parent MaybeObserver.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/core/MaybeSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @param <T> the element type
* @since 2.0
*/
@FunctionalInterface
public interface MaybeSource<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <Upstream> the upstream value type
* @param <Downstream> the downstream value type
*/
@FunctionalInterface
public interface MaybeTransformer<Upstream, Downstream> {
/**
* Applies a function to the upstream Maybe and returns a MaybeSource with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface ObservableConverter<T, R> {
/**
* Applies a function to the upstream Observable and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @param <T> the value type pushed
*/
@FunctionalInterface
public interface ObservableOnSubscribe<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <Downstream> the value type of the downstream
* @param <Upstream> the value type of the upstream
*/
@FunctionalInterface
public interface ObservableOperator<Downstream, Upstream> {
/**
* Applies a function to the child Observer and returns a new parent Observer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <T> the element type
* @since 2.0
*/
@FunctionalInterface
public interface ObservableSource<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <Upstream> the upstream value type
* @param <Downstream> the downstream value type
*/
@FunctionalInterface
public interface ObservableTransformer<Upstream, Downstream> {
/**
* Applies a function to the upstream Observable and returns an ObservableSource with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface SingleConverter<T, R> {
/**
* Applies a function to the upstream Single and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @param <T> the value type pushed
*/
@FunctionalInterface
public interface SingleOnSubscribe<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <Downstream> the value type of the downstream
* @param <Upstream> the value type of the upstream
*/
@FunctionalInterface
public interface SingleOperator<Downstream, Upstream> {
/**
* Applies a function to the child SingleObserver and returns a new parent SingleObserver.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/core/SingleSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @param <T> the element type
* @since 2.0
*/
@FunctionalInterface
public interface SingleSource<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <Upstream> the upstream value type
* @param <Downstream> the downstream value type
*/
@FunctionalInterface
public interface SingleTransformer<Upstream, Downstream> {
/**
* Applies a function to the upstream Single and returns a SingleSource with
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/functions/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @param <T1> the first value type
* @param <T2> the second value type
*/
@FunctionalInterface
public interface BiConsumer<T1, T2> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @param <T2> the second value type
* @param <R> the result type
*/
@FunctionalInterface
public interface BiFunction<T1, T2, R> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @param <T1> the first value
* @param <T2> the second value
*/
@FunctionalInterface
public interface BiPredicate<T1, T2> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/**
* A functional interface (callback) that returns a boolean value.
*/
@FunctionalInterface
public interface BooleanSupplier {
/**
* Returns a boolean value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* A functional interface that has a single cancel method
* that can throw.
*/
@FunctionalInterface
public interface Cancellable {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/functions/Consumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* A functional interface (callback) that accepts a single value.
* @param <T> the value type
*/
@FunctionalInterface
public interface Consumer<T> {
/**
* Consume the given value.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/functions/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @param <T> the input value type
* @param <R> the output value type
*/
@FunctionalInterface
public interface Function<T, R> {
/**
* Apply some calculation to the input value and return some other value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @param <T3> the third value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function3<T1, T2, T3, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <T4> the fourth value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function4<T1, T2, T3, T4, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @param <T5> the fifth value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function5<T1, T2, T3, T4, T5, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @param <T6> the sixth value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function6<T1, T2, T3, T4, T5, T6, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @param <T7> the seventh value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function7<T1, T2, T3, T4, T5, T6, T7, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @param <T8> the eighth value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @param <T9> the ninth value type
* @param <R> the result type
*/
@FunctionalInterface
public interface Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> {
/**
* Calculate a value based on the input values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* A functional interface (callback) that takes a primitive value and return value of type T.
* @param <T> the returned value type
*/
@FunctionalInterface
public interface IntFunction<T> {
/**
* Calculates a value based on a primitive integer input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* A functional interface (callback) that consumes a primitive long value.
*/
@FunctionalInterface
public interface LongConsumer {
/**
* Consume a primitive long input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* A functional interface (callback) that returns true or false for the given input value.
* @param <T> the first value
*/
@FunctionalInterface
public interface Predicate<T> {
/**
* Test the given input value and return a boolean.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/reactivex/rxjava3/functions/Supplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @param <T> the value type returned
* @since 3.0.0
*/
@FunctionalInterface
public interface Supplier<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* <p>
* @param <T> the scalar value type held by the implementing reactive type
*/
@FunctionalInterface
public interface ScalarSupplier<T> extends Supplier<T> {

// overridden to remove the throws Throwable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @param <R> the output type
* @since 2.2
*/
@FunctionalInterface
public interface ParallelFlowableConverter<T, R> {
/**
* Applies a function to the upstream ParallelFlowable and returns a converted value of type {@code R}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @param <Downstream> the downstream value type
* @since 2.2
*/
@FunctionalInterface
public interface ParallelTransformer<Upstream, Downstream> {
/**
* Applies a function to the upstream ParallelFlowable and returns a ParallelFlowable with
Expand Down