@@ -5483,7 +5483,6 @@ public static <T> Observable<T> amb(Iterable<? extends Observable<? extends T>>
5483
5483
return create (OperationAmb .amb (sources ));
5484
5484
}
5485
5485
5486
-
5487
5486
/**
5488
5487
* Invokes an action for each item emitted by the Observable.
5489
5488
* <p>
@@ -5692,142 +5691,216 @@ private boolean isInternalImplementation(Object o) {
5692
5691
return isInternal ;
5693
5692
}
5694
5693
}
5694
+
5695
5695
/**
5696
- * Creates a pattern that matches when both observable sequences have an available element.
5697
- * @param right Observable sequence to match with the left sequence.
5698
- * @return Pattern object that matches when both observable sequences have an available element.
5696
+ * Creates a pattern that matches when both Observable sequences have an
5697
+ * available item.
5698
+ * <p>
5699
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5700
+ *
5701
+ * @param right Observable sequence to match with the left sequence
5702
+ * @return Pattern object that matches when both Observable sequences have
5703
+ * an available item
5704
+ * @throws NullPointerException if <code>right</code> is null
5705
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">and()</a>
5699
5706
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229153.aspx'>MSDN: Observable.And</a>
5700
- * @throws NullPointerException if right is null
5701
5707
*/
5702
5708
public <T2 > Pattern2 <T , T2 > and (Observable <T2 > right ) {
5703
5709
return OperationJoinPatterns .and (this , right );
5704
5710
}
5711
+
5705
5712
/**
5706
- * Matches when the observable sequence has an available element and projects the element by invoking the selector function.
5707
- * @param selector Selector that will be invoked for elements in the source sequence.
5708
- * @return Plan that produces the projected results, to be fed (with other plans) to the When operator.
5713
+ * Matches when the Observable sequence has an available item and
5714
+ * projects the item by invoking the selector function.
5715
+ * <p>
5716
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5717
+ *
5718
+ * @param selector Selector that will be invoked for elements in the source
5719
+ * sequence
5720
+ * @return Plan that produces the projected results, to be fed (with other
5721
+ * plans) to the When operator
5722
+ * @throws NullPointerException if <code>selector</code> is null
5723
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">then()</a>
5709
5724
* @see <a href='http://msdn.microsoft.com/en-us/library/hh211662.aspx'>MSDN: Observable.Then</a>
5710
- * @throws NullPointerException if selector is null
5711
5725
*/
5712
5726
public <R > Plan0 <R > then (Func1 <T , R > selector ) {
5713
5727
return OperationJoinPatterns .then (this , selector );
5714
5728
}
5729
+
5715
5730
/**
5716
5731
* Joins together the results from several patterns.
5717
- * @param plans A series of plans created by use of the Then operator on patterns.
5718
- * @return An observable sequence with the results from matching several patterns.
5732
+ * <p>
5733
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5734
+ *
5735
+ * @param plans a series of plans created by use of the Then operator on
5736
+ * patterns
5737
+ * @return an Observable sequence with the results from matching several
5738
+ * patterns
5739
+ * @throws NullPointerException if <code>plans</code> is null
5740
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5719
5741
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5720
- * @throws NullPointerException if plans is null
5721
5742
*/
5722
5743
public static <R > Observable <R > when (Plan0 <R >... plans ) {
5723
5744
return create (OperationJoinPatterns .when (plans ));
5724
5745
}
5746
+
5725
5747
/**
5726
5748
* Joins together the results from several patterns.
5727
- * @param plans A series of plans created by use of the Then operator on patterns.
5728
- * @return An observable sequence with the results from matching several patterns.
5749
+ * <p>
5750
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5751
+ *
5752
+ * @param plans a series of plans created by use of the Then operator on
5753
+ * patterns
5754
+ * @return an Observable sequence with the results from matching several
5755
+ * patterns
5756
+ * @throws NullPointerException if <code>plans</code> is null
5757
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5729
5758
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229558.aspx'>MSDN: Observable.When</a>
5730
- * @throws NullPointerException if plans is null
5731
5759
*/
5732
5760
public static <R > Observable <R > when (Iterable <? extends Plan0 <R >> plans ) {
5733
5761
if (plans == null ) {
5734
5762
throw new NullPointerException ("plans" );
5735
5763
}
5736
5764
return create (OperationJoinPatterns .when (plans ));
5737
5765
}
5766
+
5738
5767
/**
5739
5768
* Joins the results from a pattern.
5769
+ * <p>
5770
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5771
+ *
5740
5772
* @param p1 the plan to join
5741
- * @return An observable sequence with the results from matching a pattern
5773
+ * @return an Observable sequence with the results from matching a pattern
5774
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5742
5775
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5743
5776
*/
5744
5777
@ SuppressWarnings ("unchecked" )
5745
5778
public static <R > Observable <R > when (Plan0 <R > p1 ) {
5746
5779
return create (OperationJoinPatterns .when (p1 ));
5747
5780
}
5781
+
5748
5782
/**
5749
5783
* Joins together the results from several patterns.
5784
+ * <p>
5785
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5786
+ *
5750
5787
* @param p1 a plan
5751
5788
* @param p2 a plan
5752
- * @return An observable sequence with the results from matching several patterns
5789
+ * @return an Observable sequence with the results from matching several
5790
+ * patterns
5791
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5753
5792
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5754
5793
*/
5755
5794
@ SuppressWarnings ("unchecked" )
5756
5795
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 ) {
5757
5796
return create (OperationJoinPatterns .when (p1 , p2 ));
5758
5797
}
5798
+
5759
5799
/**
5760
5800
* Joins together the results from several patterns.
5801
+ * <p>
5802
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5803
+ *
5761
5804
* @param p1 a plan
5762
5805
* @param p2 a plan
5763
5806
* @param p3 a plan
5764
- * @return An observable sequence with the results from matching several patterns
5807
+ * @return an Observable sequence with the results from matching several
5808
+ * patterns
5809
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5765
5810
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5766
5811
*/
5767
5812
@ SuppressWarnings ("unchecked" )
5768
5813
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 ) {
5769
5814
return create (OperationJoinPatterns .when (p1 , p2 , p3 ));
5770
5815
}
5816
+
5771
5817
/**
5772
5818
* Joins together the results from several patterns.
5819
+ * <p>
5820
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5821
+ *
5773
5822
* @param p1 a plan
5774
5823
* @param p2 a plan
5775
5824
* @param p3 a plan
5776
5825
* @param p4 a plan
5777
- * @return An observable sequence with the results from matching several patterns
5826
+ * @return an Observable sequence with the results from matching several
5827
+ * patterns
5828
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5778
5829
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5779
5830
*/
5780
5831
@ SuppressWarnings ("unchecked" )
5781
5832
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 ) {
5782
5833
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 ));
5783
5834
}
5835
+
5784
5836
/**
5785
5837
* Joins together the results from several patterns.
5838
+ * <p>
5839
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5840
+ *
5786
5841
* @param p1 a plan
5787
5842
* @param p2 a plan
5788
5843
* @param p3 a plan
5789
5844
* @param p4 a plan
5790
5845
* @param p5 a plan
5791
- * @return An observable sequence with the results from matching several patterns
5846
+ * @return an Observable sequence with the results from matching several
5847
+ * patterns
5848
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5792
5849
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5793
5850
*/
5794
5851
@ SuppressWarnings ("unchecked" )
5795
5852
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 ) {
5796
5853
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 ));
5797
5854
}
5855
+
5798
5856
/**
5799
5857
* Joins together the results from several patterns.
5858
+ * <p>
5859
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5860
+ *
5800
5861
* @param p1 a plan
5801
5862
* @param p2 a plan
5802
5863
* @param p3 a plan
5803
5864
* @param p4 a plan
5804
5865
* @param p5 a plan
5805
5866
* @param p6 a plan
5806
- * @return An observable sequence with the results from matching several patterns
5867
+ * @return an Observable sequence with the results from matching several
5868
+ * patterns
5869
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5807
5870
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5808
5871
*/
5809
5872
@ SuppressWarnings ("unchecked" )
5810
5873
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 , Plan0 <R > p6 ) {
5811
5874
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 ));
5812
5875
}
5876
+
5813
5877
/**
5814
5878
* Joins together the results from several patterns.
5879
+ * <p>
5880
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5881
+ *
5815
5882
* @param p1 a plan
5816
5883
* @param p2 a plan
5817
5884
* @param p3 a plan
5818
5885
* @param p4 a plan
5819
5886
* @param p5 a plan
5820
5887
* @param p6 a plan
5821
5888
* @param p7 a plan
5822
- * @return An observable sequence with the results from matching several patterns
5889
+ * @return an Observable sequence with the results from matching several
5890
+ * patterns
5891
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5823
5892
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5824
5893
*/
5825
5894
@ SuppressWarnings ("unchecked" )
5826
5895
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 ) {
5827
5896
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 , p7 ));
5828
5897
}
5898
+
5829
5899
/**
5830
5900
* Joins together the results from several patterns.
5901
+ * <p>
5902
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5903
+ *
5831
5904
* @param p1 a plan
5832
5905
* @param p2 a plan
5833
5906
* @param p3 a plan
@@ -5836,15 +5909,21 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
5836
5909
* @param p6 a plan
5837
5910
* @param p7 a plan
5838
5911
* @param p8 a plan
5839
- * @return An observable sequence with the results from matching several patterns
5912
+ * @return an Observable sequence with the results from matching several
5913
+ * patterns
5914
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5840
5915
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5841
5916
*/
5842
5917
@ SuppressWarnings ("unchecked" )
5843
5918
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 ) {
5844
5919
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 , p7 , p8 ));
5845
5920
}
5921
+
5846
5922
/**
5847
5923
* Joins together the results from several patterns.
5924
+ * <p>
5925
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5926
+ *
5848
5927
* @param p1 a plan
5849
5928
* @param p2 a plan
5850
5929
* @param p3 a plan
@@ -5854,11 +5933,14 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
5854
5933
* @param p7 a plan
5855
5934
* @param p8 a plan
5856
5935
* @param p9 a plan
5857
- * @return An observable sequence with the results from matching several patterns
5936
+ * @return an Observable sequence with the results from matching several
5937
+ * patterns
5938
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5858
5939
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5859
5940
*/
5860
5941
@ SuppressWarnings ("unchecked" )
5861
5942
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 , Plan0 <R > p9 ) {
5862
5943
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 , p7 , p8 , p9 ));
5863
5944
}
5864
5945
}
5946
+
0 commit comments