I have a map, whose keys I am passing into an ArrayList
but as map in unordered that's why even the ArrayList
s output is unordered.
I used Collections.sort(keys)
but it is ordering keys only upto number 10.
How to order it after 10 I am not understanding.
The keys look like this:
PartOrderDateRaised_mva_p_2
PartOrderDateRaised_mva_p_3
Set<String> keys = paramMap.keySet();
for (String key : keys){
if (key.contains("iPLMPartOrderDateRaised_mva")) {
String partOrderDateValue = (String) paramMap.get(key);
strPartOrderDate += partOrderDateValue + "~";
}
}
Note - paramMap contains all keys which I am trying to take through Set, but it not worked. So I tried through ArrayList and then realised that arraylist gives the o/p, the way it takes i/p(Param map content in my case which is unordered).
List<String> keys = new ArrayList<String>(paramMap.keySet());
Collections.sort (keys);
for (String key : keys) {
if (key.contains("iPLMPartOrderDateRaised_mva")) {
String partOrderDateValue = (String) paramMap.get(key);
strPartOrderDate += partOrderDateValue + "~";
}
}