-
Notifications
You must be signed in to change notification settings - Fork 458
ListUtils
pozil edited this page Oct 4, 2023
·
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.
Group Shared Code
See SObjectStringFieldComparator
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 |
Exception thrown when Comparator.compare fails
Inheritance
CompareException
interface that specifies how two objects should be compared for ordering
compares two objects
Type | Description |
---|---|
Integer | s 0 if objects are equal, 1 first object is 'greater' than the second or 2 otherwise. |
Exception | Description |
---|---|
Throws |
CompareException if an error occurs while comparing objects. For example, when comparing incompatible object types. |