From 2162e8281b392b8f77bd9cdaec969b0c64ef9bcc Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Tue, 14 Jan 2014 13:46:26 -0800 Subject: [PATCH] Generalize multiple param values to use Iterable. --- retrofit/src/main/java/retrofit/RequestBuilder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/retrofit/src/main/java/retrofit/RequestBuilder.java b/retrofit/src/main/java/retrofit/RequestBuilder.java index e32ad6a352..7da3d4b960 100644 --- a/retrofit/src/main/java/retrofit/RequestBuilder.java +++ b/retrofit/src/main/java/retrofit/RequestBuilder.java @@ -162,12 +162,12 @@ void addQueryParam(String name, String value, boolean urlEncodeValue) { } } - void addQueryListParams(String name, List values) { + void addQueryListParams(String name, Iterable values) { if (name == null) { throw new IllegalArgumentException("Query name must not be null."); } if (values == null) { - throw new IllegalArgumentException("Query param list must not be null."); + throw new IllegalArgumentException("Query param values must not be null."); } for (Object value : values) { @@ -180,7 +180,7 @@ void addQueryMapParams(String name, Map values) { throw new IllegalArgumentException("Query name must not be null."); } if (values == null) { - throw new IllegalArgumentException("Query param map must not be null."); + throw new IllegalArgumentException("Query param value map must not be null."); } for (Map.Entry entry : values.entrySet()) { @@ -220,8 +220,8 @@ void setArguments(Object[] args) { break; case QUERY: if (value != null) { // Skip null values. - if (value instanceof List) { - addQueryListParams(name, (List) value); + if (value instanceof Iterable) { + addQueryListParams(name, (Iterable) value); } else if (value instanceof Map) { addQueryMapParams(name, (Map) value); } else {