Skip to content

Instantly share code, notes, and snippets.

@arunma
Created September 15, 2012 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunma/3729377 to your computer and use it in GitHub Desktop.
Save arunma/3729377 to your computer and use it in GitHub Desktop.
FutureTask Runnable Adapter
static final class RunnableAdapter<T> implements Callable<T> {
final Runnable task;
final T result;
RunnableAdapter(Runnable task, T result) {
this.task = task;
this.result = result;
}
public T [More ...] call() {
task.run();
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment