I have this interface:
public interface Command {
T execute(String... args);
}
it works fine for most uses. But when I try to mode
It looks fine to me. As others said, Void
was originally designed for the reflection mechanism, but it is now used in Generics quite often to describe situations such as yours.
Even better: Google, in their GWT framework, use the same idea in their examples for a void-returning callback (example here). I say: if Google does it, it must be at least OK.. :)