//根据优先级排序
Collections.sort(rules,new Comparator(){
public int compare(UserTempRuleGroupDetail rule1, UserTempRuleGroupDetail rule2) {
//按照优先级进行升序排列
if(rule1.getRulePriority() > rule2.getRulePriority()){
return 1;
}
if(rule1.getRulePriority() == rule2.getRulePriority()){
return 0;
}
return -1;
}
});
List根据里面的对象属性的值进行排序
最新推荐文章于 2023-07-19 20:01:06 发布