groovy - 如何在 Grovy 中对地图列表进行排序
问题描述
我是 groovy 的新手。这是我的代码。我有一个常规地图列表,例如:
list = [[query:"insert into table", order:5],
[query:"insert into table", order:1],
[query:"insert into table", order:2]]
我正在尝试如下
list.sort({ob1,ob2 -> ob1.order <=> ob2.order})
我想按顺序排序。
解决方案
推荐阅读
- php - 在 .php 文件中设置背景图像
- angular - 组件“失败:未捕获(承诺):TypeError:”的Angular7集成测试
- java - JAVA - 处理 Content-Type 的 HttpClient 请求:application/json
- php - 在已知字符串之后获取子字符串,直到第一个可选逗号
- angular - Angular Directive 未正确设置最近禁用的输入的焦点
- laravel - 为 laravel 5.5 安装护照
- swift - Firebase 数据库身份验证 Swift
- c# - C# .NET Framework 4.6.1 海量资料下载
- reference - 如何从 PowerQ 中引用可以更改行的数据
- selenium - 在 Yii2 中使用 Codeception 运行验收测试时出现问题