对象数组的转化
1.根据对象数组中的某一个属性进行数组排序
Collections.sort(pointList, new Comparator<Point>(){
@Override
public int compare(Point p1, Point p2) {
//排序属性
if(p1.getXCoordinate() <=p2.getXCoordinate()){
return 1;
}
return -1;
}
});
2.根据对象的集合获取属性的集合
ObjectList.stream().map(Meter ::getId).collect(Collectors.toList())