Simon Kågedal Reimer
12/11/2019, 12:39 PMVertxHttpHeaders
. That’s a type that implements Iterable<Map.Entry<String, String>>
but it does not implement Map
. I want to filter out some headers and get back a Map. This is what I’ve come up with:
headers
.map { it.toPair() }
.toMap()
.filterKeys { noCopyHeaders.contains(it).not() }
Can I do better somehow? 🙂 I wish I didn’t have to do the two-step conversion to the map and I wish I had a `filterNotKeys`… I guess I could just add those as extensionsDominaezzz
12/11/2019, 3:34 PMheaders.associate { it.toPair() }
.filterKeys { noCopyHeaders.contains(it).not() }
Simon Kågedal Reimer
12/11/2019, 5:51 PM