io.getunleash.cache.InMemoryToggleCache.kt Maven / Gradle / Ivy
package io.getunleash.cache
import io.getunleash.data.Toggle
import java.util.concurrent.ConcurrentHashMap
class InMemoryToggleCache : ToggleCache {
private val internalCache = ConcurrentHashMap>()
override fun read(key: String): Map {
return internalCache[key] ?: emptyMap()
}
override fun write(key: String, value: Map) {
internalCache[key] = value
}
}