compareTo method

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

Compares this ShemaVersion to another.

Returns a negative integer if this is a older version than other, a positive integer if this a newer version than other and zero if they are the same version.

Implementation

@override
int compareTo(SchemaVersion other) {
  if (major < other.major) return -1;
  if (major > other.major) return 1;
  if (minor < other.minor) return -1;
  if (minor > other.minor) return 1;
  if (qualifier == null) return 0;
  if (qualifier != null && other.qualifier == null) return -1;
  if (qualifier == null && other.qualifier != null) return 1;

  return qualifier!.compareTo(other.qualifier!);
}