InterviewSolution
| 1. |
How Do I Set The Beancomparator Order To Be Ascending/descending? |
|
Answer» BeanComparator relies on an internal Comparator to perform the ACTUAL comparisions. By default, org.apache.commons.collections.comparators.ComparableComparator is USED which imposes a natural order. If you want to change the order, then a custom Comparator should be created and passed into the appropriate constructor. For example: import org.apache.commons.collections.comparators.ComparableComparator; BeanComparator relies on an internal Comparator to perform the actual comparisions. By default, org.apache.commons.collections.comparators.ComparableComparator is used which imposes a natural order. If you want to change the order, then a custom Comparator should be created and passed into the appropriate constructor. For example: import org.apache.commons.collections.comparators.ComparableComparator; |
|