When Callable<V> is not enough

At work today I ended up having to write this because Callable<V> wasn’t flexible enough for what I needed:

public interface Operation<V, E extends Throwable> {
  V execute() throws E;
}

…would love to see this (as well as a Pair<A,B> class) in a future cut of Java.

This entry was posted in Java. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. marm
    Posted November 1, 2009 at 7:45 pm | Permalink

    I know I had the same problem!!!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>