compare

open override fun compare(left: Any?, right: Any?): Int

Compare two values for sorting.

Return

A zero value if left is equal to right in sorted order, a negative value (e.g. -1) if left is less than right in sorted order, or a positive value (e.g. 1) if left is greater than right in sorted order.

Parameters

left

(nullable) First value for comparison.

right

(nullable) Second value for comparison.