groovy grails List 集合 排序方法

转:https://stackoverflow.com/questions/17223851/sort-list-by-date-in-descending-order-groovy-madness  

List list = new ArrayList()

//按照createDate升序排序

list .sort({it?.createDate}) 

//按照createDate降序排序

ist .reverse()


评论

© zhanggc | Powered by LOFTER