如何使用 lambdaj 或其他工具过滤表
如何使用 lambdaj 过滤表格?
给出下表:
id name age male salary 1 tom 22 y 3k 2 nancy 24 n 3.5k 3 jack 22 y 2k 4 jmme 29 y 4k
如果我应用过滤器:
age >= 22 && salary > 3k
那么我会得到:
2 nancy 24 n 3.5k 4 jmme 29 y 4k
如您所知,我无法为其创建域类,这阻止我使用以下语法:
filter(having(on(Person.class).getAge(),greaterThan(22)), myManList);
How can I filter a table using lambdaj?
Given the following table:
id name age male salary 1 tom 22 y 3k 2 nancy 24 n 3.5k 3 jack 22 y 2k 4 jmme 29 y 4k
If I applied the filter:
age >= 22 && salary > 3k
then I would get:
2 nancy 24 n 3.5k 4 jmme 29 y 4k
As you know, I cannot create a domain class for it, which prevents me from using the following syntax:
filter(having(on(Person.class).getAge(),greaterThan(22)), myManList);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)