return reverse ? bc.reverse() : bc;
return reverse ? bc.reverse() : bc;
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }