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

Added JSON annotation to ensure that the time measured is serialized as ISO timestamp

parent 2eb8c9c8
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
package no.bioforsk.vips.entity; package no.bioforsk.vips.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
/** /**
...@@ -57,6 +59,7 @@ public class WeatherObservation implements Comparable{ ...@@ -57,6 +59,7 @@ public class WeatherObservation implements Comparable{
} }
public void setTimeMeasured(Date timeMeasured) { this.timeMeasured = timeMeasured; } public void setTimeMeasured(Date timeMeasured) { this.timeMeasured = timeMeasured; }
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ssZ", timezone="CET")
public Date getTimeMeasured() { return this.timeMeasured; } public Date getTimeMeasured() { return this.timeMeasured; }
public void setElementMeasurementTypeId(String elementMeasurementTypeId) { public void setElementMeasurementTypeId(String elementMeasurementTypeId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment