Lilly
09/13/2021, 10:25 PMList<Map<String, String>>.
I would like to add a pair to a specific map in the list which I determine with
myList.find { it["myKey"] == "keyValue" }
What is the best approach to achieve this. The first option that comes in mind is to remove the map and add the map with the new pair. Any better ideas?Daniel Dawson
09/14/2021, 1:04 AMmyList.find { it["myKey"] == "keyValue" }
?.also { it["newKey"] = "newValue" }
Johnjake Talledo
09/14/2021, 2:41 AMmapof
as there are a lot of comparison operator.Johnjake Talledo
09/14/2021, 2:41 AMmyList.find { item -> item.filterKeys { it == "keyValue" } }
Johnjake Talledo
09/14/2021, 2:45 AMfilterKeys()
, filterValues()
,filter()
, containsKey()
and containsValue()