I have just begun to use Java 8 and I am wondering if there is a way to write a method that returns a Function
?
Right now I have method like below:
I would like to point out that it might be more appropriate to use the built-in IntFunction in this case:
IntFunction getMyFunction() {
return it -> "Hello, world: " + it;
}
IntFunction
is a part of the standard API for functional interfaces which defines a range of good to have interfaces, mostly related to Java primitives.