Mark Richards
unread,Oct 31, 2012, 6:14:43 PM10/31/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lam...@googlegroups.com
Hi,
This is a great piece of software, I'm loving it. Along with Hamcrest, it makes my life all the more easier.
I've been breaking my head over something..I would really appreciate any help I can get.
Say I have this setup.
class Person {
private List<Dog> dogList;
}
class Dog {
private String name;
private Integer age;
}
Person1 [Dog(Jono, 10)]
Person2 [Dog(Whatever, 10)]
Person3 [Dog(Whatever, 20)]
I want to find all person objects who have a dog with name "Jono" (which should return just Person1). Not sure how to code the "on" clause for it? I could implement the equals method for Dog class comparing just the names, but that wouldn't work if I have to match by Dog's age later. I can't seem to find similar examples in the Lambdaj Wiki.
on(Person.class).getDogList()????. Any thoughts on how to make this work?
Thanks