public static <I, O> ListenableFuture<O> transformAsync(
      ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function) {
    return AbstractTransformFuture.create(input, function);
  }
public static < I , O > ListenableFuture < O > transformAsync ( ListenableFuture < I > input , AsyncFunction < ? super I , ? extends O > function ) { return AbstractTransformFuture . create ( input , function ) ; }
Returns a new {@code Future} whose result is asynchronously derived from the result of the
given {@code Future}. If the given {@code Future} fails, the returned {@code Future} fails with
the same exception (and the function is not invoked).

<p>More precisely, the returned {@code Future} takes its result from a {@code Future} produced
by applying the given {@code AsyncFunction} to the result of the original {@code Future}.
Example usage:

<pre>   {@code
ListenableFuture<RowKey> rowKeyFuture = indexService.lookUp(query);
AsyncFunction<RowKey, QueryResult> queryFunction =
new AsyncFunction<RowKey, QueryResult>() {
public ListenableFuture<QueryResult> apply(RowKey rowKey) {
return dataService.read(rowKey);
}
};
ListenableFuture<QueryResult> queryFuture =
transformAsync(rowKeyFuture, queryFunction);}</pre>

<p>This overload, which does not accept an executor, uses {@code directExecutor}, a dangerous
choice in some cases. See the discussion in the {@link ListenableFuture#addListener
ListenableFuture.addListener} documentation. The documentation's warnings about "lightweight
listeners" refer here to the work done during {@code AsyncFunction.apply}, not to any work done
to complete the returned {@code Future}.

<p>The returned {@code Future} attempts to keep its cancellation state in sync with that of the
input future and that of the future returned by the function. That is, if the returned {@code
Future} is cancelled, it will attempt to cancel the other two, and if either of the other two
is cancelled, the returned {@code Future} will receive a callback in which it will attempt to
cancel itself.

@param input The future to transform
@param function A function to transform the result of the input future to the result of the
output future
@return A future that holds result of the function (if the input succeeded) or the original
input's failure (if not)
@since 19.0 (in 11.0 as {@code transform})