Class BlockingOperatorToFuture


  • public final class BlockingOperatorToFuture
    extends java.lang.Object
    Returns a Future representing the single value emitted by an Observable.

    The toFuture operation throws an exception if the Observable emits more than one item. If the Observable may emit more than item, use toList().toFuture().

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.concurrent.Future<T> toFuture​(Observable<? extends T> that)
      Returns a Future that expects a single item from the observable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockingOperatorToFuture

        private BlockingOperatorToFuture()
    • Method Detail

      • toFuture

        public static <T> java.util.concurrent.Future<T> toFuture​(Observable<? extends T> that)
        Returns a Future that expects a single item from the observable.
        Type Parameters:
        T - the type of source.
        Parameters:
        that - an observable sequence to get a Future for.
        Returns:
        the Future to retrieve a single elements from an Observable