I have a class A with these properties:
class A {
String a;
String b;
.....
List<C> myList;
}
I want a class Aext that will extend A and will also "extend" myList properties,meaning:
class Aext extends A {
String x;
.....
List<Cext> myList;
....
}
where:
class Cext extends C {
......
}
But I cannot have a member in subclass with same name as superclass i.e : myList. Name must not be changed. I want an "extended" myList that has the properties of C plus the properties of Cext. A and B are DTOs so I want to sometimes return B as an "enriched" version of A without changing names,types etc.