Map with Key as String and Value as List in Groovy

前端 未结 5 607
慢半拍i
慢半拍i 2021-02-03 18:54

Can anyone point me to an example of how to use a Map in Groovy which has a String as its key and a List as value?

5条回答
  •  太阳男子
    2021-02-03 19:30

    def map = [:]
    map["stringKey"] = [1, 2, 3, 4]
    map["anotherKey"] = [55, 66, 77]
    
    assert map["anotherKey"] == [55, 66, 77] 
    

提交回复
热议问题