Make wetter.com state JSON-serializable
[rhynodge.git] / src / main / kotlin / net / pterodactylus / rhynodge / webpages / weather / wettercom / HourState.kt
index 8ef39cb..f5ddfc2 100644 (file)
@@ -1,11 +1,21 @@
 package net.pterodactylus.rhynodge.webpages.weather.wettercom
 
+import com.fasterxml.jackson.annotation.JsonProperty
+
 /**
  * Container for weather conditions of a single hour.
  *
  * @author [David ‘Bombe’ Roden](mailto:bombe@pterodactylus.net)
  */
-data class HourState(val hourIndex: Int, val temperature: Double, val rainProbability: Double, val rainAmount: Double, val windDirection: WindDirection, val windSpeed: Double, val description: String, val image: String) {
+data class HourState(
+        @JsonProperty("hourIndex") val hourIndex: Int,
+        @JsonProperty("temperature") val temperature: Double,
+        @JsonProperty("rainProbability") val rainProbability: Double,
+        @JsonProperty("rainAmount") val rainAmount: Double,
+        @JsonProperty("windDirection") val windDirection: WindDirection,
+        @JsonProperty("windSpeed") val windSpeed: Double,
+        @JsonProperty("description") val description: String,
+        @JsonProperty("image") val image: String) {
 
     class Builder(private val hourIndex: Int) {