I was using Project Lambdas' .map() method to extract some data from a List object. Before, Jdk 1.8 contained Mapper interface but now, I see that it map method gets Function interface. My method usage below:
List<Nut> nutList =new ArrayList<Nut>();
I've added some items to nutList and im using below method to extract a fields value by getter.
nutList.stream().map(n->n.getShell())
But above n parameter behave like an Object and it doesn't access to original object's method. This usage was normally run with Mapper Functional interface.
Under b75, the following code compiles and runs correctly:
List<Nut> nutList =new ArrayList<>();
nutList.stream().map(n -> n.getShell()).forEach(System.out::print);
Perhaps you're using an older version?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With