> +    Server clone(@PathParam("serverId") String serverId, 
> @BinderParam(BindToJsonPayload.class) Server.Clone clone);
> +
> +    static final class FirewallPolicyListParser extends 
> ParseJson<List<ServerFirewallPolicy>> {
> +
> +        static final TypeLiteral<List<ServerFirewallPolicy>> list = new 
> TypeLiteral<List<ServerFirewallPolicy>>() {
> +        };
> +
> +        @Inject
> +        FirewallPolicyListParser(Json json) {
> +            super(json, list);
> +        }
> +
> +        @Override
> +        public <V> V apply(InputStream stream, Type type) throws IOException 
> {
> +            try {
> +                Gson gson = new GsonBuilder().registerTypeAdapterFactory(new 
> ArrayAdapterFactory()).create();

Since the ArrayAdapterFactory is now only used for these two concrete lists, 
would it make sense to just have two adapters, one specific for each list and 
remove the generic logic?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/275/files/2aeb10a4b8128cd34a9a16ade5119e7b68c1be24#r69217410

Reply via email to