I have a catalog hierarchy of objects where each object has a name field.
class A {
List<A> list;
String name;
}
A{A{A{A...}AA},A{AAA},A{AAA}}
I would like to provide a set of methods that return a list of child names (a.getName ()) of any parent element for the given name. So for level 1 I have
a.getAs().stream().map(a1 -> a1.getName()).collect(Collectors.toList());
Level 2 I already have problems with:
a1.getAs().stream().filter(a2 -> a2.getName() == name)
now I want to access As and match them with their names, but I don't know how
EDIT:
, , . , node, .
, . . , , .
, .