DbClasses.kt 1019 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.ted.weather.data.db
  2. import java.util.*
  3. class CityForecast(val map: MutableMap<String, Any?>, val dailyForecast: List<DayForecast>) {
  4. var _id: Long by map
  5. var city: String by map
  6. var country: String by map
  7. constructor(id: Long, city: String, country: String, dailyForecast: List<DayForecast>)
  8. : this(HashMap(), dailyForecast) {
  9. this._id = id
  10. this.city = city
  11. this.country = country
  12. }
  13. }
  14. class DayForecast(var map: MutableMap<String, Any?>) {
  15. var _id: Long by map
  16. var date: Long by map
  17. var description: String by map
  18. var high: Int by map
  19. var low: Int by map
  20. var iconUrl: String by map
  21. var cityId: Long by map
  22. constructor(date: Long, description: String, high: Int, low: Int, iconUrl: String, cityId: Long)
  23. : this(HashMap()) {
  24. this.date = date
  25. this.description = description
  26. this.high = high
  27. this.low = low
  28. this.iconUrl = iconUrl
  29. this.cityId = cityId
  30. }
  31. }