compareTo method

  1. @override
int compareTo(
  1. Boolean other
)
override

Compares this Boolean with another Boolean.

false is considered less than true.

Returns:

  • negative value if this < other
  • zero if this == other
  • positive value if this > other

Implementation

@override
int compareTo(Boolean other) {
  if (_value == other._value) return 0;
  return _value ? 1 : -1;
}