KotlinVersion

class KotlinVersion : Comparable<KotlinVersion> (source)

Platform and version requirements: Kotlin 1.1

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).

Constructors

<init>

KotlinVersion(major: Int, minor: Int)

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

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

Creates a version from all three components.

Properties

major

val major: Int

minor

val minor: Int

patch

val patch: Int

Functions

compareTo

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.

equals

fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

isAtLeast

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.

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.

toString

fun toString(): String

Returns the string representation of this version

Companion Object Properties

CURRENT

val CURRENT: KotlinVersion

Returns the current version of the Kotlin standard library.

MAX_COMPONENT_VALUE

const val MAX_COMPONENT_VALUE: Int

Maximum value a version component can have, a constant value 255.