i have a Java Model Class Item:
public class Item {
@JsonProperty(value = "id", required = true)
private String id;
@JsonProperty(value = "name", required = true)
private String name;
@JsonProperty(value = "result", required = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
LinkedHashMap<String, Integer> result;
@Nullable
@JsonProperty(value = "items", required = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
List<Item> items;
...
Getter/Setter
}
As a starting point I have a list of items List<Item> that I now want to merge recursively, since some of the items have the same ID. But the whole recursively over all hierarchy levels, because each item could have a child list of the same type List<Item>.
I have already tried a few things, but I can't make any progress. Does anyone have ideas how to implement this?
Thanks!