Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下是通常编写以进行迭代并基于某些条件的代码,我将添加到其他列表中。我如何在 Lambdaj 中编写相同的代码。在此先感谢您的建议是可观的。
List<Person> authorizedPerson = new ArrayList<Person>(); for(Person person : Pesrsons) { if(person .getAuthorized()) { authorizedPerson.add(person); } }
以下是上述问题的答案,我调查并找到了解决方案,如果有错误请纠正我。
List<Person> authorizedPesrson = select(persons, having(on(Person.class).getAuthorized().equals(true)));