@Override public int compare(Object o1, Object o2) { if (o1 == null && o2 == null) return 0; if (o1 == null) return 1; // Null at the end if (o2 == null) return -1; return CompareUtils.compare(o1.toString(), o2.toString()); }
public static int compare(Object[] a1, Object[] a2) { for (int i = 0; i < a1.length || i < a2.length; i++) { Object o1 = i < a1.length ? a1[i] : null; Object o2 = i < a2.length ? a2[i] : null; int c = CompareUtils.compare(o1, o2); if (c != 0) return c; } return 0; }
@Override public int compare(Object o1, Object o2) { return CompareUtils.compareAsDate(o1, o2); }