{
if (finalUri != null)
return finalUri;
UriBuilderImpl builder = (UriBuilderImpl) uri.clone();
if (matrixParameters != null)
{
for (Map.Entry<String, List<String>> entry : matrixParameters
.entrySet())
{
List<String> values = entry.getValue();
for (String value : values)
builder.matrixParam(entry.getKey(), value);
}
}
if (queryParameters != null)
{
for (Map.Entry<String, List<String>> entry : queryParameters
.entrySet())
{
List<String> values = entry.getValue();
for (String value : values)
builder.queryParam(entry.getKey(), value);
}
}
if (pathParameterList != null && !pathParameterList.isEmpty())
{
finalUri = builder.build(pathParameterList.toArray()).toString();
}
else if (pathParameters != null && !pathParameters.isEmpty())
{
for (Map.Entry<String, List<String>> entry : pathParameters.entrySet())
{
List<String> values = entry.getValue();
for (String value : values)
builder.substitutePathParam(entry.getKey(), value, false);
}
}
if (finalUri == null)
finalUri = builder.build().toString();
return finalUri;
}