getOrPut

fun <T : Any> getOrPut(type: KType, key: String, defaultValue: () -> T): T

Gets the value under key as type or puts and returns the value generated by defaultValue if it doesn't exist.


inline fun <T : Any> getOrPut(key: String, noinline defaultValue: () -> T): T

Gets the value under key as T or puts and returns the value generated by defaultValue if it doesn't exist.