对集合里面的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>()
{
@Override
public int compare(LeadingFollowupEntitlementView obj1, LeadingFollowupEntitlementView obj2)
{
return obj1.getEntitlementNo().compareTo(obj2.getEntitlementNo());
}
});
这里是把followupEntitlementss 集合里面的元素按照EntitlementNo进行升序排序。