toThreeLevelMap

fun <K1, K2, K3, V> Map<Triple<K1, K2, K3>, V>.toThreeLevelMap(): Map<K1, Map<K2, Map<K3, V>>>(source)

Works similarly as toTwoLevelMap but the final map has three levels.


inline fun <K1, K2, K3, V, M3 : MutableMap<K3, V>, M2 : MutableMap<K2, M3>, M1 : MutableMap<K1, M2>> Map<Triple<K1, K2, K3>, V>.toThreeLevelMap(topDestination: M1, middleDestination: () -> M2, bottomDestination: () -> M3): M1(source)

Works similarly as toTwoLevelMap but the final map has three levels. topDestination specifies which map should be used to store the new primary keys, middleDestination is used to store the new secondary keys and bottomDestination is used to store the new tertiary keys.