KotlinVersion
class KotlinVersion : Comparable<KotlinVersion>
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
Properties
major
val major: Int
minor
val minor: Int
patch
val patch: Int
Functions
compareTo
fun compareTo(other: KotlinVersion): Int
equals
Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:
fun equals(other: Any?): Boolean
hashCode
Returns a hash code value for the object. The general contract of hashCode
is:
fun hashCode(): Int
isAtLeast
toString
Returns the string representation of this version
fun toString(): String
Companion Object Properties
CURRENT
Returns the current version of the Kotlin standard library.
val CURRENT: KotlinVersion
MAX_COMPONENT_VALUE
Maximum value a version component can have, a constant value 255.
const val MAX_COMPONENT_VALUE: Int
Extension Functions
coerceAtLeast
Ensures that this value is not less than the specified minimumValue.
fun <T : Comparable<T>> T.coerceAtLeast(minimumValue: T): T
coerceAtMost
Ensures that this value is not greater than the specified maximumValue.
fun <T : Comparable<T>> T.coerceAtMost(maximumValue: T): T
coerceIn
Ensures that this value lies in the specified range minimumValue..maximumValue.
fun <T : Comparable<T>> T.coerceIn( minimumValue: T?, maximumValue: T? ): T
Ensures that this value lies in the specified range.
fun <T : Comparable<T>> T.coerceIn( range: ClosedFloatingPointRange<T> ): T
fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
rangeTo
Creates a range from this Comparable value to the specified that value.
operator fun <T : Comparable<T>> T.rangeTo( that: T ): ClosedRange<T>
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-kotlin-version/index.html