How do I convert a `Map<String, List<Items&...
# announcements
h
How do I convert a
Map<String, List<Items>
into a
Map<String, List<Product>>
, example:
Copy code
val someMap: Map<String, List<Items>> =  x

 val newMap: Map<String, List<Product>>  = someMap.map { it. }  ??? what to do here?
k
Soemthing liek this should work:
Copy code
someMap.mapValues { (k, v) -> 
  v.map { item -> product }
 }
h
@kingsley thanks but it did not work:
Copy code
someMap.mapValues { (k, v) ->
                    v.map { item -> Product(it.)}
                }
Product is expecting arguments in its constructor as its declared like this
data class Product(val brand: String, val type: String)