Is there an interface in Java similar to the Callable
interface, that can accept an argument to its call method?
Like so:
public interface M
Since Java 8 there is a whole set of Function-like interfaces in the java.util.function package. The one you're asking for specifically is simply Function.
Prior to Java 8, there was no general-purpose, built-in interface for this, but some libraries provided it.
For example Guava has the FunctionT apply(F input)
. It also makes heavy use of that interface in several places.