I think your current approach is probably fine, I would avoid using a custom Comparator because you would end up converting the same string into a numeric value multiple times (each time the sorting algorithm wants to compare 2 values) rather than just once as you do now.