Potrzebuję zbudować kilka podobnych strukturek.
Wszędzie są getery i setery.
ChildOne będzie wszędzie prawie taki sam. To samo id będzie w środku. Ale Listy już będą inne.
Czy można coś zrobić by użyć to wielokrotnie -> ChildOne czy szkoda zachodu i lepiej stworzyć sobie nowe obiekty.
public class Parent {
private Integer id;
private List<ChildOne> childOneList = new ArrayList<ChildOne>(
0);
}
public class ChildOne {
private Integer id;
private List<ChildTwo> childOneList = new ArrayList<ChildTwo>(
0);
}
public class ChildTwo {
private Integer id;
private List<SomeObject> someObjects = new ArrayList<SomeObject>(
0);
}
Z góry thx za pomoc.