Skip to content

Commit ad09f52

Browse files
committed
update params to update array of string
1 parent 68a3c58 commit ad09f52

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/amadeus/Params.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.UnsupportedEncodingException;
44
import java.net.URLEncoder;
55
import java.util.HashMap;
6+
import java.util.List;
67
import java.util.Map;
78
import java.util.logging.Level;
89
import java.util.logging.Logger;
@@ -48,6 +49,11 @@ public static Params with(@NonNull String key, Object value) {
4849
* @return the Param object, allowing for convenient chaining
4950
*/
5051
public Params and(@NonNull String key, Object value) {
52+
if(value instanceof List){
53+
@SuppressWarnings("unchecked") List<String> values = (List<String>) value;
54+
put(key, String.join(",", values));
55+
return this;
56+
}
5157
put(key, String.valueOf(value));
5258
return this;
5359
}

0 commit comments

Comments
 (0)