Skip to content
Snippets Groups Projects
Commit 52c3db1e authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixing deserialization of Weather data

parent 65dc1fd0
No related branches found
No related tags found
1 merge request!1Fixing deserialization of Weather data
...@@ -33,6 +33,7 @@ import no.nibio.vips.model.ConfigValidationException; ...@@ -33,6 +33,7 @@ import no.nibio.vips.model.ConfigValidationException;
import no.nibio.vips.model.Model; import no.nibio.vips.model.Model;
import no.nibio.vips.model.ModelExcecutionException; import no.nibio.vips.model.ModelExcecutionException;
import no.nibio.vips.model.ModelId; import no.nibio.vips.model.ModelId;
import no.nibio.vips.util.ModelUtil;
import no.nibio.vips.util.WeatherElements; import no.nibio.vips.util.WeatherElements;
import no.nibio.vips.util.WeatherUtil; import no.nibio.vips.util.WeatherUtil;
import no.nibio.vips.util.XDate; import no.nibio.vips.util.XDate;
...@@ -219,7 +220,7 @@ public class SeptoriaReferenceHumidityModel implements Model { ...@@ -219,7 +220,7 @@ public class SeptoriaReferenceHumidityModel implements Model {
public void setConfiguration(ModelConfiguration config) throws ConfigValidationException { public void setConfiguration(ModelConfiguration config) throws ConfigValidationException {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone")); this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
this.observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){}); this.observations = new ModelUtil().extractWeatherObservationList(config.getConfigParameter("observations"));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment