is Sorted By
Checks if the list is sorted according to the specified selector function.
This function determines if the elements in the list are in the specified order when transformed by the given selector function. The order is determined by the natural order of the Comparable type R returned by the selector.
Return
true
if the list is sorted according to the selector function in the specified order, false
otherwise.
Parameters
A function that extracts a comparable value from an element.
Determines the order of sorting. If true (default), checks for ascending order. If false, checks for descending order.
For String comparisons, determines whether the comparison should be case-insensitive. Default is true. Has no effect on non-String comparisons.
Throws
if the selector function returns values that are not mutually comparable.