I'm looking for a standard Javafx or java interface (if it exists) that acts like a Callback
, except that it does not return a value.
The standard Callback
from javafx.util
package is as follows:
public interface Callback<P,R> {
public R call(P param);
}
This is useful when you need to return the value, but I don't. I've looked into Callable<T>
:
public interface Callable<V> {
V call() throws Exception;
}
But this doesn't actually pass in a value into call
. What I'm looking for is basically this:
public interface Callable<V> {
void call(V value) throws Exception;
}
Is there a standard Java interface, or should I just create my own?