> +public class CreateHttpRedirectBinder implements Binder {
> +   private final Json json;
> +
> +   @Inject
> +   CreateHttpRedirectBinder(Json json){
> +      this.json = checkNotNull(json, "json");
> +   }
> +
> +   @SuppressWarnings("unchecked")
> +   @Override
> +   public <R extends HttpRequest> R bindToRequest(R request, Object 
> httpRedirect) {
> +      HttpRedirect in = HttpRedirect.class.cast(checkNotNull(httpRedirect, 
> "httpRedirect"));
> +      URI path = uriBuilder(request.getEndpoint()).build(in.getDelegate());
> +      return (R) request.toBuilder()
> +                        .endpoint(path)
> +                        .payload(json.toJson(ImmutableMap.of(

json writer or just string template. reflective toJson seems overkill here:)
http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonWriter.html

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

Reply via email to