Skip to content

Commit

Permalink
Rename to flattenAsX
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Sep 28, 2016
1 parent cd1ed7b commit 7ab74e0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/reactivex/Maybe.java
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ public final <U, R> Maybe<R> flatMap(Function<? super T, ? extends MaybeSource<?
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
public final <U> Flowable<U> flattenAsFlowable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
return new MaybeFlatMapIterableFlowable<T, U>(this, mapper);
}

Expand All @@ -2550,7 +2550,7 @@ public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Observable<U> flattenIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
public final <U> Observable<U> flattenAsObservable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
return new MaybeFlatMapIterableObservable<T, U>(this, mapper);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/reactivex/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ public final <R> Flowable<R> flatMapPublisher(Function<? super T, ? extends Publ
*/
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
public final <U> Flowable<U> flattenAsFlowable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
return new SingleFlatMapIterableFlowable<T, U>(this, mapper);
}

Expand All @@ -1921,7 +1921,7 @@ public final <U> Flowable<U> flatMapIterable(final Function<? super T, ? extends
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final <U> Observable<U> flattenIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
public final <U> Observable<U> flattenAsObservable(final Function<? super T, ? extends Iterable<? extends U>> mapper) {
return new SingleFlatMapIterableObservable<T, U>(this, mapper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MaybeFlatMapIterableFlowableTest {
@Test
public void normal() {

Maybe.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -40,7 +40,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void emptyIterable() {

Maybe.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Collections.<Integer>emptyList();
Expand All @@ -53,7 +53,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void error() {

Maybe.<Integer>error(new TestException()).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.<Integer>error(new TestException()).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -66,7 +66,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void empty() {

Maybe.<Integer>empty().flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.<Integer>empty().flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -79,7 +79,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void backpressure() {

TestSubscriber<Integer> ts = Maybe.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
TestSubscriber<Integer> ts = Maybe.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MaybeFlatMapIterableObservableTest {
@Test
public void normal() {

Maybe.just(1).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.just(1).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -39,7 +39,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void emptyIterable() {

Maybe.just(1).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.just(1).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Collections.<Integer>emptyList();
Expand All @@ -52,7 +52,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void error() {

Maybe.<Integer>error(new TestException()).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.<Integer>error(new TestException()).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -65,7 +65,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void empty() {

Maybe.<Integer>empty().flattenIterable(new Function<Integer, Iterable<Integer>>() {
Maybe.<Integer>empty().flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class SingleFlatMapIterableFlowableTest {
@Test
public void normal() {

Single.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Single.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -40,7 +40,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void emptyIterable() {

Single.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Single.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Collections.<Integer>emptyList();
Expand All @@ -53,7 +53,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void error() {

Single.<Integer>error(new TestException()).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
Single.<Integer>error(new TestException()).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -66,7 +66,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void backpressure() {

TestSubscriber<Integer> ts = Single.just(1).flatMapIterable(new Function<Integer, Iterable<Integer>>() {
TestSubscriber<Integer> ts = Single.just(1).flattenAsFlowable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SingleFlatMapIterableObservableTest {
@Test
public void normal() {

Single.just(1).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Single.just(1).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand All @@ -39,7 +39,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void emptyIterable() {

Single.just(1).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Single.just(1).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Collections.<Integer>emptyList();
Expand All @@ -52,7 +52,7 @@ public Iterable<Integer> apply(Integer v) throws Exception {
@Test
public void error() {

Single.<Integer>error(new TestException()).flattenIterable(new Function<Integer, Iterable<Integer>>() {
Single.<Integer>error(new TestException()).flattenAsObservable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) throws Exception {
return Arrays.asList(v, v + 1);
Expand Down

0 comments on commit 7ab74e0

Please sign in to comment.