parent
0bede9d7ee
commit
5bbdb7b036
@ -0,0 +1,21 @@ |
||||
package com.github.catvod.bean.ali; |
||||
|
||||
import java.util.Collections; |
||||
import java.util.Comparator; |
||||
import java.util.List; |
||||
|
||||
public class Sorter implements Comparator<Item> { |
||||
|
||||
public static void sort(List<Item> items) { |
||||
Collections.sort(items, new Sorter()); |
||||
} |
||||
|
||||
@Override |
||||
public int compare(Item o1, Item o2) { |
||||
try { |
||||
return Integer.valueOf(o1.getDisplayName()).compareTo(Integer.valueOf(o2.getDisplayName())); |
||||
} catch (NumberFormatException e) { |
||||
return o1.getDisplayName().compareToIgnoreCase(o2.getDisplayName()); |
||||
} |
||||
} |
||||
} |
||||
Binary file not shown.
@ -1 +1 @@ |
||||
c08916c262b65e7a7caff865d900f3b7 |
||||
dc64f1fe003adcd9916ee38638684376 |
||||
|
||||
Loading…
Reference in new issue