public static < T > ListenableFuture < T > createListenableFuture ( ValueSourceFuture < T > valueSourceFuture ) { if ( valueSourceFuture instanceof ListenableFutureBackedValueSourceFuture ) { return ( ( ListenableFutureBackedValueSourceFuture < T > ) valueSourceFuture ) . getWrappedFuture ( ) ; } else { return new ValueSourceFutureBackedListenableFuture <> ( valueSourceFuture ) ; } }
Creates listenable future from ValueSourceFuture . We have to send all Future API calls to ValueSourceFuture .