class MyObject {
private List<MyChildObject> children;
}
class MyChildObject {
private String key;
}
My goal is to transfor a list of MyObject
to a Map<String, MyObject>
which String
is MyChildObject.key
.
My attempt stopped at myObjectList.stream().collect(Collectors.toMap(//how to extract key here?, Function.identity()));
Thanks.