> +      @Override
> +      public Image deserialize(JsonElement jsonElement, Type type, 
> JsonDeserializationContext context)
> +              throws JsonParseException {
> +         JsonObject json = jsonElement.getAsJsonObject();
> +
> +         Map<String, Object> complexMetatdata = null;
> +         Map<String, String> metadata = null;
> +         JsonElement meta = json.get(METADATA);
> +         if (meta != null && meta.isJsonObject()) {
> +            metadata = Maps.newTreeMap();
> +            complexMetatdata = Maps.newTreeMap();
> +            for (Map.Entry<String, JsonElement> e : 
> meta.getAsJsonObject().entrySet()) {
> +               Object value;
> +               if (e.getValue().isJsonArray()) {
> +                  value = context.deserialize(e.getValue().getAsJsonArray(), 
> ArrayList.class);
> +               } else if (e.getValue().isJsonObject()) {

And also an `ImageAdapterTest`. We need to unit test this class itself.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/626/files#r21987429

Reply via email to