Tag Archives: java comparator factory

Composite Comparator

Available at GitHub: https://github.com/acidbluebriggs/ComparatorFactory#compositecomparator Allows two comparators to be merged, so that if the major comparator returns equal, the other comparator is used. This can then be used to form composite comparisons. Example: java.util.Collections.sort(list,         new CompositeComparator(new BeanPropertyComparator("lastName"),             new BeanPropertycComparator("firstName") ) … Continue reading

Posted in Code | Tagged | Leave a comment