kotlin
kotlin
pediyasm
有点懒!
展开
-
使用 Room 引用复杂数据
使用 Room 引用复杂数据 Room 提供了在基元类型和盒装类型之间进行转换的功能,但不允许实体之间进行对象引用。本文档介绍了如何使用类型转换器,以及 Room 为何不支持对象引用。 使用类型转换器 有时,您的应用需要使用自定义数据类型,其中包含您想要存储到单个数据库列中的值。要为自定义类型添加此类支持,您需要提供一个 TypeConverter,它可以在自定义类与 Room 可以保留的已知类型...转载 2020-01-08 11:25:24 · 749 阅读 · 0 评论 -
kotlin 集合 map flatten flatMap
map map就是将transform方法产生的结果添加到一个新的集合里面去,然后返回这个新的集合 /** * Returns a list containing the results of applying the given [transform] function * to each element in the original collection. * * @sample ...原创 2019-12-29 15:31:00 · 1335 阅读 · 0 评论 -
kotlin 作用域函数 run with apply aslo let
public inline fun <T, R> T.run(block: T.() -> R): R { return block() } public inline fun <T, R> with(receiver: T, block: T.() -> R): R { return receiver.block() } public in...原创 2019-12-28 15:09:55 · 148 阅读 · 0 评论