RxJava



rx.operators
Class OperationAny

java.lang.Object
  extended by rx.operators.OperationAny

public final class OperationAny
extends java.lang.Object

Returns an Observable that emits true if any element of an observable sequence satisfies a condition, otherwise false.


Constructor Summary
OperationAny()
           
 
Method Summary
static
<T> Observable.OnSubscribeFunc<java.lang.Boolean>
any(Observable<? extends T> source)
          Returns an Observable that emits true if the source Observable is not empty, otherwise false.
static
<T> Observable.OnSubscribeFunc<java.lang.Boolean>
any(Observable<? extends T> source, Func1<? super T,java.lang.Boolean> predicate)
          Returns an Observable that emits true if any element of the source Observable satisfies the given condition, otherwise false.
static
<T> Observable.OnSubscribeFunc<java.lang.Boolean>
exists(Observable<? extends T> source, Func1<? super T,java.lang.Boolean> predicate)
           
static
<T> Observable.OnSubscribeFunc<java.lang.Boolean>
isEmpty(Observable<? extends T> source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationAny

public OperationAny()
Method Detail

any

public static <T> Observable.OnSubscribeFunc<java.lang.Boolean> any(Observable<? extends T> source)
Returns an Observable that emits true if the source Observable is not empty, otherwise false.

Parameters:
source - The source Observable to check if not empty.
Returns:
A subscription function for creating the target Observable.

isEmpty

public static <T> Observable.OnSubscribeFunc<java.lang.Boolean> isEmpty(Observable<? extends T> source)

any

public static <T> Observable.OnSubscribeFunc<java.lang.Boolean> any(Observable<? extends T> source,
                                                                    Func1<? super T,java.lang.Boolean> predicate)
Returns an Observable that emits true if any element of the source Observable satisfies the given condition, otherwise false. Note: always emit false if the source Observable is empty.

Parameters:
source - The source Observable to check if any element satisfies the given condition.
predicate - The condition to test every element.
Returns:
A subscription function for creating the target Observable.

exists

public static <T> Observable.OnSubscribeFunc<java.lang.Boolean> exists(Observable<? extends T> source,
                                                                       Func1<? super T,java.lang.Boolean> predicate)