lundi 16 novembre 2015

Java lambda expression as function parameter

I am trying to make a function that receives a lambda expression as a parameter. But, here is the tricky part It receives a condition of the object vehicle and gets the data matched from my mongodb.

Example:

MongoAccessor.filter((Vehicle vc) -> vc.id == 5)

(MongoAccessor is the DAL class which i activate the method in to preform the query)

Then it will process and return the data from the mongodb. I can't figure out where the actual implementation is supposed to be and how to get the condition needed from the lambda. I have already created an interface to match the lambda.

Aucun commentaire:

Enregistrer un commentaire