I am retrieving GeoPoints from a database and organize them for usage in frontend. The GeoPoints are aggregated in segments, the segments in layers, the layers are mapped to drive ids and that map is maped to car ids. The frontend displays all of that nicely, with Tooltips and such.
My REST GetMapping method looks like this.
public ResponseEntity<Map<Integer, Map<Integer, List<List<List<double[]>>>>>>
For new colleagues, this is insanely hard to understand. But I can't think of any other way to do it. Should I create dummy child classes of Map
and List
just so I can write something like
public ResponseEntity<CarMap<Integer, DriveMap<Integer, Layers<Segments<GeoPoints<double[]>>>>>>
How is something like this handled typically?
But I can't think of any other way to do it.
You can. Imagine yourself how would you implement the client for such abomination.double[]
, or are they actually a (lat, long) pair? (or (lat, long, height) triple). And there is no metadata about the segments or layers?