All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.daioware.net.http.items.QueryParameterList Maven / Gradle / Ivy

package com.daioware.net.http.items;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

public class QueryParameterList {

	private List params;
	
	public QueryParameterList() {
		params=new ArrayList<>();
	}
	
	public boolean add(String key,String value) {
		return add(new QueryParameter(key, value));
	}
	public boolean add(QueryParameter q) {
		return params.add(q);
	}
	
	public String toString(String encoding) throws UnsupportedEncodingException {
		StringBuilder info=new StringBuilder();
		String sep="";
		for(QueryParameter q:params) {
			info.append(sep).append(q.toString(encoding));
			sep="&";
		}
		return info.toString();
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy