compareTo

open operator override fun compareTo(other: SemVersion): Int

比较 thisother 的实际版本大小.

如:

  • SemVersion("1.0.0-RC").compareTo(SemVersion("1.0-RC")) == 0 (然而对他们进行 equals 判断会返回 false)

  • SemVersion("1.3.0") > SemVersion("1.1.0") == true (因为 1.3.0 比 1.1.0 更高)

Return

thisother 更高时返回一个正数. 当 thisother 更低时返回一个负数. 当 thisother 版本大小相等时返回 0.

See also