@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof String && bObj instanceof String) { return aObj.toString().compareTo(bObj.toString()); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Double && bObj instanceof Double) { Double a = (Double) aObj; Double b = (Double) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Boolean && bObj instanceof Boolean) { Boolean a = (Boolean) aObj; Boolean b = (Boolean) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof UUID && bObj instanceof UUID) { UUID a = (UUID) aObj; UUID b = (UUID) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj == null && bObj == null) { return 0; } else if (aObj == null) { return -1; } else if (bObj == null) { return 1; } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (!isArray(aObj) || !isArray(bObj)) { return super.compare(aObj, bObj);
@SuppressWarnings("unchecked") @Override public int compare(Object aObj, Object bObj) { if (aObj == bObj) { return 0; } DataType ta = getType(aObj); DataType tb = getType(bObj); if (ta != this || tb != this) { if (ta == tb) { return ta.compare(aObj, bObj); } return super.compare(aObj, bObj); } // TODO ensure comparable type (both may be comparable but not // with each other) if (aObj instanceof Comparable) { if (aObj.getClass().isAssignableFrom(bObj.getClass())) { return ((Comparable<Object>) aObj).compareTo(bObj); } } if (bObj instanceof Comparable) { if (bObj.getClass().isAssignableFrom(aObj.getClass())) { return -((Comparable<Object>) bObj).compareTo(aObj); } } byte[] a = serialize(aObj); byte[] b = serialize(bObj); return compareNotNull(a, b); }
@Override public int compare(Object a, Object b) { return last.compare(a, b); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Short && bObj instanceof Short) { Short a = (Short) aObj; Short b = (Short) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (isBigDecimal(aObj) && isBigDecimal(bObj)) { BigDecimal a = (BigDecimal) aObj; BigDecimal b = (BigDecimal) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Integer && bObj instanceof Integer) { Integer a = (Integer) aObj; Integer b = (Integer) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj == null && bObj == null) { return 0; } else if (aObj == null) { return -1; } else if (bObj == null) { return 1; } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof UUID && bObj instanceof UUID) { UUID a = (UUID) aObj; UUID b = (UUID) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Float && bObj instanceof Float) { Float a = (Float) aObj; Float b = (Float) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Long && bObj instanceof Long) { Long a = (Long) aObj; Long b = (Long) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (isDate(aObj) && isDate(bObj)) { Date a = (Date) aObj; Date b = (Date) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (isBigInteger(aObj) && isBigInteger(bObj)) { BigInteger a = (BigInteger) aObj; BigInteger b = (BigInteger) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Character && bObj instanceof Character) { Character a = (Character) aObj; Character b = (Character) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }
@Override public int compare(Object aObj, Object bObj) { AutoDetectDataType aType = getType(aObj); AutoDetectDataType bType = getType(bObj); int typeDiff = aType.typeId - bType.typeId; if (typeDiff == 0) { return aType.compare(aObj, bObj); } return Integer.signum(typeDiff); }
@Override public int compare(Object aObj, Object bObj) { if (aObj instanceof Byte && bObj instanceof Byte) { Byte a = (Byte) aObj; Byte b = (Byte) bObj; return a.compareTo(b); } return super.compare(aObj, bObj); }