Skip to content

Commit

Permalink
Merge pull request #723 from benjchristensen/deprecation
Browse files Browse the repository at this point in the history
Deprecate multiple arity ‘from’
  • Loading branch information
benjchristensen committed Jan 6, 2014
2 parents 7a75d4b + e36e717 commit 8de063e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,9 @@ public static <T> Observable<T> from(T t1) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2) {
Expand All @@ -873,7 +875,9 @@ public static <T> Observable<T> from(T t1, T t2) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3) {
Expand All @@ -898,7 +902,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4) {
Expand All @@ -924,7 +930,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5) {
Expand All @@ -951,7 +959,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6) {
Expand Down Expand Up @@ -979,7 +989,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7) {
Expand Down Expand Up @@ -1008,7 +1020,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7) {
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8) {
Expand Down Expand Up @@ -1038,7 +1052,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8, T t9) {
Expand All @@ -1064,7 +1080,9 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T
* resulting Observable
* @return an Observable that emits each item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#from">RxJava Wiki: from()</a>
* @deprecated Use {@link #from(Iterable)} instead such as {@code from(Arrays.asList(t1))}.
*/
@Deprecated
@SuppressWarnings("unchecked")
// suppress unchecked because we are using varargs inside the method
public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8, T t9, T t10) {
Expand Down Expand Up @@ -1175,7 +1193,9 @@ public static <T> Observable<T> defer(Func0<? extends Observable<? extends T>> o
* @param <T> the type of that item
* @return an Observable that emits a single item and then completes
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#just">RxJava Wiki: just()</a>
* @deprecated Use {@link #from(T)}
*/
@Deprecated
public static <T> Observable<T> just(T value) {
return from(Arrays.asList((value)));
}
Expand All @@ -1194,7 +1214,9 @@ public static <T> Observable<T> just(T value) {
* @return an Observable that emits a single item and then completes, on a
* specified scheduler
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#just">RxJava Wiki: just()</a>
* @deprecated Use {@link #from(T)}
*/
@Deprecated
public static <T> Observable<T> just(T value, Scheduler scheduler) {
return from(Arrays.asList((value)), scheduler);
}
Expand Down Expand Up @@ -3898,6 +3920,7 @@ public <R> Observable<R> switchMap(Func1<? super T, ? extends Observable<? exten
* @see <a href="https://github.com/Netflix/RxJava/wiki/Filtering-Observables#filter-or-where">RxJava Wiki: where()</a>
* @see #filter(Func1)
*/
@Deprecated
public Observable<T> where(Func1<? super T, Boolean> predicate) {
return filter(predicate);
}
Expand Down Expand Up @@ -3935,6 +3958,7 @@ public <R> Observable<R> map(Func1<? super T, ? extends R> func) {
* @see <a href="http://msdn.microsoft.com/en-us/library/hh244311.aspx">MSDN: Observable.Select</a>
* @deprecated just use zip with {@link Observable#range(int)}
*/
@Deprecated
public <R> Observable<R> mapWithIndex(Func2<? super T, Integer, ? extends R> func) {
return create(OperationMap.mapWithIndex(this, func));
}
Expand All @@ -3959,6 +3983,7 @@ public <R> Observable<R> mapWithIndex(Func2<? super T, Integer, ? extends R> fun
* @see #flatMap(Func1)
* @deprecated
*/
@Deprecated
public <R> Observable<R> mapMany(Func1<? super T, ? extends Observable<? extends R>> func) {
return mergeMap(func);
}
Expand Down Expand Up @@ -5237,6 +5262,7 @@ public ConnectableObservable<T> publishLast() {
* @see #reduce(Func2)
* @deprecated use #reduce(Func2)
*/
@Deprecated
public Observable<T> aggregate(Func2<T, T, T> accumulator) {
return reduce(accumulator);
}
Expand Down Expand Up @@ -5303,6 +5329,7 @@ public R call(R state, T value) {
* @see #reduce(Object, Func2)
* @deprecated use #reduce(Object, Func2)
*/
@Deprecated
public <R> Observable<R> aggregate(R initialValue, Func2<R, ? super T, R> accumulator) {
return reduce(initialValue, accumulator);
}
Expand Down

0 comments on commit 8de063e

Please sign in to comment.