Questions tagged «expandometaclass»

8
从groovy中的列表创建地图的快捷方式?
我想要一些排序方法: Map rowToMap(row) { def rowMap = [:]; row.columns.each{ rowMap[it.name] = it.val } return rowMap; } 鉴于GDK的工作方式,我希望能够做类似的事情: Map rowToMap(row) { row.columns.collectMap{ [it.name,it.val] } } 但我没有在文档中看到任何内容...我缺少什么吗?还是我太懒了?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.