Travis Griggs
10/25/2019, 3:07 PMas Hashmap
I get warnings/errors.
I feel like I’m missing some piece of the puzzle that it wasn’t obvious/apparent to me to put the as Hashmap there.gian
10/25/2019, 3:11 PMtoMutableMap
functiondiesieben07
10/25/2019, 3:13 PMxxxTo
methods, such as:
val result = myCollection.filterTo(HashMap()) { it > 5 }
Travis Griggs
10/25/2019, 3:16 PMdiesieben07
10/25/2019, 3:16 PMtoMutableMap
will give you a generic MutableMap
.Map
, MutableMap
, Collection
, List
, etc.) instead of implementations (like HashMap
).gian
10/25/2019, 3:19 PMTravis Griggs
10/25/2019, 3:20 PMdiesieben07
10/25/2019, 3:21 PMval registry: Map<PlanID, Plan> = HashMap()
gian
10/25/2019, 3:21 PMval registry: Map<PlanID, Plan> = mutableMapOf()
diesieben07
10/25/2019, 3:22 PMmutableMapOf
will give you some map implementation, you don't know which.gian
10/25/2019, 3:22 PMdiesieben07
10/25/2019, 3:22 PMLinkedHashMap
gian
10/25/2019, 3:23 PMMutableMap
Travis Griggs
10/25/2019, 3:25 PM