/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }
@Override public void updated(B result) { final A adaptedResult = adapt(result); if (completionHandler != null) { completionHandler.updated(adaptedResult); } }
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B, A> adapter) { this.future = future; this.completionHandler = completionHandler; if (adapter != null) { this.adapter = adapter; } else { this.adapter = getDirectAdapter(); } }
/** * Creates {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. * * @return {@link CompletionHandler}, which may serve as a bridge for passed * {@link FutureImpl} and {@link CompletionHandler} objects. * All the notifications coming to the returned {@link CompletionHandler} * will be passed to the {@link FutureImpl} and {@link CompletionHandler} * passed as parameters. */ public static <R> CompletionHandler<R> toCompletionHandler( final FutureImpl<R> future, final CompletionHandler<R> completionHandler) { return new CompletionHandlerAdapter<R, R>(future, completionHandler); }