feat: add toStringMap function

This commit is contained in:
2023-09-06 22:48:23 +08:00
parent 2e73f36bf0
commit f66cdc1f31

View File

@@ -21,6 +21,12 @@
*/
package com.highcapable.sweetproperty.utils
/**
* 转换当前 [Map] 键值到字符串类型
* @return [Map]<[String], [String]>
*/
internal inline fun <reified K, V> Map<K, V>.toStringMap() = mapKeys { e -> e.key.toString() }.mapValues { e -> e.value.toString() }
/**
* 当数组不为空时返回非空
* @return [T] or null