Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class CyclicIterator<T> : Iterator<T>

无限循环的环形迭代器。CyclicIterator 将会永远拥有结果。

Link copied to clipboard
typealias Digest = MessageDigest
Link copied to clipboard
interface LazyValue<T> : SuspendFunction0<T>

一个类似于 Deferred 的支持suspend的懒加载器。

Link copied to clipboard

随机ID工具。

Link copied to clipboard
class WeakMap<K, V>(delegateMap: MutableMap<K, WeakReference<V>>) : MutableMap<K, V>

Value值为 weak 的 Map。

Functions

Link copied to clipboard
Link copied to clipboard
fun <T> completedLazyValue(value: T): LazyValue<T>
Link copied to clipboard
fun <T> constIterator(value: T): Iterator<T>
Link copied to clipboard
fun digest(algorithm: String): Digest

根据一个算法名称得到一个对应的信息摘要算法.

inline fun digest(algorithm: String, block: Digest.() -> Unit): ByteArray

根据一个算法名称得到一个对应的信息摘要算法, 并在 block 中使用它, 然后得到摘要结果。

Link copied to clipboard
Link copied to clipboard
fun <T> indexedCycleIterator(lastIndex: Int, valueGet: (Int) -> T): Iterator<T>
Link copied to clipboard
fun <T> lazyValue(initializer: suspend () -> T): LazyValue<T>
Link copied to clipboard
fun <T> CoroutineScope.lazyValue(init: Boolean = false, initializer: suspend () -> T): LazyValue<T>
Link copied to clipboard
inline fun md5(block: Digest.() -> Unit): ByteArray

尝试获取 md5 摘要算法,并使用它得到摘要结果。

Link copied to clipboard
fun randomIdStr(random: Random = Random): String

得到一个随机ID字符串。

Link copied to clipboard
inline suspend fun <T> runWithInterruptible(context: CoroutineContext = RunWithInterruptibleDefaultCoroutineContext, crossinline block: () -> T): T

默认使用 DefaultBlockingDispatcher 作为调度器的可中断执行函数。

Link copied to clipboard
fun <T1, T2> suspendConsumer(isRunWithInterruptible: Boolean = true, function: BiConsumer<T1, T2>): suspend (T1, T2) -> Unit
fun <T1, T2, T3> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer3<T1, T2, T3>): suspend (T1, T2, T3) -> Unit
fun <T1, T2, T3, T4> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer4<T1, T2, T3, T4>): suspend (T1, T2, T3, T4) -> Unit
fun <T1, T2, T3, T4, T5> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer5<T1, T2, T3, T4, T5>): suspend (T1, T2, T3, T4, T5) -> Unit

fun <T> suspendConsumer(isRunWithInterruptible: Boolean = true, function: Consumer<T>): suspend (T) -> Unit

Kotlin api:

Link copied to clipboard
fun <T1, T2, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: BiFunction<T1, T2, R>): suspend (T1, T2) -> R
fun <T1, T2, T3, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: (T1, T2, T3) -> R): suspend (T1, T2, T3) -> R
fun <T1, T2, T3, T4, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: (T1, T2, T3, T4) -> R): suspend (T1, T2, T3, T4) -> R
fun <T1, T2, T3, T4, T5, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: (T1, T2, T3, T4, T5) -> R): suspend (T1, T2, T3, T4, T5) -> R

fun <T, R> suspendFunction(isRunWithInterruptible: Boolean = true, function: Function<T, R>): suspend (T) -> R

Kotlin api:

Link copied to clipboard
fun <R> suspendSupplier(isRunWithInterruptible: Boolean = true, function: Supplier<R>): suspend () -> R

Kotlin api:

Link copied to clipboard

获取系统参数。

Link copied to clipboard

将一个 ByteArray 转为16进制的字符串。

将一个16进制的字符串转化为字节数组。