
walkmc.extensions.Registries.kt Maven / Gradle / Ivy
@file:Suppress("NOTHING_TO_INLINE")
package walkmc.extensions
import walkmc.cache.*
/**
* Creates a new empty registry specified by the key [K] and value [V].
*/
inline fun cacheOf(): ICache = StandardCache()
/**
* Creates a new empty immutable registry specified by the key [K] and value [V].
*/
inline fun immutableCacheOf(): ICache = ImmutableCache()
/**
* Creates a new empty concurrent registry specified by the key [K] and value [V].
*/
inline fun concurrentCacheOf(): ICache = ConcurrentCache()
/**
* Creates a new empty expiring registry specified by the key [K] and value [V].
*/
inline fun expirableCacheOf(): ExpirableMap = ExpirableMap()
/**
* Returns a value from this track by the specified [key].
*/
inline fun Map.fromKey(key: K): V? = get(key)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy