Class OperatorToObservableList<T>

  • Type Parameters:
    T - the value type of the input and the output list's items
    All Implemented Interfaces:
    Func1<Subscriber<? super java.util.List<T>>,​Subscriber<? super T>>, Function, Observable.Operator<java.util.List<T>,​T>

    public final class OperatorToObservableList<T>
    extends java.lang.Object
    implements Observable.Operator<java.util.List<T>,​T>
    Returns an Observable that emits a single item, a list composed of all the items emitted by the source Observable.

    Normally, an Observable that returns multiple items will do so by invoking its subscriber's onNext method for each such item. You can change this behavior, instructing the Observable to compose a list of all of these multiple items and then to invoke the subscriber's onNext method once, passing it the entire list, by using this operator.

    Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.

    • Constructor Detail

      • OperatorToObservableList

        OperatorToObservableList()
    • Method Detail

      • instance

        public static <T> OperatorToObservableList<T> instance()
        Type Parameters:
        T - the value type of the input and the output list's items
        Returns:
        a singleton instance of this stateless operator.