KotlinVersion

class KotlinVersion(val major: Int, val minor: Int, val patch: Int) : Comparable<KotlinVersion> (source)

Represents a version of the Kotlin standard library.

major, minor and patch are integer components of a version, they must be non-negative and not greater than 255 (MAX_COMPONENT_VALUE).

Since Kotlin

1.1

Constructors

Link copied to clipboard
constructor(major: Int, minor: Int)

Creates a version from major and minor components, leaving patch component zero.

constructor(major: Int, minor: Int, patch: Int)

Creates a version from all three components.

Types

Link copied to clipboard
object Companion
Since Kotlin 1.1

Properties

Link copied to clipboard
val major: Int
Since Kotlin 1.1
Link copied to clipboard
val minor: Int
Since Kotlin 1.1
Link copied to clipboard
val patch: Int
Since Kotlin 1.1

Functions

Link copied to clipboard
open operator override fun compareTo(other: KotlinVersion): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.1
Link copied to clipboard
infix inline fun <T> Comparable<T>.compareTo(other: T): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.6
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Since Kotlin 1.1
Link copied to clipboard
open override fun hashCode(): Int
Since Kotlin 1.1
Link copied to clipboard
fun isAtLeast(major: Int, minor: Int): Boolean

Returns true if this version is not less than the version specified with the provided major and minor components.

Since Kotlin 1.1
fun isAtLeast(major: Int, minor: Int, patch: Int): Boolean

Returns true if this version is not less than the version specified with the provided major, minor and patch components.

Since Kotlin 1.1
Link copied to clipboard
open override fun toString(): String

Returns the string representation of this version

Since Kotlin 1.1