> + Link link =
> Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
> + links.add(link);
> + }
> +
> + Double d = (Double)scalingPolicyMap.get(targetType.toString()); //
> GSON only knows double now
> + ScalingPolicyResponse scalingPolicyResponse =
> + new ScalingPolicyResponse(
> + (String)scalingPolicyMap.get("name"),
> +
> ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
> + ((Double)scalingPolicyMap.get("cooldown")).intValue(),
> + Math.floor(d) == d ? Integer.toString(d.intValue()) :
> Double.toString(d),
> + targetType,
> + ImmutableList.copyOf(links),
> + (String) scalingPolicyMap.get("id")
> + );
> + scalingPoliciesList.add(scalingPolicyResponse);
Ouch! Is there no way we can get JSON to do some of this parsing for us, i.e.
to go to the domain representation more directly?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/39/files#r7234875