does anyone have an example of merging 2 Lists of Objects? I have Object A and Object B, I can match them on the same key but then I want to nest Object B under a deeper key in Object A
Dan O'Brien
08/05/2020, 1:28 AM
If merging them as JSON Objects is easier I should be able to do that
r
Ruckus
08/05/2020, 1:56 AM
Not sure I understand, but maybe something like
Copy code
val aMap = aList.associateBy { it.prop }
for (b in bList) {
aMap[b.prop]?.bList?.add(b)
}