📜  房间数据库类型转换器 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:50.498000             🧑  作者: Mango

代码示例1
class Converters {
  @TypeConverter
  fun fromTimestamp(value: Long?): Date? {
  return value?.let { Date(it) }
  }

  @TypeConverter
  fun dateToTimestamp(date: Date?): Long? {
  return date?.time?.toLong()
  }
}