From 121dd76fa1c3b8f10eb05547f5e39406c21b60eb Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sun, 21 Oct 2018 19:25:34 +0100 Subject: [PATCH] Jackson deserialization for DecoratedValue --- main/src/com/google/refine/browsing/DecoratedValue.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/src/com/google/refine/browsing/DecoratedValue.java b/main/src/com/google/refine/browsing/DecoratedValue.java index fc8ef95e7..67aa8a09d 100644 --- a/main/src/com/google/refine/browsing/DecoratedValue.java +++ b/main/src/com/google/refine/browsing/DecoratedValue.java @@ -35,6 +35,7 @@ package com.google.refine.browsing; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.refine.util.StringUtils; @@ -52,7 +53,12 @@ public class DecoratedValue { @JsonProperty("l") final public String label; - public DecoratedValue(Object value, String label) { + @JsonCreator + public DecoratedValue( + @JsonProperty("v") + Object value, + @JsonProperty("l") + String label) { if (value instanceof OffsetDateTime) { this.value = StringUtils.toString(value); } else {