Java 哈希集搜索
下午好在
Java中,我有HashSet,其中包含对象User
的列表,其具有属性:
- 电子邮件
- 组
- 机器名
现在我的哈希集具有以下值(上述对象的列表)
email | group | machinename
----------------------------------------
[email protected] | hewitt | AP1
[email protected] | test | AP1
[email protected] | test | AP1
[email protected] | test | AP1
[email protected] | project | AP1
[email protected] | project | AP1
现在我必须找到那些具有相同的记录电子邮件和机器,但组名称不同,在上面的情况下是:
[email protected] (which has "project" and "test" group)
[email protected] (which has "hewitt" and "test" groups)
How can I find that using java code?
Good afternoon
In Java, I have HashSet which contain list of Object User
which has properties:
- group
- machinename
now my hashset has following values (list of above object)
email | group | machinename
----------------------------------------
[email protected] | hewitt | AP1
[email protected] | test | AP1
[email protected] | test | AP1
[email protected] | test | AP1
[email protected] | project | AP1
[email protected] | project | AP1
Now I have to find those records which has same email and machine but different group name which in above case are:
[email protected] (which has "project" and "test" group)
[email protected] (which has "hewitt" and "test" groups)
How can I find that using java code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将完全满足您的要求:
This will do exactly what you want: