I'm new to lambdas and functional interfaces. I'm trying to implement a RowListener functional interface (ActiveJDBC ORM) with a lambda but I get a compiler error and I don't really know why.
Here's how the anonymous class old-style looks like:
db.find("some query", new RowListener() {
@Override
public boolean next(Map<String, Object> arg0) {
// TODO Auto-generated method stub
return false;
}
});
Here's what I want to do:
db.find("some query", map -> {
// whatever
});
The error that gives me is:
The method find(String, Object...) in the type Base is not applicable for the arguments (String, ( map) -> {})
I think it's trying to apply the lambda to an overloaded method of 'find' which doesn't take a RowListener as an argument, but I'm not really sure why.
Any light you can shed on this would be helpful.