Skip to content

Instantly share code, notes, and snippets.

@LukaKordic
Created August 13, 2019 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LukaKordic/90fe8dfe8f6b8b51abd7be6569976442 to your computer and use it in GitHub Desktop.
Save LukaKordic/90fe8dfe8f6b8b51abd7be6569976442 to your computer and use it in GitHub Desktop.
@Entity(tableName = WEATHER_TABLE_NAME)
data class WeatherEntity(@PrimaryKey val id: Int? = 0,
val weather: ArrayList<Weather>?,
@Embedded
val main: MainInfo?,
val name: String? = "") : DomainMapper<WeatherInfo> {
override fun mapToDomainModel() = WeatherInfo(main?.temp ?: 0.0, main?.humidity ?: 0, main?.pressure ?: 0.0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment