0

Good day all. I've this situation:

Map<String, List<HubP>> hubP = new HashMap<>();
hubP.put(HubP.TYPE_ONLINE, onlineP);
hubP.put(HubP.TYPE_HOME, offlineP);
return hubP;

HubP.ONLINE = "ONLINE" and HubP.TYPE_HOME = "HOME"

So this basically is returning to my frontend an array which "HOME" is the first element.

I'd like to have "ONLINE" as the first element, and then any other element present (my only concern is to have "ONLINE" for first, then all the others could be in any order)

I've already done it on my frontend, by checking the array and reverse it in js if needed, but this solution is really dirt and I'd like to make it on the server.

is that possible? I'm using HasMap but maybe I've done wrong.

Matteo Bononi 'peorthyr'
  • 2,170
  • 8
  • 46
  • 95

0 Answers0