I want to create a (recursive) map of maps. That is, the value of type of the Map is another Map of the same type as the outer map.
For example:
Map<String, Map<String, Map<String, ... >>>> foo;
Evidently, I need some way to refer to “the type being defined” or something in order to do this. I guess I could do:
Map<String, Map<String, ?>>
… and then just @SupressWarnings(“unchecked”) myself past the inevitable warnings, but is there a better way?
Create an auxiliary class or interface to refer to “the type being defined”. Like this:
or
(I don’t think you can do without such auxiliary class / interface. When “recursing” you need a name to refer to.)