From 96c98be9fd740705e2fca2ec0ef4c42a6fce8a5c Mon Sep 17 00:00:00 2001 From: Andrea Turli Date: Wed, 2 May 2012 09:21:08 +0200 Subject: [PATCH] jenkins api: multimaps.for(map) --- .../jenkins/v1/binders/BindMapToOptionalParams.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/labs/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java b/labs/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java index d7400cd73e..b36ade65f7 100644 --- a/labs/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java +++ b/labs/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java @@ -20,10 +20,9 @@ package org.jclouds.jenkins.v1.binders; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.http.utils.ModifyRequest.addQueryParam; +import static org.jclouds.http.utils.ModifyRequest.addQueryParams; import java.util.Map; -import java.util.Map.Entry; import javax.inject.Inject; import javax.inject.Provider; @@ -32,6 +31,8 @@ import javax.ws.rs.core.UriBuilder; import org.jclouds.http.HttpRequest; import org.jclouds.rest.Binder; +import com.google.common.collect.Multimaps; + /** * Binds the map to parameters. * @@ -50,9 +51,7 @@ public class BindMapToOptionalParams implements Binder { public R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof Map, "this binder is only valid for Maps!"); Map map = (Map) input; - for (Entry entry : map.entrySet()) { - request = addQueryParam(request, entry.getKey(), entry.getValue(), builder.get()); - } + request = addQueryParams(request, Multimaps.forMap(map), builder.get()); return request; }