本文主要是介绍对集合里面Dto进行排序,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
对集合里面的Dto进行排序
原文转载自:https://blog.csdn.net/xiaofei__/article/details/53138681
List Sorted by specific filter(EntitlementNo):
List<LeadingFollowupEntitlementView> followupEntitlementss = new ArrayList();
LeadingFollowupEntitlementView leadingFollowupEntitlementView = new LeadingFollowupEntitlementView();
followupEntitlementss.add(leadingFollowupEntitlementView );
followupEntitlementss.sort(new Comparator<LeadingFollowupEntitlementView>(){@Overridepublic int compare(LeadingFollowupEntitlementView obj1, LeadingFollowupEntitlementView obj2){return obj1.getEntitlementNo().compareTo(obj2.getEntitlementNo());}});
这里是把followupEntitlementss 集合里面的元素按照EntitlementNo进行升序排序。
这篇关于对集合里面Dto进行排序的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!