@@ -0,0 +1,2451 @@
+/*%0A * Copyright %5B2013%5D %5BShopWiki%5D%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.shopwiki.vaadin;%0A%0Aimport java.util.*;%0A%0Aimport com.google.common.base.Joiner;%0Aimport com.google.common.base.Splitter;%0Aimport com.google.common.collect.*;%0A%0A/**%0A * Copied from shopwiki repo%0A *%0A * @owner rstewart%0A */%0Apublic class UrlParams %7B%0A%0A    private ListMultimap%3CString,String%3E map = ArrayListMultimap.create();%0A%0A    public UrlParams() %7B %7D%0A%0A    public UrlParams(String queryString) %7B%0A        if (queryString == null) %7B%0A            return;%0A        %7D%0A%0A        Splitter kvSplitter = Splitter.on('=');%0A%0A        for (String param : Splitter.on('&').split(queryString)) %7B%0A            List%3CString%3E kv = Lists.newArrayList(kvSplitter.split(param));%0A            if (kv.size() %3E= 2) %7B%0A                add(kv.get(0), kv.get(1));%0A            %7D%0A        %7D%0A    %7D%0A%0A    public UrlParams add(String key, Object value) %7B%0A        if (value != null) %7B%0A            map.put(key, value.toString());%0A        %7D%0A        return this;%0A    %7D%0A%0A    public UrlParams remove(String key) %7B%0A        map.removeAll(key);%0A        return this;%0A    %7D%0A%0A    public UrlParams put(String key, Object value) %7B%0A        remove(key);%0A        add(key, value);%0A        return this;%0A    %7D%0A%0A    public Set%3CString%3E keySet() %7B%0A        return ImmutableSet.copyOf(map.keySet());%0A    %7D%0A%0A    public List%3CString%3E getList(String key) %7B%0A        return map.get(key);%0A    %7D%0A%0A    public String get(String key) %7B%0A        List%3CString%3E list = getList(key);%0A        if (list.isEmpty()) %7B%0A            return null;%0A        %7D%0A        int i = list.size() - 1; // last wins%0A        return list.get(i);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        List%3CString%3E list = new ArrayList%3CString%3E(map.size());%0A        for (Map.Entry%3CString,String%3E entry : map.entries()) %7B%0A            list.add(entry.getKey() + %22=%22 + String.valueOf(entry.getValue()));%0A        %7D%0A        return Joiner.on('&').join(list);%0A    %7D%0A%7D%0A

Copy UrlParams from shopwiki repo and trade it's dependcy on StringUtl for Guava