Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How Do I Set The BeanComparator Order To Be Ascending/Descending?

Ascending Descending
0
Posted

How Do I Set The BeanComparator Order To Be Ascending/Descending?

0

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.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.