SerializerAwareValue
Functions
Link copied to clipboard
使用 指定格式格式 反序列化 (更新) 一个 SerializerAwareValue
Link copied to clipboard
fun <OldK, NewK, V> SerializerAwareValue<Map<OldK, V>>.mapKeys(oldToNew: (OldK) -> NewK, newToOld: (NewK) -> OldK): SerializerAwareValue<Map<NewK, V>>
fun <OldK, NewK, V : Any> SerializerAwareValue<PluginDataExtensions.NotNullMap<OldK, V>>.mapKeys(oldToNew: (OldK) -> NewK, newToOld: (NewK) -> OldK): SerializerAwareValue<PluginDataExtensions.NotNullMap<NewK, V>>
替换 Map 的 key
fun <OldK, NewK, V> SerializerAwareValue<MutableMap<OldK, V>>.mapKeys(oldToNew: (OldK) -> NewK, newToOld: (NewK) -> OldK): SerializerAwareValue<MutableMap<NewK, V>>
fun <OldK, NewK, V : Any> SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<OldK, V>>.mapKeys(oldToNew: (OldK) -> NewK, newToOld: (NewK) -> OldK): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<NewK, V>>
替换 MutableMap 的 key
Link copied to clipboard
Link copied to clipboard
使用 指定格式格式 序列化一个 SerializerAwareValue
Link copied to clipboard
fun <K, V> SerializerAwareValue<Map<K, V>>.withDefault(defaultValueComputer: (K) -> V): SerializerAwareValue<Map<K, V>>
fun <K, V : Any> SerializerAwareValue<Map<K, V>>.withDefault(defaultValueComputer: (K) -> V): SerializerAwareValue<PluginDataExtensions.NotNullMap<K, V>>
fun <K, V> SerializerAwareValue<MutableMap<K, V>>.withDefault(defaultValueComputer: (K) -> V): SerializerAwareValue<MutableMap<K, V>>
创建一个代理对象, 当 Map.get 返回 null
时先调用 defaultValueComputer 并放入 Map, 再返回调用的返回值
fun <K, V : Any> SerializerAwareValue<MutableMap<K, V>>.withDefault(defaultValueComputer: (K) -> V): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, V>>
Link copied to clipboard
fun <K, E> SerializerAwareValue<MutableMap<K, List<E>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, List<E>>>
fun <K, E> SerializerAwareValue<MutableMap<K, MutableList<E>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, MutableList<E>>>
fun <K, InnerE, InnerV> SerializerAwareValue<MutableMap<K, Map<InnerE, InnerV>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, Map<InnerE, InnerV>>>
fun <K, InnerE, InnerV> SerializerAwareValue<MutableMap<K, MutableMap<InnerE, InnerV>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, MutableMap<InnerE, InnerV>>>
创建一个代理对象, 当 Map.get 返回 null
时先放入一个 LinkedHashMap, 再从 this 中取出链接自动保存的 LinkedHashMap. (MutableMap.getOrPut 的替代)
fun <K, E> SerializerAwareValue<MutableMap<K, MutableSet<E>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, MutableSet<E>>>
fun <K, E> SerializerAwareValue<MutableMap<K, Set<E>>>.withEmptyDefault(): SerializerAwareValue<PluginDataExtensions.NotNullMutableMap<K, Set<E>>>
创建一个代理对象, 当 Map.get 返回 null
时先放入一个 LinkedHashSet, 再从 this 中取出链接自动保存的 LinkedHashSet.