gsala
04/15/2019, 1:47 PM@Entity
data class DailySummary(
@PrimaryKey val date: LocalDate,
val activeTime: Duration,
val calories: KCal // <- inline class wrapping a Float
)
and it doesn't work even if I provide a @TypeConverter
for it.
The error coming from Gradle is very meaningless so i won't post it here but changing the entity above to use Float
instead of KCal
automatically works.
The Type Converters are these:
@TypeConverter
fun toKCal(value: Float?): KCal? {
return value?.let { KCal(it) }
}
@TypeConverter
fun fromKCal(kcal: KCal?): Float? {
return kcal?.value
}
Sam
04/15/2019, 3:03 PMgsala
04/15/2019, 3:05 PMrkeazor
04/15/2019, 3:07 PMgsala
04/15/2019, 3:09 PMTypeConverter
for it