下面我将介绍一下如何为一个List<People>
这样的List里面的某个属性进行去重。顺便介绍一下两个实体之间如何用lambda进行复制
OK,我们先来写一个Person实体
package com.dzy.test.lambda;
/**
* Created by itar
*/
public class Person {
private int age;
private String name;
private String country;
private String address;
private String phone;
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String