java – Creates a StringStrings from a list

I have a class called CoreFiltroSearch who has a list of ICoreFiltro call filters follows class and interface:

Public class CoreFiltroSearch {

private list filters = new ArrayList <> ();
private String order = "asc";
private String sort = "id";
private Integer page = 0;
full private size = 40;
}

public interface ICoreFiltro {

String getChave ();

String getValor ();

Boolean isQFilter ();

Boolean isDateFilter ();

}

I need the list filters create a string using the fields getChave () and getvalor () who are of the element ICoreFiltroI have tried using a solution found in a blog, but I can not even download the server with the help of this solution. I asked the question here. The solution I used to create this chain was:

private String mountQueryString (CoreFiltroSearch filter) {
return filter.getFilters (). stream ()
.map (p -> urlEncodeUTF8 (p.getChave ()) + "=" + urlEncodeUTF8 (p.getValor ()))
(p1, p2) -> p1 + "&" + p2)
.map (s -> "?" + s) .orElse ("");
}

static String urlEncodeUTF8 (String s) {
try {
return URLEncoder.encode (s, "UTF-8");
} catch (UnsupportedEncodingException e) {
launch the new UnsupportedOperationException (e);
}
}

If anyone can help me with a better solution, I appreciate it, but I think this logic is no problem.

Ps: Sorry if the question was too long and descriptive.