From 2aa465f940259021df5533f88ef4ce297f7a74eb Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 16 May 2013 16:27:42 -0700 Subject: [PATCH] add serde for spatial dim schemas --- .../metamx/druid/index/v1/SpatialDimensionSchema.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java b/index-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java index 7e50961925e..311626e5bc0 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/SpatialDimensionSchema.java @@ -1,5 +1,7 @@ package com.metamx.druid.index.v1; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; import com.google.common.collect.Lists; @@ -12,7 +14,11 @@ public class SpatialDimensionSchema private final String dimName; private final List dims; - public SpatialDimensionSchema(String dimName, List dims) + @JsonCreator + public SpatialDimensionSchema( + @JsonProperty("dimName") String dimName, + @JsonProperty("dims") List dims + ) { this.dimName = dimName.toLowerCase(); this.dims = Lists.transform( @@ -28,11 +34,13 @@ public class SpatialDimensionSchema ); } + @JsonProperty public String getDimName() { return dimName; } + @JsonProperty public List getDims() { return dims;