update null comparison for query params in Java

to make it clear and also allow a query parameter to be set with string value: "null" (4 characters string)
This commit is contained in:
Xu Hui Hui 2015-03-17 16:34:01 +08:00
parent c96853d5aa
commit b2da6dc8a2

View File

@ -58,7 +58,7 @@ public class {{classname}} {
Map<String, String> headerParams = new HashMap<String, String>();
Map<String, String> formParams = new HashMap<String, String>();
{{#queryParams}}if(!"null".equals(String.valueOf({{paramName}})))
{{#queryParams}}if ({{paramName}} != null)
queryParams.put("{{baseName}}", String.valueOf({{paramName}}));
{{/queryParams}}
{{#headerParams}}headerParams.put("{{baseName}}", {{paramName}});