I am currently working on this project . This works surprisingly well.
However, after reading README again, I began to think about how to document something that was pushing me ...
To give an example and forgetting for a moment that exceptions can be thrown, he reads:
Files.list(somePath).map(Path::toRealPath).forEach(System.out::println)
OK Now the Path method is associated with this . Of course, we do not pass LinkOption .
Again: let's forget for a moment that it raises any exception.
The .map() stream takes a Function value as an argument. This interface for Function<T, R> is defined as:
R apply(T t);
But the method I use takes no arguments. At first glance, it doesn't seem to match Function , right? Moreover...
It can be written as:
path -> path.toRealPath()
It seems that the mechanism used is somewhat capable of invoking a method in a "stream object" if the method reference has no argument or something like this ...
I would like to document this, and I missed something here.
What am I missing?
source share