name.remal.com.google.common.cache.CacheBuilder.kt Maven / Gradle / Ivy
package name.remal
import com.google.common.cache.CacheBuilder
import com.google.common.cache.CacheLoader
import com.google.common.cache.LoadingCache
fun CacheBuilder.build(loader: (key: K) -> V): LoadingCache {
return build(object : CacheLoader() {
override fun load(key: K) = loader(key)
})
}