private static < I , O > AsyncFunction < I , O > asAsyncFunction ( final Function < ? super I , ? extends O > function ) { return new AsyncFunction < I , O > ( ) { @ Override public ListenableFuture < O > apply ( I input ) { O output = function . apply ( input ) ; return immediateFuture ( output ) ; } } ; }
Wraps the given function as an AsyncFunction .