It\'s easy to convert List
into Map
. For example:
public Map> ge
You could use this solution, if you plan to create a map similar to Map
:
Map> ds= requestList.stream().collect(
Collectors.groupingBy(TagRequest::getProperty_1, HashMap::new,
Collectors.mapping(TagRequest::getProperty_2, Collectors.toList()))
);
If you plan to create a map similar to Map
, you may use:
Map> ds= requestList.stream().collect(
Collectors.groupingBy(TagRequest::getProperty_1, HashMap::new,
Collectors.mapping(TagRequest::getProperty_2, Collectors.toSet()))
);