shortcut for creating a Map from a List in groovy?

后端 未结 0 1869
南笙
南笙 2020-12-23 06:14

I\'d like some sorthand for this:

Map rowToMap(row) {
    def rowMap = [:];
    row.columns.each{ rowMap[it.name] = it.val }
    return rowMap;
}


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题