Skip to content

Instantly share code, notes, and snippets.

@LukaKordic
Last active August 30, 2019 13:51
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/9abf4c59b91ab50c6070c07e213de974 to your computer and use it in GitHub Desktop.
Save LukaKordic/9abf4c59b91ab50c6070c07e213de974 to your computer and use it in GitHub Desktop.
data class WeatherInfoResponse(val id: Int? = 0,
val weather: List<Weather>?,
val main: MainInfo?,
val name: String? = "") : RoomMapper<WeatherEntity> {
override fun mapToRoomEntity() = WeatherEntity(id ?: 0, weather ?: emptyList(), main ?: MainInfo(), name)
}
data class MainInfo(val temp: Double? = 0.0,
val pressure: Double? = 0.0,
val humidity: Int? = 0)
data class Weather(val id: Int? = 0,
val main: String? = "",
val description: String? = "",
val icon: String? = "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment