/**
* 按排序号升序方法
* @param effectsChannellist2
* @return
*/
List<ChannelsVO> reSort(List<ChannelsVO> effectsChannellist2){
List<ChannelsVO> effectsChannellistnew = new ArrayList<>(effectsChannellist2);
//按sort 对集合进行重新排序;
Comparator<ChannelsVO> ascComparatorByAge = new BySortNum();
Collections.sort(effectsChannellistnew,ascComparatorByAge);
return effectsChannellistnew;
}
/**
* 重写排序逻辑
*/
class BySortNum implements Comparator<ChannelsVO> {
@Override
public int compare(ChannelsVO o1, ChannelsVO o2) {
//这可以修改来升序或者降序
//return o2.getAge() - o1.getAge();//降序
return o1.getSort() - o2.getSort();//升序
}
}