hello I'm new to the java world I have a question about how to convert a list to a map by use tree metrics.
public class AdditionalMetrics implements Serializable {
private static final long serialVersionUID = 3813944465194104658L;
private Long id;
private String masterId;
private String nodeKey;
private String nodeValue;
}
I want to convert List<AdditionalMetrics>
to Map<masterId, Map<nodeKey, nodeValue>
and I search on the Internet it just shows
additionalMetrics.stream()
.collect(Collectors.toMap(AdditionalMetrics::getMasterId,
AdditionalMetrics::getNodeValue)