-
Notifications
You must be signed in to change notification settings - Fork 519
ListUtils
albarivas edited this page Nov 30, 2021
·
9 revisions
This is a utility class for List operations. It provides a method that allows to sort lists in place with reusable comparators. See SObjectStringFieldComparator for tests.
sorts a list of objects using bubble sort algorithm and a comparator
| Param | Description |
|---|---|
objects |
a list of objects that will be sorted |
comparator |
an instance of the Comparator interface that describes the ordering logic used for sorting |
interface that specifies how two objects should be compared for ordering
compares two objects
Type
Integer
Description
s 0 if objects are equal, 1 first object is 'greater' than the second or 2 otherwise.
Exception thrown when Comparator.compare fails