diff --git a/src/main/java/io/reactivex/CompletableOperator.java b/src/main/java/io/reactivex/CompletableOperator.java index 330aa5c70d..74baba4586 100644 --- a/src/main/java/io/reactivex/CompletableOperator.java +++ b/src/main/java/io/reactivex/CompletableOperator.java @@ -13,12 +13,14 @@ package io.reactivex; -import io.reactivex.functions.Function; - /** - * Convenience interface and callback used by the lift operator that given a child CompletableSubscriber, - * return a parent CompletableSubscriber that does any kind of lifecycle-related transformations. + * Interface to map/wrap a downstream observer to an upstream observer. */ -public interface CompletableOperator extends Function { - +public interface CompletableOperator { + /** + * Applies a function to the child CompletableObserver and returns a new parent CompletableObserver. + * @param observer the child CompletableObservable instance + * @return the parent CompletableObserver instance + */ + CompletableObserver apply(CompletableObserver observer) throws Exception; } diff --git a/src/main/java/io/reactivex/FlowableOperator.java b/src/main/java/io/reactivex/FlowableOperator.java index 47401ed1d9..b814a56219 100644 --- a/src/main/java/io/reactivex/FlowableOperator.java +++ b/src/main/java/io/reactivex/FlowableOperator.java @@ -15,14 +15,17 @@ import org.reactivestreams.Subscriber; -import io.reactivex.functions.Function; - /** * Interface to map/wrap a downstream subscriber to an upstream subscriber. * * @param the value type of the downstream * @param the value type of the upstream */ -public interface FlowableOperator extends Function, Subscriber> { - +public interface FlowableOperator { + /** + * Applies a function to the child Subscriber and returns a new parent Subscriber. + * @param observer the child Subscriber instance + * @return the parent Subscriber instance + */ + Subscriber apply(Subscriber observer) throws Exception; } diff --git a/src/main/java/io/reactivex/MaybeOperator.java b/src/main/java/io/reactivex/MaybeOperator.java index 4f3bb73bd1..72a7424547 100644 --- a/src/main/java/io/reactivex/MaybeOperator.java +++ b/src/main/java/io/reactivex/MaybeOperator.java @@ -13,14 +13,17 @@ package io.reactivex; -import io.reactivex.functions.Function; - /** - * Interface to map/wrap a downstream subscriber to an upstream MaybeObserver. + * Interface to map/wrap a downstream observer to an upstream observer. * * @param the value type of the downstream * @param the value type of the upstream */ -public interface MaybeOperator extends Function, MaybeObserver> { - +public interface MaybeOperator { + /** + * Applies a function to the child MaybeObserver and returns a new parent MaybeObserver. + * @param observer the child MaybeObserver instance + * @return the parent MaybeObserver instance + */ + MaybeObserver apply(MaybeObserver observer) throws Exception; } diff --git a/src/main/java/io/reactivex/ObservableOperator.java b/src/main/java/io/reactivex/ObservableOperator.java index 3249542ae7..c1494b013b 100644 --- a/src/main/java/io/reactivex/ObservableOperator.java +++ b/src/main/java/io/reactivex/ObservableOperator.java @@ -13,14 +13,17 @@ package io.reactivex; -import io.reactivex.functions.Function; - /** - * Interface to map/wrap a downstream subscriber to an upstream Observer. + * Interface to map/wrap a downstream observer to an upstream observer. * * @param the value type of the downstream * @param the value type of the upstream */ -public interface ObservableOperator extends Function, Observer> { - +public interface ObservableOperator { + /** + * Applies a function to the child Observer and returns a new parent Observer. + * @param observer the child Observer instance + * @return the parent Observer instance + */ + Observer apply(Observer observer) throws Exception; } diff --git a/src/main/java/io/reactivex/SingleOperator.java b/src/main/java/io/reactivex/SingleOperator.java index 834ab20397..74228ca2cb 100644 --- a/src/main/java/io/reactivex/SingleOperator.java +++ b/src/main/java/io/reactivex/SingleOperator.java @@ -13,14 +13,17 @@ package io.reactivex; -import io.reactivex.functions.Function; - /** - * Interface to map/wrap a downstream subscriber to an upstream SingleObserver. + * Interface to map/wrap a downstream observer to an upstream observer. * * @param the value type of the downstream * @param the value type of the upstream */ -public interface SingleOperator extends Function, SingleObserver> { - +public interface SingleOperator { + /** + * Applies a function to the child SingleObserver and returns a new parent SingleObserver. + * @param observer the child SingleObserver instance + * @return the parent SingleObserver instance + */ + SingleObserver apply(SingleObserver observer) throws Exception; }