compareTo method

  1. @override
int compareTo(
  1. Action? other
)
override

Compares this Action to other, based on their timestamps.

Returns:

  • A positive integer if this Action is greater than other.
  • A negative integer if this Action is less than other.
  • 0 if this Action is equal to other.

Implementation

@override
int compareTo(Action? other) {
  if (other == null) return 1;
  return timestamp.compareTo(other.timestamp);
}