FicComparableExtension extension

on

Methods

compareObjectTo(Object? other, {bool nullsBefore = false, bool compareHashCodes = true}) int
  • If this object and other are both null, they don't have order. If one of them is null, it will come later, unless the nullsBefore is true, in which case the null will come before.

  • Otherwise, if this object and other are both of type Comparable, compare them with their natural comparator.

  • Otherwise, if this object and other are map-entries (MapEntry), compare their keys. If their keys compare as the same, then compare their values.

  • Otherwise, if this object and other are booleans, compare them such as true comes after false.

  • Otherwise, return 0, which means unordered.