KayCee
09/23/2020, 4:34 AMdata class DataInputEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id") val id: Int,
@ColumnInfo(name = "weight") var weight: Float? = null,
@ColumnInfo(name = "body_fat") val bodyFat: Float? = null,
@ColumnInfo(name = "stamp") val stamp: String,
@ColumnInfo(name = "note") val note: String,
@ColumnInfo(name = "date") val date: Long,
@ColumnInfo(name = "unit") val weightUnit: Int = TypeUnitWeight.KG.value
)
Alex Queudot
09/23/2020, 8:23 AMval
and use the copy
function to perform changes.Alex
09/23/2020, 8:24 AMval
and convert your network entity into a non-nullable entity for the other layers of your app, preferably with some checks during conversion.KayCee
09/23/2020, 8:32 AM