RxJava



rx.operators
Class OperationToFuture

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

public class OperationToFuture
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().


Constructor Summary
OperationToFuture()
           
 
Method Summary
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

OperationToFuture

public OperationToFuture()
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