I'm capturing parameters from a request url using com.apache.http.NameValuePair
which basically store those params in a List<NameValuePair>
. To do certain checks and verifications on those params, I need to convert that list into a List<Map.Entry<String, String>>
. Is there a way to do this conversion?
something like this:
http://127.0.0.1:9898/v3/{project_id}/eip/publicips?fields=id&fields=owner
from How to convert List<NameValuePair> into a hashMap<String, String>?
Map<String, String> mapped = list.stream().collect(
Collectors.toMap(NameValuePair::getName, NameValuePair::getValue));
It is not work for me. because there are many fields key.