IntID

一个通过 32位整型 (Int) 作为ID值的 NumericalID 实现。

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val value: Int

源值

Inherited properties

Link copied to clipboard

ID.toString, 得到 ID 的字面值。

Functions

Link copied to clipboard
protected open override fun compareNumber(target: NumericalID): Int
Link copied to clipboard
open override fun copy(): IntID

复制一个当前ID。

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

判断另外一个 ID 是否与当前 ID 字面值相同

Link copied to clipboard
open override fun equalsExact(other: Any?): Boolean

判断另外一个 ID 是否与当前 ID 字面值与类型均相同

Link copied to clipboard
open override fun hashCode(): Int

ID 的源值 hashcode,等于对应的源值的 hashcode。

Link copied to clipboard
open override fun toByte(): Byte

将数字值转化为 Byte。类似于 Number.toByte

Link copied to clipboard
open override fun toDouble(): Double

将数字值转化为 Double。类似于 Number.toDouble

Link copied to clipboard
open override fun toFloat(): Float

将数字值转化为 Float。类似于 Number.toFloat

Link copied to clipboard
open override fun toInt(): Int

将数字值转化为 Int。类似于 Number.toInt

Link copied to clipboard
open override fun toLong(): Long

将数字值转化为 Long。类似于 Number.toLong

Link copied to clipboard
open override fun toShort(): Short

将数字值转化为 Short。类似于 Number.toShort

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

ID 的 字面值 字符串。

Inherited functions

Link copied to clipboard
operator override fun compareTo(other: ID): Int
Link copied to clipboard
@JvmName(name = "toInt")
inline fun ID.toInt(notNumerical: ID.() -> Int = { literal.toInt() }): Int

尝试将 this 转化为 Int。 如果为 NumericalID 则直接使用 NumericalID.toInt, 否则使用 notNumerical 转化。默认会尝试使用 literal.toInt()

Link copied to clipboard
@JvmName(name = "toIntID")
inline fun ID.toIntID(notNumerical: ID.() -> IntID = { literal.toInt().ID }): IntID

尝试将 this 转为 IntID 类型。 如果不是数字ID,则会使用 notNumerical 获取结果。默认使用 String.toInt

Link copied to clipboard
@JvmName(name = "toIntOrNull")
inline fun ID.toIntOrNull(notNumerical: ID.() -> Int? = { literal.toIntOrNull() }): Int?

尝试将 this 转化为 Int。 如果为 NumericalID 则直接使用 NumericalID.toInt, 否则使用 notNumerical 转化。默认会尝试使用 literal.toIntOrNull()

Link copied to clipboard
@JvmName(name = "toLong")
inline fun ID.toLong(notNumerical: ID.() -> Long = { literal.toLong() }): Long

尝试将 this 转化为 Long。 如果为 NumericalID 则直接使用 NumericalID.toLong, 否则使用 notNumerical 转化。默认会尝试使用 literal.toLong()

Link copied to clipboard
@JvmName(name = "toLongID")
inline fun ID.toLongID(notNumerical: ID.() -> LongID = { literal.toLong().ID }): LongID

尝试将 this 转为 LongID 类型。 如果不是数字ID,则会使用 notNumerical 获取结果。默认使用 String.toLong

Link copied to clipboard
@JvmName(name = "toLongOrNull")
inline fun ID.toLongOrNull(notNumerical: ID.() -> Long? = { literal.toLongOrNull() }): Long?

尝试将 this 转化为 Long。 如果为 NumericalID 则直接使用 NumericalID.toLong, 否则使用 notNumerical 转化。默认会尝试使用 literal.toLongOrNull()

Link copied to clipboard
open fun toUInt(): UInt

将数字值转化为 UInt

Link copied to clipboard
@JvmName(name = "toUInt")
inline fun ID.toUInt(notNumerical: ID.() -> UInt = { literal.toUInt() }): UInt

尝试将 this 转化为 UInt。 如果为 NumericalID 则直接使用 NumericalID.toInt.toUInt, 否则使用 notNumerical 转化。默认会尝试使用 literal.toUInt()

Link copied to clipboard
@JvmName(name = "toUIntID")
inline fun ID.toUIntID(notNumerical: ID.() -> UIntID = { literal.toUInt().ID }): UIntID

尝试将 this 转为 UIntID 类型。 如果不是数字ID,则会使用 notNumerical 获取结果。默认使用 String.toUInt

Link copied to clipboard
@JvmName(name = "toUIntOrNull")
inline fun ID.toUIntOrNull(notNumerical: ID.() -> UInt? = { literal.toUIntOrNull() }): UInt?

尝试将 this 转化为 UInt。 如果为 NumericalID 则直接使用 NumericalID.toInt.toUInt, 否则使用 notNumerical 转化。默认会尝试使用 literal.toUIntOrNull()

Link copied to clipboard
open fun toULong(): ULong

将数字值转化为 ULong

Link copied to clipboard
@JvmName(name = "toULong")
inline fun ID.toULong(notNumerical: ID.() -> ULong = { literal.toULong() }): ULong

尝试将 this 转化为 ULong。 如果为 NumericalID 则直接使用 NumericalID.toLong.toULong, 否则使用 notNumerical 转化。默认会尝试使用 literal.toULong()

Link copied to clipboard
@JvmName(name = "toULongID")
inline fun ID.toULongID(notNumerical: ID.() -> ULongID = { literal.toULong().ID }): ULongID

尝试将 this 转为 ULongID 类型。 如果不是数字ID,则会使用 notNumerical 获取结果。默认使用 String.toULong

Link copied to clipboard
@JvmName(name = "toULongOrNull")
inline fun ID.toULongOrNull(notNumerical: ID.() -> ULong? = { literal.toULongOrNull() }): ULong?

尝试将 this 转化为 ULong。 如果为 NumericalID 则直接使用 NumericalID.toLong.toULong, 否则使用 notNumerical 转化。默认会尝试使用 literal.toULongOrNull()