Skip to content

Commit ed89ed1

Browse files
committed
Merge upstream/master into ToMapAndToMultimap
2 parents e74d0be + 8d77fbf commit ed89ed1

File tree

1 file changed

+106
-24
lines changed

1 file changed

+106
-24
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 106 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5487,7 +5487,6 @@ public static <T> Observable<T> amb(Iterable<? extends Observable<? extends T>>
54875487
return create(OperationAmb.amb(sources));
54885488
}
54895489

5490-
54915490
/**
54925491
* Invokes an action for each item emitted by the Observable.
54935492
* <p>
@@ -5696,142 +5695,216 @@ private boolean isInternalImplementation(Object o) {
56965695
return isInternal;
56975696
}
56985697
}
5698+
56995699
/**
5700-
* Creates a pattern that matches when both observable sequences have an available element.
5701-
* @param right Observable sequence to match with the left sequence.
5702-
* @return Pattern object that matches when both observable sequences have an available element.
5700+
* Creates a pattern that matches when both Observable sequences have an
5701+
* available item.
5702+
* <p>
5703+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5704+
*
5705+
* @param right Observable sequence to match with the left sequence
5706+
* @return Pattern object that matches when both Observable sequences have
5707+
* an available item
5708+
* @throws NullPointerException if <code>right</code> is null
5709+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">and()</a>
57035710
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229153.aspx'>MSDN: Observable.And</a>
5704-
* @throws NullPointerException if right is null
57055711
*/
57065712
public <T2> Pattern2<T, T2> and(Observable<T2> right) {
57075713
return OperationJoinPatterns.and(this, right);
57085714
}
5715+
57095716
/**
5710-
* Matches when the observable sequence has an available element and projects the element by invoking the selector function.
5711-
* @param selector Selector that will be invoked for elements in the source sequence.
5712-
* @return Plan that produces the projected results, to be fed (with other plans) to the When operator.
5717+
* Matches when the Observable sequence has an available item and
5718+
* projects the item by invoking the selector function.
5719+
* <p>
5720+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5721+
*
5722+
* @param selector Selector that will be invoked for elements in the source
5723+
* sequence
5724+
* @return Plan that produces the projected results, to be fed (with other
5725+
* plans) to the When operator
5726+
* @throws NullPointerException if <code>selector</code> is null
5727+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">then()</a>
57135728
* @see <a href='http://msdn.microsoft.com/en-us/library/hh211662.aspx'>MSDN: Observable.Then</a>
5714-
* @throws NullPointerException if selector is null
57155729
*/
57165730
public <R> Plan0<R> then(Func1<T, R> selector) {
57175731
return OperationJoinPatterns.then(this, selector);
57185732
}
5733+
57195734
/**
57205735
* Joins together the results from several patterns.
5721-
* @param plans A series of plans created by use of the Then operator on patterns.
5722-
* @return An observable sequence with the results from matching several patterns.
5736+
* <p>
5737+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5738+
*
5739+
* @param plans a series of plans created by use of the Then operator on
5740+
* patterns
5741+
* @return an Observable sequence with the results from matching several
5742+
* patterns
5743+
* @throws NullPointerException if <code>plans</code> is null
5744+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57235745
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5724-
* @throws NullPointerException if plans is null
57255746
*/
57265747
public static <R> Observable<R> when(Plan0<R>... plans) {
57275748
return create(OperationJoinPatterns.when(plans));
57285749
}
5750+
57295751
/**
57305752
* Joins together the results from several patterns.
5731-
* @param plans A series of plans created by use of the Then operator on patterns.
5732-
* @return An observable sequence with the results from matching several patterns.
5753+
* <p>
5754+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5755+
*
5756+
* @param plans a series of plans created by use of the Then operator on
5757+
* patterns
5758+
* @return an Observable sequence with the results from matching several
5759+
* patterns
5760+
* @throws NullPointerException if <code>plans</code> is null
5761+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57335762
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229558.aspx'>MSDN: Observable.When</a>
5734-
* @throws NullPointerException if plans is null
57355763
*/
57365764
public static <R> Observable<R> when(Iterable<? extends Plan0<R>> plans) {
57375765
if (plans == null) {
57385766
throw new NullPointerException("plans");
57395767
}
57405768
return create(OperationJoinPatterns.when(plans));
57415769
}
5770+
57425771
/**
57435772
* Joins the results from a pattern.
5773+
* <p>
5774+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5775+
*
57445776
* @param p1 the plan to join
5745-
* @return An observable sequence with the results from matching a pattern
5777+
* @return an Observable sequence with the results from matching a pattern
5778+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57465779
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57475780
*/
57485781
@SuppressWarnings("unchecked")
57495782
public static <R> Observable<R> when(Plan0<R> p1) {
57505783
return create(OperationJoinPatterns.when(p1));
57515784
}
5785+
57525786
/**
57535787
* Joins together the results from several patterns.
5788+
* <p>
5789+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5790+
*
57545791
* @param p1 a plan
57555792
* @param p2 a plan
5756-
* @return An observable sequence with the results from matching several patterns
5793+
* @return an Observable sequence with the results from matching several
5794+
* patterns
5795+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57575796
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57585797
*/
57595798
@SuppressWarnings("unchecked")
57605799
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2) {
57615800
return create(OperationJoinPatterns.when(p1, p2));
57625801
}
5802+
57635803
/**
57645804
* Joins together the results from several patterns.
5805+
* <p>
5806+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5807+
*
57655808
* @param p1 a plan
57665809
* @param p2 a plan
57675810
* @param p3 a plan
5768-
* @return An observable sequence with the results from matching several patterns
5811+
* @return an Observable sequence with the results from matching several
5812+
* patterns
5813+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57695814
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57705815
*/
57715816
@SuppressWarnings("unchecked")
57725817
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3) {
57735818
return create(OperationJoinPatterns.when(p1, p2, p3));
57745819
}
5820+
57755821
/**
57765822
* Joins together the results from several patterns.
5823+
* <p>
5824+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5825+
*
57775826
* @param p1 a plan
57785827
* @param p2 a plan
57795828
* @param p3 a plan
57805829
* @param p4 a plan
5781-
* @return An observable sequence with the results from matching several patterns
5830+
* @return an Observable sequence with the results from matching several
5831+
* patterns
5832+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57825833
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57835834
*/
57845835
@SuppressWarnings("unchecked")
57855836
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4) {
57865837
return create(OperationJoinPatterns.when(p1, p2, p3, p4));
57875838
}
5839+
57885840
/**
57895841
* Joins together the results from several patterns.
5842+
* <p>
5843+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5844+
*
57905845
* @param p1 a plan
57915846
* @param p2 a plan
57925847
* @param p3 a plan
57935848
* @param p4 a plan
57945849
* @param p5 a plan
5795-
* @return An observable sequence with the results from matching several patterns
5850+
* @return an Observable sequence with the results from matching several
5851+
* patterns
5852+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57965853
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57975854
*/
57985855
@SuppressWarnings("unchecked")
57995856
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5) {
58005857
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5));
58015858
}
5859+
58025860
/**
58035861
* Joins together the results from several patterns.
5862+
* <p>
5863+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5864+
*
58045865
* @param p1 a plan
58055866
* @param p2 a plan
58065867
* @param p3 a plan
58075868
* @param p4 a plan
58085869
* @param p5 a plan
58095870
* @param p6 a plan
5810-
* @return An observable sequence with the results from matching several patterns
5871+
* @return an Observable sequence with the results from matching several
5872+
* patterns
5873+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58115874
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58125875
*/
58135876
@SuppressWarnings("unchecked")
58145877
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5, Plan0<R> p6) {
58155878
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6));
58165879
}
5880+
58175881
/**
58185882
* Joins together the results from several patterns.
5883+
* <p>
5884+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5885+
*
58195886
* @param p1 a plan
58205887
* @param p2 a plan
58215888
* @param p3 a plan
58225889
* @param p4 a plan
58235890
* @param p5 a plan
58245891
* @param p6 a plan
58255892
* @param p7 a plan
5826-
* @return An observable sequence with the results from matching several patterns
5893+
* @return an Observable sequence with the results from matching several
5894+
* patterns
5895+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58275896
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58285897
*/
58295898
@SuppressWarnings("unchecked")
58305899
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5, Plan0<R> p6, Plan0<R> p7) {
58315900
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6, p7));
58325901
}
5902+
58335903
/**
58345904
* Joins together the results from several patterns.
5905+
* <p>
5906+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5907+
*
58355908
* @param p1 a plan
58365909
* @param p2 a plan
58375910
* @param p3 a plan
@@ -5840,15 +5913,21 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
58405913
* @param p6 a plan
58415914
* @param p7 a plan
58425915
* @param p8 a plan
5843-
* @return An observable sequence with the results from matching several patterns
5916+
* @return an Observable sequence with the results from matching several
5917+
* patterns
5918+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58445919
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58455920
*/
58465921
@SuppressWarnings("unchecked")
58475922
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5, Plan0<R> p6, Plan0<R> p7, Plan0<R> p8) {
58485923
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6, p7, p8));
58495924
}
5925+
58505926
/**
58515927
* Joins together the results from several patterns.
5928+
* <p>
5929+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5930+
*
58525931
* @param p1 a plan
58535932
* @param p2 a plan
58545933
* @param p3 a plan
@@ -5858,7 +5937,9 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
58585937
* @param p7 a plan
58595938
* @param p8 a plan
58605939
* @param p9 a plan
5861-
* @return An observable sequence with the results from matching several patterns
5940+
* @return an Observable sequence with the results from matching several
5941+
* patterns
5942+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58625943
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58635944
*/
58645945
@SuppressWarnings("unchecked")
@@ -5989,3 +6070,4 @@ public <K, V> Observable<Map<K, Collection<V>>> toMultimap(Func1<? super T, ? ex
59896070
return create(OperationToMultimap.toMultimap(this, keySelector, valueSelector, mapFactory, collectionFactory));
59906071
}
59916072
}
6073+

0 commit comments

Comments
 (0)