I have a Map<String,List<UserVO>> studentsByCountry = new TreeMap<String,List<UserVO>>();
It displays like :
key=CountryA , value = List<UserVO>
key=CountryB , value = List<UserVO>
key=CountryC , value = List<UserVO>
Can I reshuffle this Map
so that I display according to the displayOrder of the countries. Display order is countryC=1, countryB=2 & countryA=3. I want to display like
key=CountryC , value = List<UserVO>
key=CountryB , value = List<UserVO>
key=CountryA , value = List<UserVO>
One option is to append the sortOrderNumber to the key. For example 1_CountryC, 2_CountryB & 3_CountryA
Can I do it via conventional Java?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…