commonMain.DataLoaderCacheMapImpl.kt Maven / Gradle / Ivy
The newest version!
package io.fluidsonic.dataloader
internal class DataLoaderCacheMapImpl : DataLoaderCacheMap {
// FIXME concurrent?
private val map: HashMap = hashMapOf()
override fun clear() {
map.clear()
}
override fun delete(key: Key) {
map.remove(key)
}
override fun get(key: Key) =
map[key]
override fun set(key: Key, value: Value) {
map[key] = value
}
}
public fun DataLoader.Companion.cacheMap(): DataLoaderCacheMap =
DataLoaderCacheMapImpl()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy