@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2015 the original author or authors .
* Copyright 2002 - 2016 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -336,6 +336,7 @@ final class HierarchicalUriComponents extends UriComponents {
@@ -336,6 +336,7 @@ final class HierarchicalUriComponents extends UriComponents {
private MultiValueMap < String , String > expandQueryParams ( UriTemplateVariables variables ) {
int size = this . queryParams . size ( ) ;
MultiValueMap < String , String > result = new LinkedMultiValueMap < String , String > ( size ) ;
variables = new QueryUriTemplateVariables ( variables ) ;
for ( Map . Entry < String , List < String > > entry : this . queryParams . entrySet ( ) ) {
String name = expandUriComponent ( entry . getKey ( ) , variables ) ;
List < String > values = new ArrayList < String > ( entry . getValue ( ) . size ( ) ) ;
@ -882,4 +883,22 @@ final class HierarchicalUriComponents extends UriComponents {
@@ -882,4 +883,22 @@ final class HierarchicalUriComponents extends UriComponents {
}
} ;
private static class QueryUriTemplateVariables implements UriTemplateVariables {
private final UriTemplateVariables delegate ;
public QueryUriTemplateVariables ( UriTemplateVariables delegate ) {
this . delegate = delegate ;
}
@Override
public Object getValue ( String name ) {
Object value = this . delegate . getValue ( name ) ;
if ( ObjectUtils . isArray ( value ) ) {
value = StringUtils . arrayToCommaDelimitedString ( ObjectUtils . toObjectArray ( value ) ) ;
}
return value ;
}
}
}