@@ -0,0 +1,1561 @@
+package com.bigcommerce.api;%0A%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0A%0Aimport com.bigcommerce.util.QueryStringBuilder;%0A%0A/**%0A * Builds a query to filter the results of a collection request.%0A * %0A * @author jyogapa1%0A * %0A */%0Apublic class Filter %7B%0A%0A%09private Map%3CString, String%3E parameters;%0A%0A%09private Filter(Map%3CString, String%3E parameters) %7B%0A%09%09this.parameters = parameters;%0A%09%7D%0A%0A%09public static Filter create() %7B%0A%09%09return create(null);%0A%09%7D%0A%0A%09/**%0A%09* Factory method, creates an instance of a filter.%0A%09* Used to build URLs to collection endpoints.%0A%09*/%0A%09public static Filter create(Map%3CString, String%3E parameters) %7B%0A%09%09return (parameters == null) ? new Filter(new HashMap%3CString, String%3E())%0A%09%09%09%09: new Filter(parameters);%0A%09%7D%0A%0A%09public void add(String parameter, String value) %7B%0A%09%09this.parameters.put(parameter, value);%0A%09%7D%0A%0A%09/**%0A%09 * Converts the filter into a URL querystring that can be applied as GET%0A%09 * parameters.%0A%09 * %0A%09 * @return string%0A%09 */%0A%09public String toQuery() %7B%0A%09%09String query = null;%0A%09%09try %7B%0A%09%09%09query = httpBuildQuery(this.parameters);%0A%09%09%7D catch (UnsupportedEncodingException e) %7B%0A%09%09%09// TODO Log%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09return (query != null) ? query : %22%22;%0A%09%7D%0A%0A%09private String httpBuildQuery(Map%3CString, String%3E data)%0A%09%09%09throws UnsupportedEncodingException %7B%0A%09%09QueryStringBuilder builder = new QueryStringBuilder();%0A%09%09for (Entry%3CString, String%3E pair : data.entrySet()) %7B%0A%09%09%09builder.addQueryParameter(pair.getKey(), pair.getValue());%0A%09%09%7D%0A%09%09return builder.encode(%22UTF-8%22);%0A%09%7D%0A%0A%7D%0A

Create Filter.java