这是我的代码:
public class User{
private String id;
private String userName;
private Long birthDate;
private String address;
private boolean enabled;
//Constructors
// Getters && Setters
...
}
public class ServiceUser{
List<User> users=new ArrayList<>();
public ServiceUser(){
users.add(new User("OPS","MESSI",15454222454L,"ADRESSE 1",true))
users.add(new User("TA1","RICHARD",1245485456787L,"ADRESSE 1",true));
users.add(new User("XA5","LANG",659854575424L,"ADRESSE 2",true));
users.add(new User("DS7","RICHARD",1245485456787L,"ADRESSE 1",false));
users.add(new User("OPD6","LONG",659854575424L,"ADRESSE 2",false));
...
}
protected List<User> getFiltredUsers(){
// TODO here
}
}
我想获得如下用户列表:
User("OPS","MESSI",15454222454L,"ADRESSE 1",true)
如何删除所有重复的行,使用相同的用户名,出生日期,地址?
Nb:用户列表由数据库返回,只是为了示例,我这样说。
HUH函数
慕工程0101907
相关分类