use of com.tvd12.dahlia.core.comparator.Comparators in project dahlia by youngmonkeys.
the class QueryToPredicate method compareValue.
protected int compareValue(Object a, Object b) {
if (a == null) {
if (b == null)
return 0;
return -1;
} else {
if (b == null)
return 1;
Comparators comparators = Comparators.getInstance();
Comparator comparator = comparators.getComparator(a.getClass());
int result = comparator != null ? comparator.compare(a, b) : ((Comparable) a).compareTo(b);
return result;
}
}
Aggregations