com.tambapps.http.hyperpoet.url.UrlBuilder Maven / Gradle / Ivy
package com.tambapps.http.hyperpoet.url;
import lombok.Getter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Util class to build URLs. It takes care of the URL encoding with the encoded() method
*/
@Getter
public class UrlBuilder {
private String url;
private final List queryParams = new ArrayList<>();
private final QueryParamComposer queryParamComposer;
public UrlBuilder() {
this("");
}
public UrlBuilder(String url) {
this(url, new HashMap<>());
}
public UrlBuilder(String url, MultivaluedQueryParamComposingType multivaluedQueryParamComposingType) {
this(url, new QueryParamComposer(new HashMap<>(), multivaluedQueryParamComposingType));
}
public UrlBuilder(String url, Map, Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy